Google Cloud Storage C++ Client  1.24.0
A C++ Client Library for Google Cloud Storage
Public Member Functions | Static Public Member Functions | List of all members
google::cloud::storage::v1::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)
 
 ClientOptions (std::shared_ptr< oauth2::Credentials > credentials, ChannelOptions channel_options)
 
std::shared_ptr< oauth2::Credentialscredentials () const
 
ClientOptionsset_credentials (std::shared_ptr< oauth2::Credentials > credentials)
 
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)
 
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 74 of file client_options.h.

Constructor & Destructor Documentation

◆ ClientOptions() [1/2]

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

Definition at line 76 of file client_options.h.

◆ ClientOptions() [2/2]

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

Definition at line 116 of file client_options.cc.

Member Function Documentation

◆ add_user_agent_prefix()

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

Definition at line 151 of file client_options.h.

◆ add_user_agent_prefx()

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

Definition at line 160 of file client_options.h.

◆ channel_options() [1/2]

ChannelOptions& google::cloud::storage::v1::ClientOptions::channel_options ( )
inline

Definition at line 206 of file client_options.h.

◆ channel_options() [2/2]

ChannelOptions const& google::cloud::storage::v1::ClientOptions::channel_options ( ) const
inline

Definition at line 207 of file client_options.h.

◆ connection_pool_size()

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

Definition at line 138 of file client_options.h.

◆ CreateDefaultClientOptions() [1/2]

StatusOr< ClientOptions > google::cloud::storage::v1::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.

Definition at line 105 of file client_options.cc.

◆ CreateDefaultClientOptions() [2/2]

StatusOr< ClientOptions > google::cloud::storage::v1::ClientOptions::CreateDefaultClientOptions ( ChannelOptions const &  channel_options)
static

Definition at line 109 of file client_options.cc.

◆ credentials()

std::shared_ptr<oauth2::Credentials> google::cloud::storage::v1::ClientOptions::credentials ( ) const
inline

Definition at line 93 of file client_options.h.

◆ download_buffer_size()

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

Definition at line 144 of file client_options.h.

◆ download_stall_timeout()

std::chrono::seconds google::cloud::storage::v1::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.

Definition at line 219 of file client_options.h.

◆ enable_http_tracing()

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

Definition at line 120 of file client_options.h.

◆ enable_raw_client_tracing()

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

Definition at line 126 of file client_options.h.

◆ enable_sigpipe_handler()

bool google::cloud::storage::v1::ClientOptions::enable_sigpipe_handler ( ) const
inline

Definition at line 184 of file client_options.h.

◆ enable_ssl_locking_callbacks()

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

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

Definition at line 176 of file client_options.h.

◆ endpoint()

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

Definition at line 102 of file client_options.h.

◆ iam_endpoint()

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

Definition at line 108 of file client_options.h.

◆ maximum_simple_upload_size()

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

Definition at line 164 of file client_options.h.

◆ maximum_socket_recv_size()

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

Definition at line 190 of file client_options.h.

◆ maximum_socket_send_size()

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

Definition at line 198 of file client_options.h.

◆ project_id()

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

Definition at line 132 of file client_options.h.

◆ set_connection_pool_size()

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

Definition at line 139 of file client_options.h.

◆ set_credentials()

ClientOptions& google::cloud::storage::v1::ClientOptions::set_credentials ( std::shared_ptr< oauth2::Credentials credentials)
inline

Definition at line 96 of file client_options.h.

◆ set_download_stall_timeout()

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

Definition at line 222 of file client_options.h.

◆ set_enable_http_tracing()

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

Definition at line 121 of file client_options.h.

◆ set_enable_raw_client_tracing()

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

Definition at line 127 of file client_options.h.

◆ set_enable_sigpipe_handler()

ClientOptions& google::cloud::storage::v1::ClientOptions::set_enable_sigpipe_handler ( bool  v)
inline

Definition at line 185 of file client_options.h.

◆ set_enable_ssl_locking_callbacks()

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

Definition at line 179 of file client_options.h.

◆ set_endpoint()

ClientOptions& google::cloud::storage::v1::ClientOptions::set_endpoint ( std::string  endpoint)
inline

Definition at line 103 of file client_options.h.

◆ set_iam_endpoint()

ClientOptions& google::cloud::storage::v1::ClientOptions::set_iam_endpoint ( std::string  endpoint)
inline

Definition at line 109 of file client_options.h.

◆ set_maximum_simple_upload_size()

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

Definition at line 167 of file client_options.h.

◆ set_maximum_socket_recv_size()

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

Definition at line 193 of file client_options.h.

◆ set_maximum_socket_send_size()

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

Definition at line 201 of file client_options.h.

◆ set_project_id()

ClientOptions& google::cloud::storage::v1::ClientOptions::set_project_id ( std::string  v)
inline

Definition at line 133 of file client_options.h.

◆ set_version()

ClientOptions& google::cloud::storage::v1::ClientOptions::set_version ( std::string  version)
inline

Definition at line 115 of file client_options.h.

◆ SetDownloadBufferSize()

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

Definition at line 170 of file client_options.cc.

◆ SetUploadBufferSize()

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

Definition at line 180 of file client_options.cc.

◆ upload_buffer_size()

std::size_t google::cloud::storage::v1::ClientOptions::upload_buffer_size ( ) const
inline

Definition at line 147 of file client_options.h.

◆ user_agent_prefix()

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

Definition at line 150 of file client_options.h.

◆ version()

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

Definition at line 114 of file client_options.h.