Documentation
¶
Index ¶
- type HTTPClient
- type Middleware
- type MiddlewareNext
- type RequestOption
- func WithBaseURL(base string) RequestOption
- func WithBearerToken(value string) RequestOption
- func WithCallForwardingSignalToken(value string) RequestOption
- func WithConnectedNetworkTypeNotificationsAPIKey(value string) RequestOption
- func WithConnectedNetworkTypeToken(value string) RequestOption
- func WithConnectivityInsightsNotificationsAPIKey(value string) RequestOption
- func WithConnectivityInsightsToken(value string) RequestOption
- func WithCustomerInsightsToken(value string) RequestOption
- func WithDebugLog(logger *log.Logger) RequestOption
- func WithDeviceIdentifierToken(value string) RequestOption
- func WithDeviceLocationNotificationsAPIKey(value string) RequestOption
- func WithDeviceLocationToken(value string) RequestOption
- func WithDeviceReachabilityStatusNotificationsAPIKey(value string) RequestOption
- func WithDeviceReachabilityStatusToken(value string) RequestOption
- func WithDeviceRoamingStatusNotificationsAPIKey(value string) RequestOption
- func WithDeviceRoamingStatusToken(value string) RequestOption
- func WithDeviceSwapToken(value string) RequestOption
- func WithEnvironmentProduction() RequestOption
- func WithHTTPClient(client HTTPClient) RequestOption
- func WithHeader(key, value string) RequestOption
- func WithHeaderAdd(key, value string) RequestOption
- func WithHeaderDel(key string) RequestOption
- func WithJSONDel(key string) RequestOption
- func WithJSONSet(key string, value any) RequestOption
- func WithKYCAgeVerificationToken(value string) RequestOption
- func WithKYCFillInToken(value string) RequestOption
- func WithKYCMatchToken(value string) RequestOption
- func WithMaxRetries(retries int) RequestOption
- func WithMiddleware(middlewares ...Middleware) RequestOption
- func WithNotificationsAPIKey(value string) RequestOption
- func WithNumberRecyclingToken(value string) RequestOption
- func WithOtpValidationToken(value string) RequestOption
- func WithPopulationDensityDataNotificationsAPIKey(value string) RequestOption
- func WithPopulationDensityDataToken(value string) RequestOption
- func WithQualityOnDemandToken(value string) RequestOption
- func WithQuery(key, value string) RequestOption
- func WithQueryAdd(key, value string) RequestOption
- func WithQueryDel(key string) RequestOption
- func WithRegionDeviceCountNotificationsAPIKey(value string) RequestOption
- func WithRegionDeviceCountToken(value string) RequestOption
- func WithRequestBody(contentType string, body any) RequestOption
- func WithRequestTimeout(dur time.Duration) RequestOption
- func WithResponseBodyInto(dst any) RequestOption
- func WithResponseInto(dst **http.Response) RequestOption
- func WithSimSwapNotificationsAPIKey(value string) RequestOption
- func WithSimSwapToken(value string) RequestOption
- func WithTenureToken(value string) RequestOption
- func WithWebRtcToken(value string) RequestOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient is primarily used to describe an *http.Client, but also supports custom implementations.
For bespoke implementations, prefer using an *http.Client with a custom transport. See http.RoundTripper for further information.
type Middleware ¶
Middleware is a function which intercepts HTTP requests, processing or modifying them, and then passing the request to the next middleware or handler in the chain by calling the provided MiddlewareNext function.
type MiddlewareNext ¶
MiddlewareNext is a function which is called by a middleware to pass an HTTP request to the next stage in the middleware chain.
type RequestOption ¶
type RequestOption = requestconfig.RequestOption
RequestOption is an option for the requests made by the camara API Client which can be supplied to clients, services, and methods. You can read more about this functional options pattern in our README.
func WithBaseURL ¶
func WithBaseURL(base string) RequestOption
WithBaseURL returns a RequestOption that sets the BaseURL for the client.
For security reasons, ensure that the base URL is trusted.
func WithBearerToken ¶
func WithBearerToken(value string) RequestOption
WithBearerToken returns a RequestOption that sets the client setting "bearer_token".
func WithCallForwardingSignalToken ¶
func WithCallForwardingSignalToken(value string) RequestOption
WithCallForwardingSignalToken returns a RequestOption that sets the client setting "call_forwarding_signal_token".
func WithConnectedNetworkTypeNotificationsAPIKey ¶
func WithConnectedNetworkTypeNotificationsAPIKey(value string) RequestOption
WithConnectedNetworkTypeNotificationsAPIKey returns a RequestOption that sets the client setting "connected_network_type_notifications_api_key".
func WithConnectedNetworkTypeToken ¶
func WithConnectedNetworkTypeToken(value string) RequestOption
WithConnectedNetworkTypeToken returns a RequestOption that sets the client setting "connected_network_type_token".
func WithConnectivityInsightsNotificationsAPIKey ¶
func WithConnectivityInsightsNotificationsAPIKey(value string) RequestOption
WithConnectivityInsightsNotificationsAPIKey returns a RequestOption that sets the client setting "connectivity_insights_notifications_api_key".
func WithConnectivityInsightsToken ¶
func WithConnectivityInsightsToken(value string) RequestOption
WithConnectivityInsightsToken returns a RequestOption that sets the client setting "connectivity_insights_token".
func WithCustomerInsightsToken ¶
func WithCustomerInsightsToken(value string) RequestOption
WithCustomerInsightsToken returns a RequestOption that sets the client setting "customer_insights_token".
func WithDebugLog ¶
func WithDebugLog(logger *log.Logger) RequestOption
WithDebugLog logs the HTTP request and response content. If the logger parameter is nil, it uses the default logger.
WithDebugLog is for debugging and development purposes only. It should not be used in production code. The behavior and interface of WithDebugLog is not guaranteed to be stable.
func WithDeviceIdentifierToken ¶
func WithDeviceIdentifierToken(value string) RequestOption
WithDeviceIdentifierToken returns a RequestOption that sets the client setting "device_identifier_token".
func WithDeviceLocationNotificationsAPIKey ¶
func WithDeviceLocationNotificationsAPIKey(value string) RequestOption
WithDeviceLocationNotificationsAPIKey returns a RequestOption that sets the client setting "device_location_notifications_api_key".
func WithDeviceLocationToken ¶
func WithDeviceLocationToken(value string) RequestOption
WithDeviceLocationToken returns a RequestOption that sets the client setting "device_location_token".
func WithDeviceReachabilityStatusNotificationsAPIKey ¶
func WithDeviceReachabilityStatusNotificationsAPIKey(value string) RequestOption
WithDeviceReachabilityStatusNotificationsAPIKey returns a RequestOption that sets the client setting "device_reachability_status_notifications_api_key".
func WithDeviceReachabilityStatusToken ¶
func WithDeviceReachabilityStatusToken(value string) RequestOption
WithDeviceReachabilityStatusToken returns a RequestOption that sets the client setting "device_reachability_status_token".
func WithDeviceRoamingStatusNotificationsAPIKey ¶
func WithDeviceRoamingStatusNotificationsAPIKey(value string) RequestOption
WithDeviceRoamingStatusNotificationsAPIKey returns a RequestOption that sets the client setting "device_roaming_status_notifications_api_key".
func WithDeviceRoamingStatusToken ¶
func WithDeviceRoamingStatusToken(value string) RequestOption
WithDeviceRoamingStatusToken returns a RequestOption that sets the client setting "device_roaming_status_token".
func WithDeviceSwapToken ¶
func WithDeviceSwapToken(value string) RequestOption
WithDeviceSwapToken returns a RequestOption that sets the client setting "device_swap_token".
func WithEnvironmentProduction ¶
func WithEnvironmentProduction() RequestOption
WithEnvironmentProduction returns a RequestOption that sets the current environment to be the "production" environment. An environment specifies which base URL to use by default.
func WithHTTPClient ¶
func WithHTTPClient(client HTTPClient) RequestOption
WithHTTPClient returns a RequestOption that changes the underlying http client used to make this request, which by default is http.DefaultClient.
For custom uses cases, it is recommended to provide an *http.Client with a custom http.RoundTripper as its transport, rather than directly implementing HTTPClient.
func WithHeader ¶
func WithHeader(key, value string) RequestOption
WithHeader returns a RequestOption that sets the header value to the associated key. It overwrites any value if there was one already present.
func WithHeaderAdd ¶
func WithHeaderAdd(key, value string) RequestOption
WithHeaderAdd returns a RequestOption that adds the header value to the associated key. It appends onto any existing values.
func WithHeaderDel ¶
func WithHeaderDel(key string) RequestOption
WithHeaderDel returns a RequestOption that deletes the header value(s) associated with the given key.
func WithJSONDel ¶
func WithJSONDel(key string) RequestOption
WithJSONDel returns a RequestOption that deletes the body's JSON value associated with the key. The key accepts a string as defined by the sjson format.
func WithJSONSet ¶
func WithJSONSet(key string, value any) RequestOption
WithJSONSet returns a RequestOption that sets the body's JSON value associated with the key. The key accepts a string as defined by the sjson format.
func WithKYCAgeVerificationToken ¶
func WithKYCAgeVerificationToken(value string) RequestOption
WithKYCAgeVerificationToken returns a RequestOption that sets the client setting "kyc_age_verification_token".
func WithKYCFillInToken ¶
func WithKYCFillInToken(value string) RequestOption
WithKYCFillInToken returns a RequestOption that sets the client setting "kyc_fill_in_token".
func WithKYCMatchToken ¶
func WithKYCMatchToken(value string) RequestOption
WithKYCMatchToken returns a RequestOption that sets the client setting "kyc_match_token".
func WithMaxRetries ¶
func WithMaxRetries(retries int) RequestOption
WithMaxRetries returns a RequestOption that sets the maximum number of retries that the client attempts to make. When given 0, the client only makes one request. By default, the client retries two times.
WithMaxRetries panics when retries is negative.
func WithMiddleware ¶
func WithMiddleware(middlewares ...Middleware) RequestOption
WithMiddleware returns a RequestOption that applies the given middleware to the requests made. Each middleware will execute in the order they were given.
func WithNotificationsAPIKey ¶
func WithNotificationsAPIKey(value string) RequestOption
WithNotificationsAPIKey returns a RequestOption that sets the client setting "notifications_api_key".
func WithNumberRecyclingToken ¶
func WithNumberRecyclingToken(value string) RequestOption
WithNumberRecyclingToken returns a RequestOption that sets the client setting "number_recycling_token".
func WithOtpValidationToken ¶
func WithOtpValidationToken(value string) RequestOption
WithOtpValidationToken returns a RequestOption that sets the client setting "otp_validation_token".
func WithPopulationDensityDataNotificationsAPIKey ¶
func WithPopulationDensityDataNotificationsAPIKey(value string) RequestOption
WithPopulationDensityDataNotificationsAPIKey returns a RequestOption that sets the client setting "population_density_data_notifications_api_key".
func WithPopulationDensityDataToken ¶
func WithPopulationDensityDataToken(value string) RequestOption
WithPopulationDensityDataToken returns a RequestOption that sets the client setting "population_density_data_token".
func WithQualityOnDemandToken ¶
func WithQualityOnDemandToken(value string) RequestOption
WithQualityOnDemandToken returns a RequestOption that sets the client setting "quality_on_demand_token".
func WithQuery ¶
func WithQuery(key, value string) RequestOption
WithQuery returns a RequestOption that sets the query value to the associated key. It overwrites any value if there was one already present.
func WithQueryAdd ¶
func WithQueryAdd(key, value string) RequestOption
WithQueryAdd returns a RequestOption that adds the query value to the associated key. It appends onto any existing values.
func WithQueryDel ¶
func WithQueryDel(key string) RequestOption
WithQueryDel returns a RequestOption that deletes the query value(s) associated with the key.
func WithRegionDeviceCountNotificationsAPIKey ¶
func WithRegionDeviceCountNotificationsAPIKey(value string) RequestOption
WithRegionDeviceCountNotificationsAPIKey returns a RequestOption that sets the client setting "region_device_count_notifications_api_key".
func WithRegionDeviceCountToken ¶
func WithRegionDeviceCountToken(value string) RequestOption
WithRegionDeviceCountToken returns a RequestOption that sets the client setting "region_device_count_token".
func WithRequestBody ¶
func WithRequestBody(contentType string, body any) RequestOption
WithRequestBody returns a RequestOption that provides a custom serialized body with the given content type.
body accepts an io.Reader or raw []bytes.
func WithRequestTimeout ¶
func WithRequestTimeout(dur time.Duration) RequestOption
WithRequestTimeout returns a RequestOption that sets the timeout for each request attempt. This should be smaller than the timeout defined in the context, which spans all retries.
func WithResponseBodyInto ¶
func WithResponseBodyInto(dst any) RequestOption
WithResponseBodyInto returns a RequestOption that overwrites the deserialization target with the given destination. If provided, we don't deserialize into the default struct.
func WithResponseInto ¶
func WithResponseInto(dst **http.Response) RequestOption
WithResponseInto returns a RequestOption that copies the *http.Response into the given address.
func WithSimSwapNotificationsAPIKey ¶
func WithSimSwapNotificationsAPIKey(value string) RequestOption
WithSimSwapNotificationsAPIKey returns a RequestOption that sets the client setting "sim_swap_notifications_api_key".
func WithSimSwapToken ¶
func WithSimSwapToken(value string) RequestOption
WithSimSwapToken returns a RequestOption that sets the client setting "sim_swap_token".
func WithTenureToken ¶
func WithTenureToken(value string) RequestOption
WithTenureToken returns a RequestOption that sets the client setting "tenure_token".
func WithWebRtcToken ¶
func WithWebRtcToken(value string) RequestOption
WithWebRtcToken returns a RequestOption that sets the client setting "web_rtc_token".