Class: Google::Apis::BigquerydatapolicyV1::BigQueryDataPolicyServiceService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/bigquerydatapolicy_v1/service.rb

Overview

BigQuery Data Policy API

Allows users to manage BigQuery data policies.

Examples:

require 'google/apis/bigquerydatapolicy_v1'

Bigquerydatapolicy = Google::Apis::BigquerydatapolicyV1 # Alias the module
service = Bigquerydatapolicy::BigQueryDataPolicyServiceService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://bigquerydatapolicy.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBigQueryDataPolicyServiceService

Returns a new instance of BigQueryDataPolicyServiceService.



47
48
49
50
51
52
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-bigquerydatapolicy_v1',
        client_version: Google::Apis::BigquerydatapolicyV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



40
41
42
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 40

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



45
46
47
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#create_project_location_data_policy(parent, data_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::DataPolicy

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

Parameters:

  • parent (String)

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

  • data_policy_object (Google::Apis::BigquerydatapolicyV1::DataPolicy) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 77

def create_project_location_data_policy(parent, data_policy_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/dataPolicies', options)
  command.request_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
  command.request_object = data_policy_object
  command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_data_policy(name, force: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::Empty

Deletes the data policy specified by its resource name.

Parameters:

  • name (String)

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

  • force (Boolean) (defaults to: nil)

    Optional. If true, the data policy will be deleted even when it is referenced by one or more table columns.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



113
114
115
116
117
118
119
120
121
122
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 113

def delete_project_location_data_policy(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::BigquerydatapolicyV1::Empty::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['force'] = force unless force.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_data_policy_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::Policy

Gets the IAM policy for the specified data policy.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

  • get_iam_policy_request_object (Google::Apis::BigquerydatapolicyV1::GetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



178
179
180
181
182
183
184
185
186
187
188
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 178

def get_data_policy_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options)
  command.request_representation = Google::Apis::BigquerydatapolicyV1::GetIamPolicyRequest::Representation
  command.request_object = get_iam_policy_request_object
  command.response_representation = Google::Apis::BigquerydatapolicyV1::Policy::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::DataPolicy

Gets the data policy specified by its resource name.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



145
146
147
148
149
150
151
152
153
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 145

def get_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_data_policies(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::ListDataPoliciesResponse

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

Parameters:

  • parent (String)

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

  • filter (String) (defaults to: nil)

    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.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of data policies to return. Must be a value between 1 and

    1. If not set, defaults to 50.
  • page_token (String) (defaults to: nil)

    The nextPageToken value returned from a previous list request, if any. If not set, defaults to an empty string.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 224

def list_project_location_data_policies(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/dataPolicies', options)
  command.response_representation = Google::Apis::BigquerydatapolicyV1::ListDataPoliciesResponse::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::ListDataPoliciesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_location_data_policy(name, data_policy_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::DataPolicy

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

Parameters:

  • name (String)

    Output only. Resource name of this data policy, in the format of projects/ project_number/locations/location_id/dataPolicies/data_policy_id``.

  • data_policy_object (Google::Apis::BigquerydatapolicyV1::DataPolicy) (defaults to: nil)
  • allow_missing (Boolean) (defaults to: nil)

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

  • update_mask (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 268

def patch_project_location_data_policy(name, data_policy_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
  command.request_object = data_policy_object
  command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
  command.params['name'] = name unless name.nil?
  command.query['allowMissing'] = allow_missing unless allow_missing.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#rename_data_policy(name, rename_data_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::DataPolicy

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

Parameters:

  • name (String)

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

  • rename_data_policy_request_object (Google::Apis::BigquerydatapolicyV1::RenameDataPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



304
305
306
307
308
309
310
311
312
313
314
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 304

def rename_data_policy(name, rename_data_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:rename', options)
  command.request_representation = Google::Apis::BigquerydatapolicyV1::RenameDataPolicyRequest::Representation
  command.request_object = rename_data_policy_request_object
  command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_data_policy_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::Policy

Sets the IAM policy for the specified data policy.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

  • set_iam_policy_request_object (Google::Apis::BigquerydatapolicyV1::SetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



339
340
341
342
343
344
345
346
347
348
349
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 339

def set_data_policy_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::BigquerydatapolicyV1::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::BigquerydatapolicyV1::Policy::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#test_data_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BigquerydatapolicyV1::TestIamPermissionsResponse

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

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

  • test_iam_permissions_request_object (Google::Apis::BigquerydatapolicyV1::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



374
375
376
377
378
379
380
381
382
383
384
# File 'lib/google/apis/bigquerydatapolicy_v1/service.rb', line 374

def test_data_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::BigquerydatapolicyV1::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::BigquerydatapolicyV1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::BigquerydatapolicyV1::TestIamPermissionsResponse
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end