Google Cloud Storage C++ Client  1.32.1
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 > 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)
 
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 100 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 102 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 247 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 182 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 192 of file client_options.h.

◆ channel_options() [1/2]

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

Definition at line 240 of file client_options.h.

◆ channel_options() [2/2]

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

Definition at line 241 of file client_options.h.

◆ connection_pool_size()

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

Definition at line 163 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 236 of file client_options.cc.

◆ CreateDefaultClientOptions() [2/2]

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

Definition at line 240 of file client_options.cc.

◆ credentials()

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

Definition at line 119 of file client_options.h.

◆ download_buffer_size()

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

Definition at line 171 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 253 of file client_options.h.

◆ enable_http_tracing()

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

Definition at line 259 of file client_options.cc.

◆ enable_raw_client_tracing()

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

Definition at line 272 of file client_options.cc.

◆ enable_sigpipe_handler()

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

Definition at line 216 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 208 of file client_options.h.

◆ endpoint()

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

Definition at line 127 of file client_options.h.

◆ iam_endpoint()

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

Definition at line 135 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 196 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 224 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 232 of file client_options.h.

◆ project_id()

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

Definition at line 157 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 166 of file client_options.h.

◆ set_credentials()

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

Definition at line 122 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 256 of file client_options.h.

◆ set_enable_http_tracing()

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

Definition at line 263 of file client_options.cc.

◆ set_enable_raw_client_tracing()

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

Definition at line 276 of file client_options.cc.

◆ set_enable_sigpipe_handler()

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

Definition at line 219 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 211 of file client_options.h.

◆ set_endpoint()

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

Definition at line 130 of file client_options.h.

◆ set_iam_endpoint()

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

Definition at line 138 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 199 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 227 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 235 of file client_options.h.

◆ set_project_id()

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

Definition at line 158 of file client_options.h.

◆ set_version()

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

Definition at line 146 of file client_options.h.

◆ SetDownloadBufferSize()

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

Definition at line 285 of file client_options.cc.

◆ SetUploadBufferSize()

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

Definition at line 291 of file client_options.cc.

◆ upload_buffer_size()

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

Definition at line 176 of file client_options.h.

◆ user_agent_prefix()

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

Definition at line 181 of file client_options.h.

◆ version()

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

Definition at line 143 of file client_options.h.