Google Cloud BigQuery C++ Client 2.13.0
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::bigquery_connection_v1::ConnectionServiceClient Class Reference

Manages external data source connections and credentials. More...

#include <google/cloud/bigquery/connection/v1/connection_client.h>

Public Member Functions

 ConnectionServiceClient (std::shared_ptr< ConnectionServiceConnection > connection, Options opts={})
 
 ~ConnectionServiceClient ()
 
StatusOr< google::cloud::bigquery::connection::v1::Connection > CreateConnection (std::string const &parent, google::cloud::bigquery::connection::v1::Connection const &connection, std::string const &connection_id, Options opts={})
 Creates a new connection. More...
 
StatusOr< google::cloud::bigquery::connection::v1::Connection > CreateConnection (google::cloud::bigquery::connection::v1::CreateConnectionRequest const &request, Options opts={})
 Creates a new connection. More...
 
StatusOr< google::cloud::bigquery::connection::v1::Connection > GetConnection (std::string const &name, Options opts={})
 Returns specified connection. More...
 
StatusOr< google::cloud::bigquery::connection::v1::Connection > GetConnection (google::cloud::bigquery::connection::v1::GetConnectionRequest const &request, Options opts={})
 Returns specified connection. More...
 
StreamRange< google::cloud::bigquery::connection::v1::Connection > ListConnections (std::string const &parent, Options opts={})
 Returns a list of connections in the given project. More...
 
StreamRange< google::cloud::bigquery::connection::v1::Connection > ListConnections (google::cloud::bigquery::connection::v1::ListConnectionsRequest request, Options opts={})
 Returns a list of connections in the given project. More...
 
StatusOr< google::cloud::bigquery::connection::v1::Connection > UpdateConnection (std::string const &name, google::cloud::bigquery::connection::v1::Connection const &connection, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates the specified connection. More...
 
StatusOr< google::cloud::bigquery::connection::v1::Connection > UpdateConnection (google::cloud::bigquery::connection::v1::UpdateConnectionRequest const &request, Options opts={})
 Updates the specified connection. More...
 
Status DeleteConnection (std::string const &name, Options opts={})
 Deletes connection and associated credential. More...
 
Status DeleteConnection (google::cloud::bigquery::connection::v1::DeleteConnectionRequest const &request, Options opts={})
 Deletes connection and associated credential. More...
 
StatusOr< google::iam::v1::Policy > GetIamPolicy (std::string const &resource, google::iam::v1::GetPolicyOptions const &options, Options opts={})
 Gets the access control policy for a resource. More...
 
StatusOr< google::iam::v1::Policy > GetIamPolicy (google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
 Gets the access control policy for a resource. More...
 
StatusOr< google::iam::v1::Policy > SetIamPolicy (std::string const &resource, google::iam::v1::Policy const &policy, Options opts={})
 Sets the access control policy on the specified resource. More...
 
StatusOr< google::iam::v1::Policy > SetIamPolicy (google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
 Sets the access control policy on the specified resource. More...
 
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions (std::string const &resource, std::vector< std::string > const &permissions, Options opts={})
 Returns permissions that a caller has on the specified resource. More...
 
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions (google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
 Returns permissions that a caller has on the specified resource. More...
 
Copy and move support
 ConnectionServiceClient (ConnectionServiceClient const &)=default
 
ConnectionServiceClientoperator= (ConnectionServiceClient const &)=default
 
 ConnectionServiceClient (ConnectionServiceClient &&)=default
 
ConnectionServiceClientoperator= (ConnectionServiceClient &&)=default
 

Friends

Equality
bool operator== (ConnectionServiceClient const &a, ConnectionServiceClient const &b)
 
bool operator!= (ConnectionServiceClient const &a, ConnectionServiceClient const &b)
 

Detailed Description

Manages external data source connections and credentials.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructor & Destructor Documentation

◆ ConnectionServiceClient() [1/3]

google::cloud::bigquery_connection_v1::ConnectionServiceClient::ConnectionServiceClient ( std::shared_ptr< ConnectionServiceConnection connection,
Options  opts = {} 
)
explicit

◆ ~ConnectionServiceClient()

google::cloud::bigquery_connection_v1::ConnectionServiceClient::~ConnectionServiceClient ( )

◆ ConnectionServiceClient() [2/3]

google::cloud::bigquery_connection_v1::ConnectionServiceClient::ConnectionServiceClient ( ConnectionServiceClient const &  )
default

◆ ConnectionServiceClient() [3/3]

google::cloud::bigquery_connection_v1::ConnectionServiceClient::ConnectionServiceClient ( ConnectionServiceClient &&  )
default

Member Function Documentation

◆ CreateConnection() [1/2]

StatusOr< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::CreateConnection ( google::cloud::bigquery::connection::v1::CreateConnectionRequest const &  request,
Options  opts = {} 
)

Creates a new connection.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.connection.v1.CreateConnectionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.bigquery.connection.v1.Connection) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ CreateConnection() [2/2]

StatusOr< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::CreateConnection ( std::string const &  parent,
google::cloud::bigquery::connection::v1::Connection const &  connection,
std::string const &  connection_id,
Options  opts = {} 
)

Creates a new connection.

Parameters
parentRequired. Parent resource name. Must be in the format projects/{project_id}/locations/{location_id}
connectionRequired. Connection to create.
connection_idOptional. Connection id that should be assigned to the created connection.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.bigquery.connection.v1.Connection) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ DeleteConnection() [1/2]

Status google::cloud::bigquery_connection_v1::ConnectionServiceClient::DeleteConnection ( google::cloud::bigquery::connection::v1::DeleteConnectionRequest const &  request,
Options  opts = {} 
)

Deletes connection and associated credential.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.connection.v1.DeleteConnectionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ DeleteConnection() [2/2]

Status google::cloud::bigquery_connection_v1::ConnectionServiceClient::DeleteConnection ( std::string const &  name,
Options  opts = {} 
)

Deletes connection and associated credential.

Parameters
nameRequired. Name of the deleted connection, for example: projects/{project_id}/locations/{location_id}/connections/{connection_id}
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ GetConnection() [1/2]

StatusOr< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::GetConnection ( google::cloud::bigquery::connection::v1::GetConnectionRequest const &  request,
Options  opts = {} 
)

Returns specified connection.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.connection.v1.GetConnectionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.bigquery.connection.v1.Connection) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetConnection() [2/2]

StatusOr< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::GetConnection ( std::string const &  name,
Options  opts = {} 
)

Returns specified connection.

Parameters
nameRequired. Name of the requested connection, for example: projects/{project_id}/locations/{location_id}/connections/{connection_id}
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.bigquery.connection.v1.Connection) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetIamPolicy() [1/2]

StatusOr< google::iam::v1::Policy > google::cloud::bigquery_connection_v1::ConnectionServiceClient::GetIamPolicy ( google::iam::v1::GetIamPolicyRequest const &  request,
Options  opts = {} 
)

Gets the access control policy for a resource.

Returns an empty policy if the resource exists and does not have a policy set.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.GetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetIamPolicy() [2/2]

StatusOr< google::iam::v1::Policy > google::cloud::bigquery_connection_v1::ConnectionServiceClient::GetIamPolicy ( std::string const &  resource,
google::iam::v1::GetPolicyOptions const &  options,
Options  opts = {} 
)

Gets the access control policy for a resource.

Returns an empty policy if the resource exists and does not have a policy set.

Parameters
resourceREQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
optionsOPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ListConnections() [1/2]

StreamRange< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::ListConnections ( google::cloud::bigquery::connection::v1::ListConnectionsRequest  request,
Options  opts = {} 
)

Returns a list of connections in the given project.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.connection.v1.ListConnectionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.bigquery.connection.v1.Connection, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListConnections() [2/2]

StreamRange< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::ListConnections ( std::string const &  parent,
Options  opts = {} 
)

Returns a list of connections in the given project.

Parameters
parentRequired. Parent resource name. Must be in the form: projects/{project_id}/locations/{location_id}
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.bigquery.connection.v1.Connection, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ operator=() [1/2]

ConnectionServiceClient & google::cloud::bigquery_connection_v1::ConnectionServiceClient::operator= ( ConnectionServiceClient &&  )
default

◆ operator=() [2/2]

ConnectionServiceClient & google::cloud::bigquery_connection_v1::ConnectionServiceClient::operator= ( ConnectionServiceClient const &  )
default

◆ SetIamPolicy() [1/2]

StatusOr< google::iam::v1::Policy > google::cloud::bigquery_connection_v1::ConnectionServiceClient::SetIamPolicy ( google::iam::v1::SetIamPolicyRequest const &  request,
Options  opts = {} 
)

Sets the access control policy on the specified resource.

Replaces any existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.SetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ SetIamPolicy() [2/2]

StatusOr< google::iam::v1::Policy > google::cloud::bigquery_connection_v1::ConnectionServiceClient::SetIamPolicy ( std::string const &  resource,
google::iam::v1::Policy const &  policy,
Options  opts = {} 
)

Sets the access control policy on the specified resource.

Replaces any existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters
resourceREQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
policyREQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ TestIamPermissions() [1/2]

StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::bigquery_connection_v1::ConnectionServiceClient::TestIamPermissions ( google::iam::v1::TestIamPermissionsRequest const &  request,
Options  opts = {} 
)

Returns permissions that a caller has on the specified resource.

If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.TestIamPermissionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ TestIamPermissions() [2/2]

StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::bigquery_connection_v1::ConnectionServiceClient::TestIamPermissions ( std::string const &  resource,
std::vector< std::string > const &  permissions,
Options  opts = {} 
)

Returns permissions that a caller has on the specified resource.

If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
resourceREQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
permissionsThe set of permissions to check for the resource. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see IAM Overview.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ UpdateConnection() [1/2]

StatusOr< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::UpdateConnection ( google::cloud::bigquery::connection::v1::UpdateConnectionRequest const &  request,
Options  opts = {} 
)

Updates the specified connection.

For security reasons, also resets credential if connection properties are in the update field mask.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.connection.v1.UpdateConnectionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.bigquery.connection.v1.Connection) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ UpdateConnection() [2/2]

StatusOr< google::cloud::bigquery::connection::v1::Connection > google::cloud::bigquery_connection_v1::ConnectionServiceClient::UpdateConnection ( std::string const &  name,
google::cloud::bigquery::connection::v1::Connection const &  connection,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

Updates the specified connection.

For security reasons, also resets credential if connection properties are in the update field mask.

Parameters
nameRequired. Name of the connection to update, for example: projects/{project_id}/locations/{location_id}/connections/{connection_id}
connectionRequired. Connection containing the updated fields.
update_maskRequired. Update mask for the connection fields to be updated.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.bigquery.connection.v1.Connection) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( ConnectionServiceClient const &  a,
ConnectionServiceClient const &  b 
)
friend

◆ operator==

bool operator== ( ConnectionServiceClient const &  a,
ConnectionServiceClient const &  b 
)
friend