olp-cpp-sdk
1.21.0
|
A client for API lookup requests. More...
#include <ApiLookupClient.h>
Public Types | |
using | LookupApiResponse = ApiResponse< OlpClient, ApiError > |
Alias for the lookup API response. | |
using | LookupApiCallback = std::function< void(LookupApiResponse)> |
Alias for the lookup API callback. | |
Public Member Functions | |
ApiLookupClient (const HRN &catalog, const OlpClientSettings &settings) | |
Creates the ApiLookupClient instance. More... | |
LookupApiResponse | LookupApi (const std::string &service, const std::string &service_version, FetchOptions options, CancellationContext context) |
Gets a API for a single service sync, internally uses ApiLookupSettings from OlpClientSettings. More... | |
CancellationToken | LookupApi (const std::string &service, const std::string &service_version, FetchOptions options, LookupApiCallback callback) |
Gets an API for a single service asynchronously. More... | |
A client for API lookup requests.
|
explicit |
Creates the ApiLookupClient
instance.
catalog | The catalog HRN. |
settings | The OlpClientSettings instance. |
LookupApiResponse olp::client::ApiLookupClient::LookupApi | ( | const std::string & | service, |
const std::string & | service_version, | ||
FetchOptions | options, | ||
CancellationContext | context | ||
) |
Gets a API for a single service sync, internally uses ApiLookupSettings from OlpClientSettings.
service | The name of the required service. |
service_version | The version of the required service. |
options | The fetch option that should be used to set the source from which data should be fetched. |
context | The CancellationContext instance that is used to cancel the request. |
LookupApiResponse
that contains the OlpClient
instance or an error. CancellationToken olp::client::ApiLookupClient::LookupApi | ( | const std::string & | service, |
const std::string & | service_version, | ||
FetchOptions | options, | ||
LookupApiCallback | callback | ||
) |
Gets an API for a single service asynchronously.
Internally, it uses ApiLookupSettings
from OlpClientSettings
.
service | The name of the required service. |
service_version | The version of the required service. |
options | The fetch option that should be used to set the source from which data should be fetched. |
callback | The function callback used to receive the LookupApiResponse instance. |