olp-cpp-sdk  1.21.0
Public Types | Public Attributes | List of all members
olp::client::ApiLookupSettings Struct Reference

Settings to provide URLs for API lookup requests. More...

#include <OlpClientSettings.h>

Public Types

using LookupEndpointProvider = std::function< std::string(const std::string &)>
 An alias for the lookup provider function. More...
 
using CatalogEndpointProvider = std::function< std::string(const HRN &)>
 An alias for the catalog endpoint provider function. More...
 

Public Attributes

LookupEndpointProvider lookup_endpoint_provider
 The provider of endpoint for API lookup requests. More...
 
CatalogEndpointProvider catalog_endpoint_provider = nullptr
 The endpoint provider for API requests. More...
 

Detailed Description

Settings to provide URLs for API lookup requests.

Member Typedef Documentation

◆ CatalogEndpointProvider

using olp::client::ApiLookupSettings::CatalogEndpointProvider = std::function<std::string(const HRN&)>

An alias for the catalog endpoint provider function.

Catalogs that have a static URL or can be accessed through a proxy service can input the URL provider here. This URL provider is taken by the ApiLookupClient and returned directly to the caller without any requests to the API Lookup Service.

Note
This call should be synchronous without any tasks scheduled in TaskScheduler as it might result in a dead-lock.
Returns
An empty string if the catalog is invalid or unknown.

◆ LookupEndpointProvider

using olp::client::ApiLookupSettings::LookupEndpointProvider = std::function<std::string(const std::string&)>

An alias for the lookup provider function.

Users of this provider should always return full lookup API path, e.g. for "here" partition return "https://api-lookup.data.api.platform.here.com/lookup/v1"

Note
Return empty string in case of an invalid or unknown partition.
This call should be synchronous without any tasks scheduled on the TaskScheduler as this might result in a dead-lock.

Member Data Documentation

◆ catalog_endpoint_provider

CatalogEndpointProvider olp::client::ApiLookupSettings::catalog_endpoint_provider = nullptr

The endpoint provider for API requests.

If some of the catalogs have fixed URLs and do not need the API Lookup Service, you can provide the static URL via CatalogEndpointProvider. Every request will receive this URL from ApiLookupClient without any HTTP requests to the API Lookup Service. CatalogEndpointProvider is called before lookup_endpoint_provider, and if the output is not empty, lookup_endpoint_provider is not called additionally.

◆ lookup_endpoint_provider

LookupEndpointProvider olp::client::ApiLookupSettings::lookup_endpoint_provider
Initial value:
=
DefaultLookupEndpointProvider()

The provider of endpoint for API lookup requests.

The lookup API endpoint provider will be called prior to every API lookup attempt to get the API Lookup URL which shall be asked for the catalog URLs.

By default DefaultLookupEndpointProvider is being used.


The documentation for this struct was generated from the following file: