C++ Server-Side SDK
LaunchDarkly SDK
Public Member Functions | List of all members
launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK > Class Template Reference

#include <http_properties_builder.hpp>

Public Member Functions

 HttpPropertiesBuilder ()
 
 HttpPropertiesBuilder (built::HttpProperties const &properties)
 
HttpPropertiesBuilderConnectTimeout (std::chrono::milliseconds connect_timeout)
 
HttpPropertiesBuilderReadTimeout (std::chrono::milliseconds read_timeout)
 
HttpPropertiesBuilderWriteTimeout (std::chrono::milliseconds write_timeout)
 
HttpPropertiesBuilderResponseTimeout (std::chrono::milliseconds response_timeout)
 
HttpPropertiesBuilderWrapperName (std::string wrapper_name)
 
HttpPropertiesBuilderWrapperVersion (std::string wrapper_version)
 
HttpPropertiesBuilderHeaders (std::map< std::string, std::string > base_headers)
 
HttpPropertiesBuilderHeader (std::string key, std::optional< std::string > value)
 
HttpPropertiesBuilderTls (TlsBuilder< SDK > builder)
 
built::HttpProperties Build () const
 

Detailed Description

template<typename SDK>
class launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >

Class used for building a set of HttpProperties.

Template Parameters
SDKThe SDK type to build properties for. This affects the default values of the built properties.

Constructor & Destructor Documentation

◆ HttpPropertiesBuilder() [1/2]

Construct a new HttpPropertiesBuilder. The builder will use the default properties based on the SDK type. Setting a property will override the default value.

◆ HttpPropertiesBuilder() [2/2]

Create a properties builder from an initial set of properties. This can be useful when extending a set of properties for a request. For instance to add extra headers.

HttpPropertiesBuilder(my_properties)
.Header("authorization", "my-key")
.Build();
HttpPropertiesBuilder()
Definition: http_properties_builder.cpp:42
Parameters
propertiesThe properties to start with.

Member Function Documentation

◆ Build()

Build a set of HttpProperties.

Returns
The built properties.

◆ ConnectTimeout()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::ConnectTimeout ( std::chrono::milliseconds  connect_timeout)

The network connection timeout.

Parameters
connect_timeoutThe connect timeout.
Returns
A reference to this builder.

◆ Header()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::Header ( std::string  key,
std::optional< std::string >  value 
)

Set an optional header value. If the value is std::nullopt, any existing header by that name is removed.

Parameters
nameThe name of the header.
valueThe optional header value.
Returns
A reference to this builder.

◆ Headers()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::Headers ( std::map< std::string, std::string >  base_headers)

Set all custom headers. This will replace any other customer headers that were set with the Header method, or any previously set headers using the Headers method.

Parameters
base_headersThe custom headers.
Returns
A reference to this builder.

◆ ReadTimeout()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::ReadTimeout ( std::chrono::milliseconds  read_timeout)

Set a read timeout. This is the time after the first byte has been received that a read has to complete.

Parameters
read_timeoutThe read timeout.
Returns
A reference to this builder.

◆ ResponseTimeout()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::ResponseTimeout ( std::chrono::milliseconds  response_timeout)

The time for the first byte to be received during a read. If a byte is not received within this time, then the request will be cancelled.

Parameters
response_timeoutThe response timeout.
Returns
A reference to this builder.

◆ Tls()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::Tls ( TlsBuilder< SDK >  builder)

Sets the builder for TLS properties.

Parameters
builderThe TLS property builder.
Returns
A reference to this builder.

◆ WrapperName()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::WrapperName ( std::string  wrapper_name)

This should be used for wrapper SDKs to set the wrapper name.

Wrapper information will be included in request headers.

Parameters
wrapper_nameThe name of the wrapper.
Returns
A reference to this builder.

◆ WrapperVersion()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::WrapperVersion ( std::string  wrapper_version)

This should be used for wrapper SDKs to set the wrapper version.

Wrapper information will be included in request headers.

Parameters
wrapper_versionThe version of the wrapper.
Returns
A reference to this builder.

◆ WriteTimeout()

template<typename SDK >
HttpPropertiesBuilder< SDK > & launchdarkly::config::shared::builders::HttpPropertiesBuilder< SDK >::WriteTimeout ( std::chrono::milliseconds  write_timeout)

Set a write timeout. This is how long it takes to perform a Write operation.

Parameters
write_timeoutThe write timeout.
Returns
A reference to this builder.

The documentation for this class was generated from the following files: