Google Cloud Storage C++ Client  1.42.0
A C++ Client Library for Google Cloud Storage
Public Member Functions | Static Public Member Functions | List of all members
google::cloud::storage::ClientOptions Class Reference

Describes the configuration for a storage::Client object. More...

#include <google/cloud/storage/client_options.h>

Public Member Functions

 ClientOptions (std::shared_ptr< oauth2::Credentials > credentials)
 Constructor with channel options. More...
 
 ClientOptions (std::shared_ptr< oauth2::Credentials > credentials, ChannelOptions channel_options)
 Constructor with channel options. More...
 
std::shared_ptr< oauth2::Credentialscredentials () const
 
ClientOptionsset_credentials (std::shared_ptr< oauth2::Credentials > c)
 
std::string const & endpoint () const
 
ClientOptionsset_endpoint (std::string endpoint)
 
std::string const & iam_endpoint () const
 
ClientOptionsset_iam_endpoint (std::string endpoint)
 
std::string const & version () const
 
ClientOptionsset_version (std::string version)
 
bool enable_http_tracing () const
 
ClientOptionsset_enable_http_tracing (bool enable)
 
bool enable_raw_client_tracing () const
 
ClientOptionsset_enable_raw_client_tracing (bool enable)
 
std::string const & project_id () const
 
ClientOptionsset_project_id (std::string v)
 
std::size_t connection_pool_size () const
 
ClientOptionsset_connection_pool_size (std::size_t size)
 
std::size_t download_buffer_size () const
 
ClientOptionsSetDownloadBufferSize (std::size_t size)
 
std::size_t upload_buffer_size () const
 
ClientOptionsSetUploadBufferSize (std::size_t size)
 
std::string const & user_agent_prefix () const
 
ClientOptionsadd_user_agent_prefix (std::string prefix)
 
ClientOptionsadd_user_agent_prefx (std::string const &v)
 
std::size_t maximum_simple_upload_size () const
 
ClientOptionsset_maximum_simple_upload_size (std::size_t v)
 
bool enable_ssl_locking_callbacks () const
 If true and using OpenSSL 1.0.2 the library configures the OpenSSL callbacks for locking. More...
 
ClientOptionsset_enable_ssl_locking_callbacks (bool v)
 If true and using OpenSSL 1.0.2 the library configures the OpenSSL callbacks for locking. More...
 
bool enable_sigpipe_handler () const
 
ClientOptionsset_enable_sigpipe_handler (bool v)
 
std::size_t maximum_socket_recv_size () const
 
ClientOptionsset_maximum_socket_recv_size (std::size_t v)
 
std::size_t maximum_socket_send_size () const
 
ClientOptionsset_maximum_socket_send_size (std::size_t v)
 
ChannelOptionschannel_options ()
 
ChannelOptions const & channel_options () const
 
std::chrono::seconds download_stall_timeout () const
 Control the maximum amount of time allowed for "stalls" during a download. More...
 
ClientOptionsset_download_stall_timeout (std::chrono::seconds v)
 

Static Public Member Functions

static StatusOr< ClientOptionsCreateDefaultClientOptions ()
 Creates a ClientOptions with Google Application Default Credentials. More...
 
static StatusOr< ClientOptionsCreateDefaultClientOptions (ChannelOptions const &channel_options)
 

Detailed Description

Describes the configuration for a storage::Client object.

By default, several environment variables are read to configure the client:

Definition at line 107 of file client_options.h.

Constructor & Destructor Documentation

◆ ClientOptions() [1/2]

google::cloud::storage::ClientOptions::ClientOptions ( std::shared_ptr< oauth2::Credentials credentials)
inlineexplicit

Constructor with channel options.

Deprecated:
use google::cloud::Options instead.
Parameters
credentialshow to authenticate to the client. Using a nullptr for credentials results in undefined behavior.

Definition at line 117 of file client_options.h.

◆ ClientOptions() [2/2]

google::cloud::storage::ClientOptions::ClientOptions ( std::shared_ptr< oauth2::Credentials credentials,
ChannelOptions  channel_options 
)

Constructor with channel options.

Deprecated:
use google::cloud::Options instead.
Parameters
credentialshow to authenticate to the client. Using a nullptr for credentials results in undefined behavior.
channel_optionsthe configuration for SSL certificate validation.

Member Function Documentation

◆ add_user_agent_prefix()

ClientOptions& google::cloud::storage::ClientOptions::add_user_agent_prefix ( std::string  prefix)
inline

◆ add_user_agent_prefx()

ClientOptions& google::cloud::storage::ClientOptions::add_user_agent_prefx ( std::string const &  v)
inline
Deprecated:
use add_user_agent_prefix() instead.

Definition at line 308 of file client_options.h.

◆ channel_options() [1/2]

ChannelOptions& google::cloud::storage::ClientOptions::channel_options ( )
inline
Deprecated:
Use google::cloud::Options and CAPathOption instead.

Definition at line 404 of file client_options.h.

◆ channel_options() [2/2]

ChannelOptions const& google::cloud::storage::ClientOptions::channel_options ( ) const
inline
Deprecated:
Use google::cloud::Options and CAPathOption instead.

Definition at line 407 of file client_options.h.

◆ connection_pool_size()

std::size_t google::cloud::storage::ClientOptions::connection_pool_size ( ) const
inline

◆ CreateDefaultClientOptions() [1/2]

static StatusOr<ClientOptions> google::cloud::storage::ClientOptions::CreateDefaultClientOptions ( )
static

Creates a ClientOptions with Google Application Default Credentials.

If Application Default Credentials could not be loaded, this returns a Status with failure details. If the CLOUD_STORAGE_EMULATOR_ENDPOINT environment variable is set, this function instead uses an AnonymousCredentials to configure the client.

Deprecated:
Please use google::cloud::Options instead.

◆ CreateDefaultClientOptions() [2/2]

static StatusOr<ClientOptions> google::cloud::storage::ClientOptions::CreateDefaultClientOptions ( ChannelOptions const &  channel_options)
static
Deprecated:
Please use google::cloud::Options instead.

◆ credentials()

std::shared_ptr<oauth2::Credentials> google::cloud::storage::ClientOptions::credentials ( ) const
inline
Deprecated:
Use google::cloud::Options and Oauth2CredentialsOption instead.

Definition at line 150 of file client_options.h.

◆ download_buffer_size()

std::size_t google::cloud::storage::ClientOptions::download_buffer_size ( ) const
inline

◆ download_stall_timeout()

std::chrono::seconds google::cloud::storage::ClientOptions::download_stall_timeout ( ) const
inline

Control the maximum amount of time allowed for "stalls" during a download.

A download that receives no data is considered "stalled". If the download remains stalled for more than the time set in this option then the download is aborted.

The default value is 2 minutes. Can be disabled by setting the value to 0.

Deprecated:
Use google::cloud::Options and DownloadStallTimeoutOption instead.

Definition at line 422 of file client_options.h.

◆ enable_http_tracing()

bool google::cloud::storage::ClientOptions::enable_http_tracing ( ) const

◆ enable_raw_client_tracing()

bool google::cloud::storage::ClientOptions::enable_raw_client_tracing ( ) const

◆ enable_sigpipe_handler()

bool google::cloud::storage::ClientOptions::enable_sigpipe_handler ( ) const
inline
Deprecated:
Use google::cloud::Options and EnableCurlSigpipeOption instead.

Definition at line 356 of file client_options.h.

◆ enable_ssl_locking_callbacks()

bool google::cloud::storage::ClientOptions::enable_ssl_locking_callbacks ( ) const
inline

If true and using OpenSSL 1.0.2 the library configures the OpenSSL callbacks for locking.

Deprecated:
Use google::cloud::options and EnableCurlSslLockingOption instead.

Definition at line 336 of file client_options.h.

◆ endpoint()

std::string const& google::cloud::storage::ClientOptions::endpoint ( ) const
inline
Deprecated:
Use google::cloud::Options and RestEndpointOption instead.

Definition at line 165 of file client_options.h.

◆ iam_endpoint()

std::string const& google::cloud::storage::ClientOptions::iam_endpoint ( ) const
inline
Deprecated:
Use google::cloud::Options and IamEndpointOption instead.

Definition at line 180 of file client_options.h.

◆ maximum_simple_upload_size()

std::size_t google::cloud::storage::ClientOptions::maximum_simple_upload_size ( ) const
inline

◆ maximum_socket_recv_size()

std::size_t google::cloud::storage::ClientOptions::maximum_socket_recv_size ( ) const
inline

◆ maximum_socket_send_size()

std::size_t google::cloud::storage::ClientOptions::maximum_socket_send_size ( ) const
inline

◆ project_id()

std::string const& google::cloud::storage::ClientOptions::project_id ( ) const
inline
Deprecated:
Use google::cloud::Options and ProjectIdOption instead.

Definition at line 234 of file client_options.h.

◆ set_connection_pool_size()

ClientOptions& google::cloud::storage::ClientOptions::set_connection_pool_size ( std::size_t  size)
inline

◆ set_credentials()

ClientOptions& google::cloud::storage::ClientOptions::set_credentials ( std::shared_ptr< oauth2::Credentials c)
inline
Deprecated:
Use google::cloud::Options and Oauth2CredentialsOption instead.

Definition at line 157 of file client_options.h.

◆ set_download_stall_timeout()

ClientOptions& google::cloud::storage::ClientOptions::set_download_stall_timeout ( std::chrono::seconds  v)
inline

◆ set_enable_http_tracing()

ClientOptions& google::cloud::storage::ClientOptions::set_enable_http_tracing ( bool  enable)

◆ set_enable_raw_client_tracing()

ClientOptions& google::cloud::storage::ClientOptions::set_enable_raw_client_tracing ( bool  enable)

◆ set_enable_sigpipe_handler()

ClientOptions& google::cloud::storage::ClientOptions::set_enable_sigpipe_handler ( bool  v)
inline
Deprecated:
Use google::cloud::Options and EnableCurlSigpipeOption instead.

Definition at line 364 of file client_options.h.

◆ set_enable_ssl_locking_callbacks()

ClientOptions& google::cloud::storage::ClientOptions::set_enable_ssl_locking_callbacks ( bool  v)
inline

If true and using OpenSSL 1.0.2 the library configures the OpenSSL callbacks for locking.

Deprecated:
Use google::cloud::options and EnableCurlSslLockingOption instead.

Definition at line 347 of file client_options.h.

◆ set_endpoint()

ClientOptions& google::cloud::storage::ClientOptions::set_endpoint ( std::string  endpoint)
inline
Deprecated:
Use google::cloud::Options and RestEndpointOption instead.

Definition at line 172 of file client_options.h.

◆ set_iam_endpoint()

ClientOptions& google::cloud::storage::ClientOptions::set_iam_endpoint ( std::string  endpoint)
inline
Deprecated:
Use google::cloud::Options and IamEndpointOption instead.

Definition at line 187 of file client_options.h.

◆ set_maximum_simple_upload_size()

ClientOptions& google::cloud::storage::ClientOptions::set_maximum_simple_upload_size ( std::size_t  v)
inline

◆ set_maximum_socket_recv_size()

ClientOptions& google::cloud::storage::ClientOptions::set_maximum_socket_recv_size ( std::size_t  v)
inline

◆ set_maximum_socket_send_size()

ClientOptions& google::cloud::storage::ClientOptions::set_maximum_socket_send_size ( std::size_t  v)
inline

◆ set_project_id()

ClientOptions& google::cloud::storage::ClientOptions::set_project_id ( std::string  v)
inline
Deprecated:
Use google::cloud::Options and ProjectIdOption instead.

Definition at line 239 of file client_options.h.

◆ set_version()

ClientOptions& google::cloud::storage::ClientOptions::set_version ( std::string  version)
inline
Deprecated:
This was intended for development and not a public API.

Definition at line 202 of file client_options.h.

◆ SetDownloadBufferSize()

ClientOptions& google::cloud::storage::ClientOptions::SetDownloadBufferSize ( std::size_t  size)

◆ SetUploadBufferSize()

ClientOptions& google::cloud::storage::ClientOptions::SetUploadBufferSize ( std::size_t  size)

◆ upload_buffer_size()

std::size_t google::cloud::storage::ClientOptions::upload_buffer_size ( ) const
inline
Deprecated:
Use google::cloud::Options and UploadBufferSizeOption instead.

Definition at line 278 of file client_options.h.

◆ user_agent_prefix()

std::string const& google::cloud::storage::ClientOptions::user_agent_prefix ( ) const
inline

◆ version()

std::string const& google::cloud::storage::ClientOptions::version ( ) const
inline
Deprecated:
This was intended for development and not a public API.

Definition at line 195 of file client_options.h.