Service Client: Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DataPolicyServiceClient
Client stub representing the remote DataPolicyService gRPC service. Delegates call dispatching to Google::gRPC::Client.
target
The endpoint target address. Defaults to bigquery.googleapis.com:443.
credentials
The authentication credentials provider. Defaults to application default credentials via Google::Auth.
NAME
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy - Compiled Protocol Buffers messages for google/cloud/bigquery/datapolicies/v2/datapolicy.proto
SYNOPSIS
use Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy;
my $msg = Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::CreateDataPolicyRequest->new({
parent => $parent,
data_policy_id => $data_policy_id,
data_policy => $data_policy,
});
# Read or update a field
my $val = $msg->parent();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::CreateDataPolicyRequest->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/bigquery/datapolicies/v2/datapolicy.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::CreateDataPolicyRequest
Request message for the CreateDataPolicy method.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`.
$msg->data_policy_id()/$msg->data_policy_id($value)Type:
StringRequired. User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {data_policy_id} in part of the resource name.
$msg->data_policy()/$msg->data_policy($value)Type:
Message(Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DataPolicy)Required. The data policy to create. The `name` field does not need to be provided for the data policy creation.
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::UpdateDataPolicyRequest
Request message for the UpdateDataPolicy method.
Inherits from Protobuf::Message.
Accessors
$msg->data_policy()/$msg->data_policy($value)Type:
Message(Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DataPolicy)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.
$msg->update_mask()/$msg->update_mask($value)Type:
Message(Google::Protobuf::FieldMask::FieldMask)Optional. 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.
$msg->allow_missing()/$msg->allow_missing($value)Type:
BoolOptional. If set to true, and the data policy is not found, a new data policy will be created. In this situation, update_mask is ignored.
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::AddGranteesRequest
Request message for the AddGrantees method.
Inherits from Protobuf::Message.
Accessors
$msg->data_policy()/$msg->data_policy($value)Type:
StringRequired. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
$msg->grantees()/$msg->grantees($value)Type:
StringRequired. IAM principal that should be granted Fine Grained Access to the underlying data goverened by the data policy. The target data policy is determined by the `data_policy` field.
Uses the [IAM V2 principal syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2). Supported principal types:
* User * Group * Service account
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::RemoveGranteesRequest
Request message for the RemoveGrantees method.
Inherits from Protobuf::Message.
Accessors
$msg->data_policy()/$msg->data_policy($value)Type:
StringRequired. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
$msg->grantees()/$msg->grantees($value)Type:
StringRequired. IAM principal that should be revoked from Fine Grained Access to the underlying data goverened by the data policy. The target data policy is determined by the `data_policy` field.
Uses the [IAM V2 principal syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2). Supported principal types:
* User * Group * Service account
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DeleteDataPolicyRequest
Request message for the DeleteDataPolicy method.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. Resource name of the data policy to delete. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{id}`.
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::GetDataPolicyRequest
Request message for the GetDataPolicy method.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. Resource name of the requested data policy. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{id}`.
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::ListDataPoliciesRequest
Request message for the ListDataPolicies method.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. Resource name of the project for which to list data policies. Format is `projects/{project_number}/locations/{location_id}`.
$msg->page_size()/$msg->page_size($value)Type:
Int32Optional. The maximum number of data policies to return. Must be a value between 1 and 1000. If not set, defaults to 50.
$msg->page_token()/$msg->page_token($value)Type:
StringOptional. The `nextPageToken` value returned from a previous list request, if any. If not set, defaults to an empty string.
$msg->filter()/$msg->filter($value)Type:
StringOptional. Filters the data policies by policy tags that they are associated with. Currently filter only supports "policy_tag" based filtering and OR based predicates. Sample filter can be "policy_tag: projects/1/locations/us/taxonomies/2/policyTags/3". You may also use wildcard such as "policy_tag: projects/1/locations/us/taxonomies/2*". Please note that OR predicates cannot be used with wildcard filters.
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::ListDataPoliciesResponse
Response message for the ListDataPolicies method.
Inherits from Protobuf::Message.
Accessors
$msg->data_policies()/$msg->data_policies($value)Type:
Message(Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DataPolicy)Data policies that belong to the requested project.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringToken used to retrieve the next page of results, or empty if there are no more results.
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DataPolicy
Represents the label-policy binding.
Inherits from Protobuf::Message.
Accessors
$msg->data_masking_policy()/$msg->data_masking_policy($value)Type:
Message(Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DataMaskingPolicy)Optional. The data masking policy that specifies the data masking rule to use. It must be set if the data policy type is DATA_MASKING_POLICY.
$msg->name()/$msg->name($value)Type:
StringIdentifier. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
$msg->data_policy_id()/$msg->data_policy_id($value)Type:
StringOutput only. User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {data_policy_id} in part of the resource name.
$msg->etag()/$msg->etag($value)Type:
StringThe etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
$msg->data_policy_type()/$msg->data_policy_type($value)Type:
Enum(Google::Cloud::Bigquery::Datapolicies::V2::DataPolicy::DataPolicyType)Required. Type of data policy.
$msg->policy_tag()/$msg->policy_tag($value)Type:
StringOutput only. Policy tag resource name, in the format of `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. policy_tag is supported only for V1 data policies.
$msg->grantees()/$msg->grantees($value)Type:
StringOptional. The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy.
Uses the [IAM V2 principal syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2) Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
$msg->version()/$msg->version($value)Type:
Enum(Google::Cloud::Bigquery::Datapolicies::V2::DataPolicy::Version)Output only. The version of the Data Policy resource.
Enum: DataPolicy::DataPolicyType
DATA_POLICY_TYPE_UNSPECIFIED=>0DATA_MASKING_POLICY=>1RAW_DATA_ACCESS_POLICY=>2COLUMN_LEVEL_SECURITY_POLICY=>3
Enum: DataPolicy::Version
VERSION_UNSPECIFIED=>0V1=>1V2=>2
Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::DataMaskingPolicy
The policy used to specify data masking rule.
Inherits from Protobuf::Message.
Accessors
$msg->predefined_expression()/$msg->predefined_expression($value)Type:
Enum(Google::Cloud::Bigquery::Datapolicies::V2::DataMaskingPolicy::PredefinedExpression)Optional. A predefined masking expression.
$msg->routine()/$msg->routine($value)Type:
StringOptional. The name of the BigQuery routine that contains the custom masking routine, in the format of `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`.
Enum: DataMaskingPolicy::PredefinedExpression
PREDEFINED_EXPRESSION_UNSPECIFIED=>0SHA256=>1ALWAYS_NULL=>2DEFAULT_MASKING_VALUE=>3LAST_FOUR_CHARACTERS=>4FIRST_FOUR_CHARACTERS=>5EMAIL_MASK=>6DATE_YEAR_MASK=>7RANDOM_HASH=>8
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Bigquery::Datapolicies::V2::Datapolicy::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.