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_datapolicies_v1::DataPolicyServiceClient Class Reference

Data Policy Service provides APIs for managing the label-policy bindings. More...

#include <google/cloud/bigquery/datapolicies/v1/data_policy_client.h>

Public Member Functions

 DataPolicyServiceClient (std::shared_ptr< DataPolicyServiceConnection > connection, Options opts={})
 
 ~DataPolicyServiceClient ()
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > CreateDataPolicy (std::string const &parent, google::cloud::bigquery::datapolicies::v1::DataPolicy const &data_policy, Options opts={})
 Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type. More...
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > CreateDataPolicy (google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest const &request, Options opts={})
 Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type. More...
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > UpdateDataPolicy (google::cloud::bigquery::datapolicies::v1::DataPolicy const &data_policy, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates the metadata for an existing data policy. More...
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > UpdateDataPolicy (google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest const &request, Options opts={})
 Updates the metadata for an existing data policy. More...
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > RenameDataPolicy (std::string const &name, std::string const &new_data_policy_id, Options opts={})
 Renames the id (display name) of the specified data policy. More...
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > RenameDataPolicy (google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest const &request, Options opts={})
 Renames the id (display name) of the specified data policy. More...
 
Status DeleteDataPolicy (std::string const &name, Options opts={})
 Deletes the data policy specified by its resource name. More...
 
Status DeleteDataPolicy (google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest const &request, Options opts={})
 Deletes the data policy specified by its resource name. More...
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > GetDataPolicy (std::string const &name, Options opts={})
 Gets the data policy specified by its resource name. More...
 
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > GetDataPolicy (google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest const &request, Options opts={})
 Gets the data policy specified by its resource name. More...
 
StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy > ListDataPolicies (std::string const &parent, Options opts={})
 List all of the data policies in the specified parent project. More...
 
StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy > ListDataPolicies (google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest request, Options opts={})
 List all of the data policies in the specified parent project. More...
 
StatusOr< google::iam::v1::Policy > GetIamPolicy (google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
 Gets the IAM policy for the specified data policy. More...
 
StatusOr< google::iam::v1::Policy > SetIamPolicy (google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
 Sets the IAM policy for the specified data policy. More...
 
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions (google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
 Returns the caller's permission on the specified data policy resource. More...
 
Copy and move support
 DataPolicyServiceClient (DataPolicyServiceClient const &)=default
 
DataPolicyServiceClientoperator= (DataPolicyServiceClient const &)=default
 
 DataPolicyServiceClient (DataPolicyServiceClient &&)=default
 
DataPolicyServiceClientoperator= (DataPolicyServiceClient &&)=default
 

Friends

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

Detailed Description

Data Policy Service provides APIs for managing the label-policy bindings.

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

◆ DataPolicyServiceClient() [1/3]

google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::DataPolicyServiceClient ( std::shared_ptr< DataPolicyServiceConnection connection,
Options  opts = {} 
)
explicit

◆ ~DataPolicyServiceClient()

google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::~DataPolicyServiceClient ( )

◆ DataPolicyServiceClient() [2/3]

google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::DataPolicyServiceClient ( DataPolicyServiceClient const &  )
default

◆ DataPolicyServiceClient() [3/3]

google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::DataPolicyServiceClient ( DataPolicyServiceClient &&  )
default

Member Function Documentation

◆ CreateDataPolicy() [1/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::CreateDataPolicy ( google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest const &  request,
Options  opts = {} 
)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

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.datapolicies.v1.CreateDataPolicyRequest. 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.datapolicies.v1.DataPolicy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ CreateDataPolicy() [2/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::CreateDataPolicy ( std::string const &  parent,
google::cloud::bigquery::datapolicies::v1::DataPolicy const &  data_policy,
Options  opts = {} 
)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
parentRequired. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.
data_policyRequired. The data policy to create. The name field does not need to be provided for the data policy creation.
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.datapolicies.v1.DataPolicy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ DeleteDataPolicy() [1/2]

Status google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::DeleteDataPolicy ( google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest const &  request,
Options  opts = {} 
)

Deletes the data policy specified by its resource name.

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.datapolicies.v1.DeleteDataPolicyRequest. 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.

◆ DeleteDataPolicy() [2/2]

Status google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::DeleteDataPolicy ( std::string const &  name,
Options  opts = {} 
)

Deletes the data policy specified by its resource name.

Parameters
nameRequired. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_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.

◆ GetDataPolicy() [1/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::GetDataPolicy ( google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest const &  request,
Options  opts = {} 
)

Gets the data policy specified by its resource name.

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.datapolicies.v1.GetDataPolicyRequest. 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.datapolicies.v1.DataPolicy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetDataPolicy() [2/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::GetDataPolicy ( std::string const &  name,
Options  opts = {} 
)

Gets the data policy specified by its resource name.

Parameters
nameRequired. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_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.datapolicies.v1.DataPolicy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetIamPolicy()

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

Gets the IAM policy for the specified data policy.

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.

◆ ListDataPolicies() [1/2]

StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::ListDataPolicies ( google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest  request,
Options  opts = {} 
)

List all of the data policies in the specified parent 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.datapolicies.v1.ListDataPoliciesRequest. 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.datapolicies.v1.DataPolicy, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListDataPolicies() [2/2]

StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::ListDataPolicies ( std::string const &  parent,
Options  opts = {} 
)

List all of the data policies in the specified parent project.

Parameters
parentRequired. Resource name of the project for which to list data policies. Format is projects/{project_number}/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.datapolicies.v1.DataPolicy, 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]

DataPolicyServiceClient & google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::operator= ( DataPolicyServiceClient &&  )
default

◆ operator=() [2/2]

DataPolicyServiceClient & google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::operator= ( DataPolicyServiceClient const &  )
default

◆ RenameDataPolicy() [1/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::RenameDataPolicy ( google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest const &  request,
Options  opts = {} 
)

Renames the id (display name) of the specified data policy.

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.datapolicies.v1.RenameDataPolicyRequest. 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.datapolicies.v1.DataPolicy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ RenameDataPolicy() [2/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::RenameDataPolicy ( std::string const &  name,
std::string const &  new_data_policy_id,
Options  opts = {} 
)

Renames the id (display name) of the specified data policy.

Parameters
nameRequired. Resource name of the data policy to rename. The format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}
new_data_policy_idRequired. The new data policy 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.datapolicies.v1.DataPolicy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ SetIamPolicy()

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

Sets the IAM policy for the specified data policy.

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.

◆ TestIamPermissions()

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

Returns the caller's permission on the specified data policy resource.

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.

◆ UpdateDataPolicy() [1/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::UpdateDataPolicy ( google::cloud::bigquery::datapolicies::v1::DataPolicy const &  data_policy,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

Updates the metadata for an existing data policy.

The target data policy can be specified by the resource name.

Parameters
data_policyRequired. Update the data policy's metadata.
The target data policy is determined by the name field. Other fields are updated to the specified values based on the field masks.
update_maskThe update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update.
Updates to the name and dataPolicyId fields are not allowed.
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.datapolicies.v1.DataPolicy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ UpdateDataPolicy() [2/2]

StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient::UpdateDataPolicy ( google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest const &  request,
Options  opts = {} 
)

Updates the metadata for an existing data policy.

The target data policy can be specified by the resource name.

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.datapolicies.v1.UpdateDataPolicyRequest. 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.datapolicies.v1.DataPolicy) 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!= ( DataPolicyServiceClient const &  a,
DataPolicyServiceClient const &  b 
)
friend

◆ operator==

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