Class DataPolicyServiceClient (2.15.1)

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.

Constructors

DataPolicyServiceClient(DataPolicyServiceClient const &)

Copy and move support

Parameter
Name Description
DataPolicyServiceClient const &

DataPolicyServiceClient(DataPolicyServiceClient &&)

Copy and move support

Parameter
Name Description
DataPolicyServiceClient &&

DataPolicyServiceClient(std::shared_ptr< DataPolicyServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< DataPolicyServiceConnection >
opts Options

Operators

operator=(DataPolicyServiceClient const &)

Copy and move support

Parameter
Name Description
DataPolicyServiceClient const &
Returns
Type Description
DataPolicyServiceClient &

operator=(DataPolicyServiceClient &&)

Copy and move support

Parameter
Name Description
DataPolicyServiceClient &&
Returns
Type Description
DataPolicyServiceClient &

Functions

CreateDataPolicy(std::string const &, google::cloud::bigquery::datapolicies::v1::DataPolicy const &, Options)

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

Parameters
Name Description
parent std::string const &

Required. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.

data_policy google::cloud::bigquery::datapolicies::v1::DataPolicy const &

Required. The data policy to create. The name field does not need to be provided for the data policy creation.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest const &, Options)

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

Parameters
Name Description
request google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(google::cloud::bigquery::datapolicies::v1::DataPolicy const &, google::protobuf::FieldMask const &, Options)

Updates the metadata for an existing data policy.

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

Parameters
Name Description
data_policy google::cloud::bigquery::datapolicies::v1::DataPolicy const &

Required. 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_mask google::protobuf::FieldMask const &

The 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest const &, Options)

Updates the metadata for an existing data policy.

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

Parameters
Name Description
request google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(std::string const &, std::string const &, Options)

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

Parameters
Name Description
name std::string const &

Required. Resource name of the data policy to rename. The format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}

new_data_policy_id std::string const &

Required. The new data policy id.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest const &, Options)

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

Parameters
Name Description
request google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(std::string const &, Options)

Deletes the data policy specified by its resource name.

Parameters
Name Description
name std::string const &

Required. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteDataPolicy(google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest const &, Options)

Deletes the data policy specified by its resource name.

Parameters
Name Description
request google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

GetDataPolicy(std::string const &, Options)

Gets the data policy specified by its resource name.

Parameters
Name Description
name std::string const &

Required. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest const &, Options)

Gets the data policy specified by its resource name.

Parameters
Name Description
request google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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.

ListDataPolicies(std::string const &, Options)

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

Parameters
Name Description
parent std::string const &

Required. Resource name of the project for which to list data policies. Format is projects/{project_number}/locations/{location_id}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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(google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest, Options)

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

Parameters
Name Description
request google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy >

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.

GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)

Gets the IAM policy for the specified data policy.

Parameters
Name Description
request google::iam::v1::GetIamPolicyRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy >

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(google::iam::v1::SetIamPolicyRequest const &, Options)

Sets the IAM policy for the specified data policy.

Parameters
Name Description
request google::iam::v1::SetIamPolicyRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy >

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(google::iam::v1::TestIamPermissionsRequest const &, Options)

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

Parameters
Name Description
request google::iam::v1::TestIamPermissionsRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::TestIamPermissionsResponse >

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.