google-apis-bigquerydatapolicy_v2 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,431 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module BigquerydatapolicyV2
23
+ # BigQuery Data Policy API
24
+ #
25
+ # Allows users to manage BigQuery data policies.
26
+ #
27
+ # @example
28
+ # require 'google/apis/bigquerydatapolicy_v2'
29
+ #
30
+ # Bigquerydatapolicy = Google::Apis::BigquerydatapolicyV2 # Alias the module
31
+ # service = Bigquerydatapolicy::BigQueryDataPolicyServiceService.new
32
+ #
33
+ # @see https://cloud.google.com/bigquery/docs/column-data-masking
34
+ class BigQueryDataPolicyServiceService < Google::Apis::Core::BaseService
35
+ DEFAULT_ENDPOINT_TEMPLATE = "https://bigquerydatapolicy.$UNIVERSE_DOMAIN$/"
36
+
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
49
+ client_name: 'google-apis-bigquerydatapolicy_v2',
50
+ client_version: Google::Apis::BigquerydatapolicyV2::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Adds new grantees to a data policy. The new grantees will be added to the
55
+ # existing grantees. If the request contains a duplicate grantee, the grantee
56
+ # will be ignored. If the request contains a grantee that already exists, the
57
+ # grantee will be ignored.
58
+ # @param [String] data_policy
59
+ # Required. Resource name of this data policy, in the format of `projects/`
60
+ # project_number`/locations/`location_id`/dataPolicies/`data_policy_id``.
61
+ # @param [Google::Apis::BigquerydatapolicyV2::AddGranteesRequest] add_grantees_request_object
62
+ # @param [String] fields
63
+ # Selector specifying which fields to include in a partial response.
64
+ # @param [String] quota_user
65
+ # Available to use for quota purposes for server-side applications. Can be any
66
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
67
+ # @param [Google::Apis::RequestOptions] options
68
+ # Request-specific options
69
+ #
70
+ # @yield [result, err] Result & error if block supplied
71
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object
72
+ # @yieldparam err [StandardError] error object if request failed
73
+ #
74
+ # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy]
75
+ #
76
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
77
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
78
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
79
+ def add_data_policy_grantees(data_policy, add_grantees_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
80
+ command = make_simple_command(:post, 'v2/{+dataPolicy}:addGrantees', options)
81
+ command.request_representation = Google::Apis::BigquerydatapolicyV2::AddGranteesRequest::Representation
82
+ command.request_object = add_grantees_request_object
83
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation
84
+ command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy
85
+ command.params['dataPolicy'] = data_policy unless data_policy.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Creates a new data policy under a project with the given `data_policy_id` (
92
+ # used as the display name), and data policy type.
93
+ # @param [String] parent
94
+ # Required. Resource name of the project that the data policy will belong to.
95
+ # The format is `projects/`project_number`/locations/`location_id``.
96
+ # @param [Google::Apis::BigquerydatapolicyV2::CreateDataPolicyRequest] create_data_policy_request_object
97
+ # @param [String] fields
98
+ # Selector specifying which fields to include in a partial response.
99
+ # @param [String] quota_user
100
+ # Available to use for quota purposes for server-side applications. Can be any
101
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
102
+ # @param [Google::Apis::RequestOptions] options
103
+ # Request-specific options
104
+ #
105
+ # @yield [result, err] Result & error if block supplied
106
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object
107
+ # @yieldparam err [StandardError] error object if request failed
108
+ #
109
+ # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy]
110
+ #
111
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
112
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
113
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
114
+ def create_data_policy(parent, create_data_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
115
+ command = make_simple_command(:post, 'v2/{+parent}/dataPolicies', options)
116
+ command.request_representation = Google::Apis::BigquerydatapolicyV2::CreateDataPolicyRequest::Representation
117
+ command.request_object = create_data_policy_request_object
118
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation
119
+ command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy
120
+ command.params['parent'] = parent unless parent.nil?
121
+ command.query['fields'] = fields unless fields.nil?
122
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
123
+ execute_or_queue_command(command, &block)
124
+ end
125
+
126
+ # Deletes the data policy specified by its resource name.
127
+ # @param [String] name
128
+ # Required. Resource name of the data policy to delete. Format is `projects/`
129
+ # project_number`/locations/`location_id`/dataPolicies/`id``.
130
+ # @param [String] fields
131
+ # Selector specifying which fields to include in a partial response.
132
+ # @param [String] quota_user
133
+ # Available to use for quota purposes for server-side applications. Can be any
134
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
135
+ # @param [Google::Apis::RequestOptions] options
136
+ # Request-specific options
137
+ #
138
+ # @yield [result, err] Result & error if block supplied
139
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::Empty] parsed result object
140
+ # @yieldparam err [StandardError] error object if request failed
141
+ #
142
+ # @return [Google::Apis::BigquerydatapolicyV2::Empty]
143
+ #
144
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
145
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
146
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
147
+ def delete_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil, &block)
148
+ command = make_simple_command(:delete, 'v2/{+name}', options)
149
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::Empty::Representation
150
+ command.response_class = Google::Apis::BigquerydatapolicyV2::Empty
151
+ command.params['name'] = name unless name.nil?
152
+ command.query['fields'] = fields unless fields.nil?
153
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
154
+ execute_or_queue_command(command, &block)
155
+ end
156
+
157
+ # Gets the data policy specified by its resource name.
158
+ # @param [String] name
159
+ # Required. Resource name of the requested data policy. Format is `projects/`
160
+ # project_number`/locations/`location_id`/dataPolicies/`id``.
161
+ # @param [String] fields
162
+ # Selector specifying which fields to include in a partial response.
163
+ # @param [String] quota_user
164
+ # Available to use for quota purposes for server-side applications. Can be any
165
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
166
+ # @param [Google::Apis::RequestOptions] options
167
+ # Request-specific options
168
+ #
169
+ # @yield [result, err] Result & error if block supplied
170
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object
171
+ # @yieldparam err [StandardError] error object if request failed
172
+ #
173
+ # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy]
174
+ #
175
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
176
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
177
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
178
+ def get_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil, &block)
179
+ command = make_simple_command(:get, 'v2/{+name}', options)
180
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation
181
+ command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy
182
+ command.params['name'] = name unless name.nil?
183
+ command.query['fields'] = fields unless fields.nil?
184
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
185
+ execute_or_queue_command(command, &block)
186
+ end
187
+
188
+ # Gets the IAM policy for the specified data policy.
189
+ # @param [String] resource
190
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
191
+ # names](https://cloud.google.com/apis/design/resource_names) for the
192
+ # appropriate value for this field.
193
+ # @param [Google::Apis::BigquerydatapolicyV2::GetIamPolicyRequest] get_iam_policy_request_object
194
+ # @param [String] fields
195
+ # Selector specifying which fields to include in a partial response.
196
+ # @param [String] quota_user
197
+ # Available to use for quota purposes for server-side applications. Can be any
198
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
199
+ # @param [Google::Apis::RequestOptions] options
200
+ # Request-specific options
201
+ #
202
+ # @yield [result, err] Result & error if block supplied
203
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::Policy] parsed result object
204
+ # @yieldparam err [StandardError] error object if request failed
205
+ #
206
+ # @return [Google::Apis::BigquerydatapolicyV2::Policy]
207
+ #
208
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
209
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
210
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
211
+ def get_data_policy_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
212
+ command = make_simple_command(:post, 'v2/{+resource}:getIamPolicy', options)
213
+ command.request_representation = Google::Apis::BigquerydatapolicyV2::GetIamPolicyRequest::Representation
214
+ command.request_object = get_iam_policy_request_object
215
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::Policy::Representation
216
+ command.response_class = Google::Apis::BigquerydatapolicyV2::Policy
217
+ command.params['resource'] = resource unless resource.nil?
218
+ command.query['fields'] = fields unless fields.nil?
219
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
220
+ execute_or_queue_command(command, &block)
221
+ end
222
+
223
+ # List all of the data policies in the specified parent project.
224
+ # @param [String] parent
225
+ # Required. Resource name of the project for which to list data policies. Format
226
+ # is `projects/`project_number`/locations/`location_id``.
227
+ # @param [String] filter
228
+ # Optional. Filters the data policies by policy tags that they are associated
229
+ # with. Currently filter only supports "policy_tag" based filtering and OR based
230
+ # predicates. Sample filter can be "policy_tag: projects/1/locations/us/
231
+ # taxonomies/2/policyTags/3". You may also use wildcard such as "policy_tag:
232
+ # projects/1/locations/us/taxonomies/2*". Please note that OR predicates cannot
233
+ # be used with wildcard filters.
234
+ # @param [Fixnum] page_size
235
+ # Optional. The maximum number of data policies to return. Must be a value
236
+ # between 1 and 1000. If not set, defaults to 50.
237
+ # @param [String] page_token
238
+ # Optional. The `nextPageToken` value returned from a previous list request, if
239
+ # any. If not set, defaults to an empty string.
240
+ # @param [String] fields
241
+ # Selector specifying which fields to include in a partial response.
242
+ # @param [String] quota_user
243
+ # Available to use for quota purposes for server-side applications. Can be any
244
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
245
+ # @param [Google::Apis::RequestOptions] options
246
+ # Request-specific options
247
+ #
248
+ # @yield [result, err] Result & error if block supplied
249
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse] parsed result object
250
+ # @yieldparam err [StandardError] error object if request failed
251
+ #
252
+ # @return [Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse]
253
+ #
254
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
255
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
256
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
257
+ def list_project_location_data_policies(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
258
+ command = make_simple_command(:get, 'v2/{+parent}/dataPolicies', options)
259
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse::Representation
260
+ command.response_class = Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse
261
+ command.params['parent'] = parent unless parent.nil?
262
+ command.query['filter'] = filter unless filter.nil?
263
+ command.query['pageSize'] = page_size unless page_size.nil?
264
+ command.query['pageToken'] = page_token unless page_token.nil?
265
+ command.query['fields'] = fields unless fields.nil?
266
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
267
+ execute_or_queue_command(command, &block)
268
+ end
269
+
270
+ # Updates the metadata for an existing data policy. The target data policy can
271
+ # be specified by the resource name.
272
+ # @param [String] name
273
+ # Identifier. Resource name of this data policy, in the format of `projects/`
274
+ # project_number`/locations/`location_id`/dataPolicies/`data_policy_id``.
275
+ # @param [Google::Apis::BigquerydatapolicyV2::DataPolicy] data_policy_object
276
+ # @param [Boolean] allow_missing
277
+ # Optional. If set to true, and the data policy is not found, a new data policy
278
+ # will be created. In this situation, update_mask is ignored.
279
+ # @param [String] update_mask
280
+ # Optional. The update mask applies to the resource. For the `FieldMask`
281
+ # definition, see https://developers.google.com/protocol-buffers/docs/reference/
282
+ # google.protobuf#fieldmask If not set, defaults to all of the fields that are
283
+ # allowed to update. Updates to the `name` and `dataPolicyId` fields are not
284
+ # allowed.
285
+ # @param [String] fields
286
+ # Selector specifying which fields to include in a partial response.
287
+ # @param [String] quota_user
288
+ # Available to use for quota purposes for server-side applications. Can be any
289
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
290
+ # @param [Google::Apis::RequestOptions] options
291
+ # Request-specific options
292
+ #
293
+ # @yield [result, err] Result & error if block supplied
294
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object
295
+ # @yieldparam err [StandardError] error object if request failed
296
+ #
297
+ # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy]
298
+ #
299
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
300
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
301
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
302
+ 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)
303
+ command = make_simple_command(:patch, 'v2/{+name}', options)
304
+ command.request_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation
305
+ command.request_object = data_policy_object
306
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation
307
+ command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy
308
+ command.params['name'] = name unless name.nil?
309
+ command.query['allowMissing'] = allow_missing unless allow_missing.nil?
310
+ command.query['updateMask'] = update_mask unless update_mask.nil?
311
+ command.query['fields'] = fields unless fields.nil?
312
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
313
+ execute_or_queue_command(command, &block)
314
+ end
315
+
316
+ # Removes grantees from a data policy. The grantees will be removed from the
317
+ # existing grantees. If the request contains a grantee that does not exist, the
318
+ # grantee will be ignored.
319
+ # @param [String] data_policy
320
+ # Required. Resource name of this data policy, in the format of `projects/`
321
+ # project_number`/locations/`location_id`/dataPolicies/`data_policy_id``.
322
+ # @param [Google::Apis::BigquerydatapolicyV2::RemoveGranteesRequest] remove_grantees_request_object
323
+ # @param [String] fields
324
+ # Selector specifying which fields to include in a partial response.
325
+ # @param [String] quota_user
326
+ # Available to use for quota purposes for server-side applications. Can be any
327
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
328
+ # @param [Google::Apis::RequestOptions] options
329
+ # Request-specific options
330
+ #
331
+ # @yield [result, err] Result & error if block supplied
332
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object
333
+ # @yieldparam err [StandardError] error object if request failed
334
+ #
335
+ # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy]
336
+ #
337
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
338
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
339
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
340
+ def remove_data_policy_grantees(data_policy, remove_grantees_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
341
+ command = make_simple_command(:post, 'v2/{+dataPolicy}:removeGrantees', options)
342
+ command.request_representation = Google::Apis::BigquerydatapolicyV2::RemoveGranteesRequest::Representation
343
+ command.request_object = remove_grantees_request_object
344
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation
345
+ command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy
346
+ command.params['dataPolicy'] = data_policy unless data_policy.nil?
347
+ command.query['fields'] = fields unless fields.nil?
348
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
349
+ execute_or_queue_command(command, &block)
350
+ end
351
+
352
+ # Sets the IAM policy for the specified data policy.
353
+ # @param [String] resource
354
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
355
+ # names](https://cloud.google.com/apis/design/resource_names) for the
356
+ # appropriate value for this field.
357
+ # @param [Google::Apis::BigquerydatapolicyV2::SetIamPolicyRequest] set_iam_policy_request_object
358
+ # @param [String] fields
359
+ # Selector specifying which fields to include in a partial response.
360
+ # @param [String] quota_user
361
+ # Available to use for quota purposes for server-side applications. Can be any
362
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
363
+ # @param [Google::Apis::RequestOptions] options
364
+ # Request-specific options
365
+ #
366
+ # @yield [result, err] Result & error if block supplied
367
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::Policy] parsed result object
368
+ # @yieldparam err [StandardError] error object if request failed
369
+ #
370
+ # @return [Google::Apis::BigquerydatapolicyV2::Policy]
371
+ #
372
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
373
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
374
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
375
+ def set_data_policy_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
376
+ command = make_simple_command(:post, 'v2/{+resource}:setIamPolicy', options)
377
+ command.request_representation = Google::Apis::BigquerydatapolicyV2::SetIamPolicyRequest::Representation
378
+ command.request_object = set_iam_policy_request_object
379
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::Policy::Representation
380
+ command.response_class = Google::Apis::BigquerydatapolicyV2::Policy
381
+ command.params['resource'] = resource unless resource.nil?
382
+ command.query['fields'] = fields unless fields.nil?
383
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
384
+ execute_or_queue_command(command, &block)
385
+ end
386
+
387
+ # Returns the caller's permission on the specified data policy resource.
388
+ # @param [String] resource
389
+ # REQUIRED: The resource for which the policy detail is being requested. See [
390
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
391
+ # appropriate value for this field.
392
+ # @param [Google::Apis::BigquerydatapolicyV2::TestIamPermissionsRequest] test_iam_permissions_request_object
393
+ # @param [String] fields
394
+ # Selector specifying which fields to include in a partial response.
395
+ # @param [String] quota_user
396
+ # Available to use for quota purposes for server-side applications. Can be any
397
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
398
+ # @param [Google::Apis::RequestOptions] options
399
+ # Request-specific options
400
+ #
401
+ # @yield [result, err] Result & error if block supplied
402
+ # @yieldparam result [Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse] parsed result object
403
+ # @yieldparam err [StandardError] error object if request failed
404
+ #
405
+ # @return [Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse]
406
+ #
407
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
408
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
409
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
410
+ def test_data_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
411
+ command = make_simple_command(:post, 'v2/{+resource}:testIamPermissions', options)
412
+ command.request_representation = Google::Apis::BigquerydatapolicyV2::TestIamPermissionsRequest::Representation
413
+ command.request_object = test_iam_permissions_request_object
414
+ command.response_representation = Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse::Representation
415
+ command.response_class = Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse
416
+ command.params['resource'] = resource unless resource.nil?
417
+ command.query['fields'] = fields unless fields.nil?
418
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
419
+ execute_or_queue_command(command, &block)
420
+ end
421
+
422
+ protected
423
+
424
+ def apply_command_defaults(command)
425
+ command.query['key'] = key unless key.nil?
426
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
427
+ end
428
+ end
429
+ end
430
+ end
431
+ end
@@ -0,0 +1,39 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/bigquerydatapolicy_v2/service.rb'
16
+ require 'google/apis/bigquerydatapolicy_v2/classes.rb'
17
+ require 'google/apis/bigquerydatapolicy_v2/representations.rb'
18
+ require 'google/apis/bigquerydatapolicy_v2/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # BigQuery Data Policy API
23
+ #
24
+ # Allows users to manage BigQuery data policies.
25
+ #
26
+ # @see https://cloud.google.com/bigquery/docs/column-data-masking
27
+ module BigquerydatapolicyV2
28
+ # Version of the BigQuery Data Policy API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V2'
31
+
32
+ # View and manage your data in Google BigQuery and see the email address for your Google Account
33
+ AUTH_BIGQUERY = 'https://www.googleapis.com/auth/bigquery'
34
+
35
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
36
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/bigquerydatapolicy_v2"
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-bigquerydatapolicy_v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: google-apis-core
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 0.15.0
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.a
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.15.0
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: 2.a
32
+ description: This is the simple REST client for BigQuery Data Policy API V2. Simple
33
+ REST clients are Ruby client libraries that provide access to Google services via
34
+ their HTTP REST API endpoints. These libraries are generated and updated automatically
35
+ based on the discovery documents published by the service, and they handle most
36
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
37
+ use this client to access the BigQuery Data Policy API, but note that some services
38
+ may provide a separate modern client that is easier to use.
39
+ email: googleapis-packages@google.com
40
+ executables: []
41
+ extensions: []
42
+ extra_rdoc_files: []
43
+ files:
44
+ - ".yardopts"
45
+ - CHANGELOG.md
46
+ - LICENSE.md
47
+ - OVERVIEW.md
48
+ - lib/google-apis-bigquerydatapolicy_v2.rb
49
+ - lib/google/apis/bigquerydatapolicy_v2.rb
50
+ - lib/google/apis/bigquerydatapolicy_v2/classes.rb
51
+ - lib/google/apis/bigquerydatapolicy_v2/gem_version.rb
52
+ - lib/google/apis/bigquerydatapolicy_v2/representations.rb
53
+ - lib/google/apis/bigquerydatapolicy_v2/service.rb
54
+ homepage: https://github.com/google/google-api-ruby-client
55
+ licenses:
56
+ - Apache-2.0
57
+ metadata:
58
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
59
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-bigquerydatapolicy_v2/CHANGELOG.md
60
+ documentation_uri: https://googleapis.dev/ruby/google-apis-bigquerydatapolicy_v2/v0.1.0
61
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-bigquerydatapolicy_v2
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '3.1'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubygems_version: 3.6.9
77
+ specification_version: 4
78
+ summary: Simple REST client for BigQuery Data Policy API V2
79
+ test_files: []