google-cloud-data_catalog-v1 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1270 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/datacatalog/v1/policytagmanager_pb"
21
+ require "google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub"
22
+ require "google/iam/v1/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module DataCatalog
27
+ module V1
28
+ module PolicyTagManager
29
+ module Rest
30
+ ##
31
+ # REST client for the PolicyTagManager service.
32
+ #
33
+ # Policy Tag Manager API service allows you to manage your policy tags and
34
+ # taxonomies.
35
+ #
36
+ # Policy tags are used to tag BigQuery columns and apply additional access
37
+ # control policies. A taxonomy is a hierarchical grouping of policy tags that
38
+ # classify data along a common axis.
39
+ #
40
+ class Client
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :policy_tag_manager_stub
45
+
46
+ ##
47
+ # Configure the PolicyTagManager Client class.
48
+ #
49
+ # See {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all PolicyTagManager clients
55
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "DataCatalog", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.timeout = 60.0
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the PolicyTagManager Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # Create a new PolicyTagManager REST client object.
105
+ #
106
+ # @example
107
+ #
108
+ # # Create a client using the default configuration
109
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new
110
+ #
111
+ # # Create a client using a custom configuration
112
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config|
113
+ # config.timeout = 10.0
114
+ # end
115
+ #
116
+ # @yield [config] Configure the PolicyTagManager client.
117
+ # @yieldparam config [Client::Configuration]
118
+ #
119
+ def initialize
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ # Use self-signed JWT if the endpoint is unchanged from default,
129
+ # but only if the default endpoint does not have a region prefix.
130
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
131
+ !@config.endpoint.split(".").first.include?("-")
132
+ credentials ||= Credentials.default scope: @config.scope,
133
+ enable_self_signed_jwt: enable_self_signed_jwt
134
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+
138
+ @quota_project_id = @config.quota_project
139
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
140
+
141
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
142
+ config.credentials = credentials
143
+ config.quota_project = @quota_project_id
144
+ config.endpoint = @config.endpoint
145
+ end
146
+
147
+ @policy_tag_manager_stub = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
148
+ end
149
+
150
+ ##
151
+ # Get the associated client for mix-in of the IAMPolicy.
152
+ #
153
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
154
+ #
155
+ attr_reader :iam_policy_client
156
+
157
+ # Service calls
158
+
159
+ ##
160
+ # Creates a taxonomy in a specified project.
161
+ #
162
+ # The taxonomy is initially empty, that is, it doesn't contain policy tags.
163
+ #
164
+ # @overload create_taxonomy(request, options = nil)
165
+ # Pass arguments to `create_taxonomy` via a request object, either of type
166
+ # {::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest} or an equivalent Hash.
167
+ #
168
+ # @param request [::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest, ::Hash]
169
+ # A request object representing the call parameters. Required. To specify no
170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
171
+ # @param options [::Gapic::CallOptions, ::Hash]
172
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
173
+ #
174
+ # @overload create_taxonomy(parent: nil, taxonomy: nil)
175
+ # Pass arguments to `create_taxonomy` via keyword arguments. Note that at
176
+ # least one keyword argument is required. To specify no parameters, or to keep all
177
+ # the default parameter values, pass an empty Hash as a request object (see above).
178
+ #
179
+ # @param parent [::String]
180
+ # Required. Resource name of the project that the taxonomy will belong to.
181
+ # @param taxonomy [::Google::Cloud::DataCatalog::V1::Taxonomy, ::Hash]
182
+ # The taxonomy to create.
183
+ # @yield [result, operation] Access the result along with the TransportOperation object
184
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy]
185
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
186
+ #
187
+ # @return [::Google::Cloud::DataCatalog::V1::Taxonomy]
188
+ #
189
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
190
+ def create_taxonomy request, options = nil
191
+ raise ::ArgumentError, "request must be provided" if request.nil?
192
+
193
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest
194
+
195
+ # Converts hash and nil to an options object
196
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
197
+
198
+ # Customize the options with defaults
199
+ call_metadata = @config.rpcs.create_taxonomy.metadata.to_h
200
+
201
+ # Set x-goog-api-client and x-goog-user-project headers
202
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
203
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
204
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
205
+ transports_version_send: [:rest]
206
+
207
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
208
+
209
+ options.apply_defaults timeout: @config.rpcs.create_taxonomy.timeout,
210
+ metadata: call_metadata,
211
+ retry_policy: @config.rpcs.create_taxonomy.retry_policy
212
+
213
+ options.apply_defaults timeout: @config.timeout,
214
+ metadata: @config.metadata,
215
+ retry_policy: @config.retry_policy
216
+
217
+ @policy_tag_manager_stub.create_taxonomy request, options do |result, operation|
218
+ yield result, operation if block_given?
219
+ return result
220
+ end
221
+ rescue ::Gapic::Rest::Error => e
222
+ raise ::Google::Cloud::Error.from_error(e)
223
+ end
224
+
225
+ ##
226
+ # Deletes a taxonomy, including all policy tags in this
227
+ # taxonomy, their associated policies, and the policy tags references from
228
+ # BigQuery columns.
229
+ #
230
+ # @overload delete_taxonomy(request, options = nil)
231
+ # Pass arguments to `delete_taxonomy` via a request object, either of type
232
+ # {::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest} or an equivalent Hash.
233
+ #
234
+ # @param request [::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest, ::Hash]
235
+ # A request object representing the call parameters. Required. To specify no
236
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
237
+ # @param options [::Gapic::CallOptions, ::Hash]
238
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
239
+ #
240
+ # @overload delete_taxonomy(name: nil)
241
+ # Pass arguments to `delete_taxonomy` via keyword arguments. Note that at
242
+ # least one keyword argument is required. To specify no parameters, or to keep all
243
+ # the default parameter values, pass an empty Hash as a request object (see above).
244
+ #
245
+ # @param name [::String]
246
+ # Required. Resource name of the taxonomy to delete.
247
+ #
248
+ # Note: All policy tags in this taxonomy are also deleted.
249
+ # @yield [result, operation] Access the result along with the TransportOperation object
250
+ # @yieldparam result [::Google::Protobuf::Empty]
251
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
252
+ #
253
+ # @return [::Google::Protobuf::Empty]
254
+ #
255
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
256
+ def delete_taxonomy request, options = nil
257
+ raise ::ArgumentError, "request must be provided" if request.nil?
258
+
259
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest
260
+
261
+ # Converts hash and nil to an options object
262
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
263
+
264
+ # Customize the options with defaults
265
+ call_metadata = @config.rpcs.delete_taxonomy.metadata.to_h
266
+
267
+ # Set x-goog-api-client and x-goog-user-project headers
268
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
269
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
270
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
271
+ transports_version_send: [:rest]
272
+
273
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
274
+
275
+ options.apply_defaults timeout: @config.rpcs.delete_taxonomy.timeout,
276
+ metadata: call_metadata,
277
+ retry_policy: @config.rpcs.delete_taxonomy.retry_policy
278
+
279
+ options.apply_defaults timeout: @config.timeout,
280
+ metadata: @config.metadata,
281
+ retry_policy: @config.retry_policy
282
+
283
+ @policy_tag_manager_stub.delete_taxonomy request, options do |result, operation|
284
+ yield result, operation if block_given?
285
+ return result
286
+ end
287
+ rescue ::Gapic::Rest::Error => e
288
+ raise ::Google::Cloud::Error.from_error(e)
289
+ end
290
+
291
+ ##
292
+ # Updates a taxonomy, including its display name,
293
+ # description, and activated policy types.
294
+ #
295
+ # @overload update_taxonomy(request, options = nil)
296
+ # Pass arguments to `update_taxonomy` via a request object, either of type
297
+ # {::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest} or an equivalent Hash.
298
+ #
299
+ # @param request [::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest, ::Hash]
300
+ # A request object representing the call parameters. Required. To specify no
301
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
302
+ # @param options [::Gapic::CallOptions, ::Hash]
303
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
304
+ #
305
+ # @overload update_taxonomy(taxonomy: nil, update_mask: nil)
306
+ # Pass arguments to `update_taxonomy` via keyword arguments. Note that at
307
+ # least one keyword argument is required. To specify no parameters, or to keep all
308
+ # the default parameter values, pass an empty Hash as a request object (see above).
309
+ #
310
+ # @param taxonomy [::Google::Cloud::DataCatalog::V1::Taxonomy, ::Hash]
311
+ # The taxonomy to update. You can update only its description, display name,
312
+ # and activated policy types.
313
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
314
+ # Specifies fields to update. If not set, defaults to all fields you can
315
+ # update.
316
+ #
317
+ # For more information, see [FieldMask]
318
+ # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask).
319
+ # @yield [result, operation] Access the result along with the TransportOperation object
320
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy]
321
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
322
+ #
323
+ # @return [::Google::Cloud::DataCatalog::V1::Taxonomy]
324
+ #
325
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
326
+ def update_taxonomy request, options = nil
327
+ raise ::ArgumentError, "request must be provided" if request.nil?
328
+
329
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest
330
+
331
+ # Converts hash and nil to an options object
332
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
333
+
334
+ # Customize the options with defaults
335
+ call_metadata = @config.rpcs.update_taxonomy.metadata.to_h
336
+
337
+ # Set x-goog-api-client and x-goog-user-project headers
338
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
339
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
340
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
341
+ transports_version_send: [:rest]
342
+
343
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
344
+
345
+ options.apply_defaults timeout: @config.rpcs.update_taxonomy.timeout,
346
+ metadata: call_metadata,
347
+ retry_policy: @config.rpcs.update_taxonomy.retry_policy
348
+
349
+ options.apply_defaults timeout: @config.timeout,
350
+ metadata: @config.metadata,
351
+ retry_policy: @config.retry_policy
352
+
353
+ @policy_tag_manager_stub.update_taxonomy request, options do |result, operation|
354
+ yield result, operation if block_given?
355
+ return result
356
+ end
357
+ rescue ::Gapic::Rest::Error => e
358
+ raise ::Google::Cloud::Error.from_error(e)
359
+ end
360
+
361
+ ##
362
+ # Lists all taxonomies in a project in a particular location that you
363
+ # have a permission to view.
364
+ #
365
+ # @overload list_taxonomies(request, options = nil)
366
+ # Pass arguments to `list_taxonomies` via a request object, either of type
367
+ # {::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest} or an equivalent Hash.
368
+ #
369
+ # @param request [::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest, ::Hash]
370
+ # A request object representing the call parameters. Required. To specify no
371
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
372
+ # @param options [::Gapic::CallOptions, ::Hash]
373
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
374
+ #
375
+ # @overload list_taxonomies(parent: nil, page_size: nil, page_token: nil)
376
+ # Pass arguments to `list_taxonomies` via keyword arguments. Note that at
377
+ # least one keyword argument is required. To specify no parameters, or to keep all
378
+ # the default parameter values, pass an empty Hash as a request object (see above).
379
+ #
380
+ # @param parent [::String]
381
+ # Required. Resource name of the project to list the taxonomies of.
382
+ # @param page_size [::Integer]
383
+ # The maximum number of items to return. Must be a value between 1 and 1000
384
+ # inclusively. If not set, defaults to 50.
385
+ # @param page_token [::String]
386
+ # The pagination token of the next results page. If not set,
387
+ # the first page is returned.
388
+ #
389
+ # The token is returned in the response to a previous list request.
390
+ # @yield [result, operation] Access the result along with the TransportOperation object
391
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>]
392
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
393
+ #
394
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>]
395
+ #
396
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
397
+ def list_taxonomies request, options = nil
398
+ raise ::ArgumentError, "request must be provided" if request.nil?
399
+
400
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest
401
+
402
+ # Converts hash and nil to an options object
403
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
404
+
405
+ # Customize the options with defaults
406
+ call_metadata = @config.rpcs.list_taxonomies.metadata.to_h
407
+
408
+ # Set x-goog-api-client and x-goog-user-project headers
409
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
410
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
411
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
412
+ transports_version_send: [:rest]
413
+
414
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
415
+
416
+ options.apply_defaults timeout: @config.rpcs.list_taxonomies.timeout,
417
+ metadata: call_metadata,
418
+ retry_policy: @config.rpcs.list_taxonomies.retry_policy
419
+
420
+ options.apply_defaults timeout: @config.timeout,
421
+ metadata: @config.metadata,
422
+ retry_policy: @config.retry_policy
423
+
424
+ @policy_tag_manager_stub.list_taxonomies request, options do |result, operation|
425
+ result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, "taxonomies", request, result, options
426
+ yield result, operation if block_given?
427
+ return result
428
+ end
429
+ rescue ::Gapic::Rest::Error => e
430
+ raise ::Google::Cloud::Error.from_error(e)
431
+ end
432
+
433
+ ##
434
+ # Gets a taxonomy.
435
+ #
436
+ # @overload get_taxonomy(request, options = nil)
437
+ # Pass arguments to `get_taxonomy` via a request object, either of type
438
+ # {::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest} or an equivalent Hash.
439
+ #
440
+ # @param request [::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest, ::Hash]
441
+ # A request object representing the call parameters. Required. To specify no
442
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
443
+ # @param options [::Gapic::CallOptions, ::Hash]
444
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
445
+ #
446
+ # @overload get_taxonomy(name: nil)
447
+ # Pass arguments to `get_taxonomy` via keyword arguments. Note that at
448
+ # least one keyword argument is required. To specify no parameters, or to keep all
449
+ # the default parameter values, pass an empty Hash as a request object (see above).
450
+ #
451
+ # @param name [::String]
452
+ # Required. Resource name of the taxonomy to get.
453
+ # @yield [result, operation] Access the result along with the TransportOperation object
454
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy]
455
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
456
+ #
457
+ # @return [::Google::Cloud::DataCatalog::V1::Taxonomy]
458
+ #
459
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
460
+ def get_taxonomy request, options = nil
461
+ raise ::ArgumentError, "request must be provided" if request.nil?
462
+
463
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest
464
+
465
+ # Converts hash and nil to an options object
466
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
467
+
468
+ # Customize the options with defaults
469
+ call_metadata = @config.rpcs.get_taxonomy.metadata.to_h
470
+
471
+ # Set x-goog-api-client and x-goog-user-project headers
472
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
473
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
474
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
475
+ transports_version_send: [:rest]
476
+
477
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
478
+
479
+ options.apply_defaults timeout: @config.rpcs.get_taxonomy.timeout,
480
+ metadata: call_metadata,
481
+ retry_policy: @config.rpcs.get_taxonomy.retry_policy
482
+
483
+ options.apply_defaults timeout: @config.timeout,
484
+ metadata: @config.metadata,
485
+ retry_policy: @config.retry_policy
486
+
487
+ @policy_tag_manager_stub.get_taxonomy request, options do |result, operation|
488
+ yield result, operation if block_given?
489
+ return result
490
+ end
491
+ rescue ::Gapic::Rest::Error => e
492
+ raise ::Google::Cloud::Error.from_error(e)
493
+ end
494
+
495
+ ##
496
+ # Creates a policy tag in a taxonomy.
497
+ #
498
+ # @overload create_policy_tag(request, options = nil)
499
+ # Pass arguments to `create_policy_tag` via a request object, either of type
500
+ # {::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest} or an equivalent Hash.
501
+ #
502
+ # @param request [::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest, ::Hash]
503
+ # A request object representing the call parameters. Required. To specify no
504
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
505
+ # @param options [::Gapic::CallOptions, ::Hash]
506
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
507
+ #
508
+ # @overload create_policy_tag(parent: nil, policy_tag: nil)
509
+ # Pass arguments to `create_policy_tag` via keyword arguments. Note that at
510
+ # least one keyword argument is required. To specify no parameters, or to keep all
511
+ # the default parameter values, pass an empty Hash as a request object (see above).
512
+ #
513
+ # @param parent [::String]
514
+ # Required. Resource name of the taxonomy that the policy tag will belong to.
515
+ # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash]
516
+ # The policy tag to create.
517
+ # @yield [result, operation] Access the result along with the TransportOperation object
518
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag]
519
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
520
+ #
521
+ # @return [::Google::Cloud::DataCatalog::V1::PolicyTag]
522
+ #
523
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
524
+ def create_policy_tag request, options = nil
525
+ raise ::ArgumentError, "request must be provided" if request.nil?
526
+
527
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest
528
+
529
+ # Converts hash and nil to an options object
530
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
531
+
532
+ # Customize the options with defaults
533
+ call_metadata = @config.rpcs.create_policy_tag.metadata.to_h
534
+
535
+ # Set x-goog-api-client and x-goog-user-project headers
536
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
537
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
538
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
539
+ transports_version_send: [:rest]
540
+
541
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
542
+
543
+ options.apply_defaults timeout: @config.rpcs.create_policy_tag.timeout,
544
+ metadata: call_metadata,
545
+ retry_policy: @config.rpcs.create_policy_tag.retry_policy
546
+
547
+ options.apply_defaults timeout: @config.timeout,
548
+ metadata: @config.metadata,
549
+ retry_policy: @config.retry_policy
550
+
551
+ @policy_tag_manager_stub.create_policy_tag request, options do |result, operation|
552
+ yield result, operation if block_given?
553
+ return result
554
+ end
555
+ rescue ::Gapic::Rest::Error => e
556
+ raise ::Google::Cloud::Error.from_error(e)
557
+ end
558
+
559
+ ##
560
+ # Deletes a policy tag together with the following:
561
+ #
562
+ # * All of its descendant policy tags, if any
563
+ # * Policies associated with the policy tag and its descendants
564
+ # * References from BigQuery table schema of the policy tag and its
565
+ # descendants
566
+ #
567
+ # @overload delete_policy_tag(request, options = nil)
568
+ # Pass arguments to `delete_policy_tag` via a request object, either of type
569
+ # {::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest} or an equivalent Hash.
570
+ #
571
+ # @param request [::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest, ::Hash]
572
+ # A request object representing the call parameters. Required. To specify no
573
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
574
+ # @param options [::Gapic::CallOptions, ::Hash]
575
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
576
+ #
577
+ # @overload delete_policy_tag(name: nil)
578
+ # Pass arguments to `delete_policy_tag` via keyword arguments. Note that at
579
+ # least one keyword argument is required. To specify no parameters, or to keep all
580
+ # the default parameter values, pass an empty Hash as a request object (see above).
581
+ #
582
+ # @param name [::String]
583
+ # Required. Resource name of the policy tag to delete.
584
+ #
585
+ # Note: All of its descendant policy tags are also deleted.
586
+ # @yield [result, operation] Access the result along with the TransportOperation object
587
+ # @yieldparam result [::Google::Protobuf::Empty]
588
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
589
+ #
590
+ # @return [::Google::Protobuf::Empty]
591
+ #
592
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
593
+ def delete_policy_tag request, options = nil
594
+ raise ::ArgumentError, "request must be provided" if request.nil?
595
+
596
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest
597
+
598
+ # Converts hash and nil to an options object
599
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
600
+
601
+ # Customize the options with defaults
602
+ call_metadata = @config.rpcs.delete_policy_tag.metadata.to_h
603
+
604
+ # Set x-goog-api-client and x-goog-user-project headers
605
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
606
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
607
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
608
+ transports_version_send: [:rest]
609
+
610
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
611
+
612
+ options.apply_defaults timeout: @config.rpcs.delete_policy_tag.timeout,
613
+ metadata: call_metadata,
614
+ retry_policy: @config.rpcs.delete_policy_tag.retry_policy
615
+
616
+ options.apply_defaults timeout: @config.timeout,
617
+ metadata: @config.metadata,
618
+ retry_policy: @config.retry_policy
619
+
620
+ @policy_tag_manager_stub.delete_policy_tag request, options do |result, operation|
621
+ yield result, operation if block_given?
622
+ return result
623
+ end
624
+ rescue ::Gapic::Rest::Error => e
625
+ raise ::Google::Cloud::Error.from_error(e)
626
+ end
627
+
628
+ ##
629
+ # Updates a policy tag, including its display
630
+ # name, description, and parent policy tag.
631
+ #
632
+ # @overload update_policy_tag(request, options = nil)
633
+ # Pass arguments to `update_policy_tag` via a request object, either of type
634
+ # {::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest} or an equivalent Hash.
635
+ #
636
+ # @param request [::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest, ::Hash]
637
+ # A request object representing the call parameters. Required. To specify no
638
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
639
+ # @param options [::Gapic::CallOptions, ::Hash]
640
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
641
+ #
642
+ # @overload update_policy_tag(policy_tag: nil, update_mask: nil)
643
+ # Pass arguments to `update_policy_tag` via keyword arguments. Note that at
644
+ # least one keyword argument is required. To specify no parameters, or to keep all
645
+ # the default parameter values, pass an empty Hash as a request object (see above).
646
+ #
647
+ # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash]
648
+ # The policy tag to update. You can update only its description, display
649
+ # name, and parent policy tag fields.
650
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
651
+ # Specifies the fields to update.
652
+ #
653
+ # You can update only display name, description, and parent policy tag.
654
+ # If not set, defaults to all updatable fields.
655
+ # For more information, see [FieldMask]
656
+ # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask).
657
+ # @yield [result, operation] Access the result along with the TransportOperation object
658
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag]
659
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
660
+ #
661
+ # @return [::Google::Cloud::DataCatalog::V1::PolicyTag]
662
+ #
663
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
664
+ def update_policy_tag request, options = nil
665
+ raise ::ArgumentError, "request must be provided" if request.nil?
666
+
667
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest
668
+
669
+ # Converts hash and nil to an options object
670
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
671
+
672
+ # Customize the options with defaults
673
+ call_metadata = @config.rpcs.update_policy_tag.metadata.to_h
674
+
675
+ # Set x-goog-api-client and x-goog-user-project headers
676
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
677
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
678
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
679
+ transports_version_send: [:rest]
680
+
681
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
682
+
683
+ options.apply_defaults timeout: @config.rpcs.update_policy_tag.timeout,
684
+ metadata: call_metadata,
685
+ retry_policy: @config.rpcs.update_policy_tag.retry_policy
686
+
687
+ options.apply_defaults timeout: @config.timeout,
688
+ metadata: @config.metadata,
689
+ retry_policy: @config.retry_policy
690
+
691
+ @policy_tag_manager_stub.update_policy_tag request, options do |result, operation|
692
+ yield result, operation if block_given?
693
+ return result
694
+ end
695
+ rescue ::Gapic::Rest::Error => e
696
+ raise ::Google::Cloud::Error.from_error(e)
697
+ end
698
+
699
+ ##
700
+ # Lists all policy tags in a taxonomy.
701
+ #
702
+ # @overload list_policy_tags(request, options = nil)
703
+ # Pass arguments to `list_policy_tags` via a request object, either of type
704
+ # {::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest} or an equivalent Hash.
705
+ #
706
+ # @param request [::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest, ::Hash]
707
+ # A request object representing the call parameters. Required. To specify no
708
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
709
+ # @param options [::Gapic::CallOptions, ::Hash]
710
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
711
+ #
712
+ # @overload list_policy_tags(parent: nil, page_size: nil, page_token: nil)
713
+ # Pass arguments to `list_policy_tags` via keyword arguments. Note that at
714
+ # least one keyword argument is required. To specify no parameters, or to keep all
715
+ # the default parameter values, pass an empty Hash as a request object (see above).
716
+ #
717
+ # @param parent [::String]
718
+ # Required. Resource name of the taxonomy to list the policy tags of.
719
+ # @param page_size [::Integer]
720
+ # The maximum number of items to return. Must be a value between 1 and 1000
721
+ # inclusively.
722
+ # If not set, defaults to 50.
723
+ # @param page_token [::String]
724
+ # The pagination token of the next results page. If not set, returns the
725
+ # first page.
726
+ #
727
+ # The token is returned in the response to a previous list request.
728
+ # @yield [result, operation] Access the result along with the TransportOperation object
729
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>]
730
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
731
+ #
732
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>]
733
+ #
734
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
735
+ def list_policy_tags request, options = nil
736
+ raise ::ArgumentError, "request must be provided" if request.nil?
737
+
738
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest
739
+
740
+ # Converts hash and nil to an options object
741
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
742
+
743
+ # Customize the options with defaults
744
+ call_metadata = @config.rpcs.list_policy_tags.metadata.to_h
745
+
746
+ # Set x-goog-api-client and x-goog-user-project headers
747
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
748
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
749
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
750
+ transports_version_send: [:rest]
751
+
752
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
753
+
754
+ options.apply_defaults timeout: @config.rpcs.list_policy_tags.timeout,
755
+ metadata: call_metadata,
756
+ retry_policy: @config.rpcs.list_policy_tags.retry_policy
757
+
758
+ options.apply_defaults timeout: @config.timeout,
759
+ metadata: @config.metadata,
760
+ retry_policy: @config.retry_policy
761
+
762
+ @policy_tag_manager_stub.list_policy_tags request, options do |result, operation|
763
+ result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, "policy_tags", request, result, options
764
+ yield result, operation if block_given?
765
+ return result
766
+ end
767
+ rescue ::Gapic::Rest::Error => e
768
+ raise ::Google::Cloud::Error.from_error(e)
769
+ end
770
+
771
+ ##
772
+ # Gets a policy tag.
773
+ #
774
+ # @overload get_policy_tag(request, options = nil)
775
+ # Pass arguments to `get_policy_tag` via a request object, either of type
776
+ # {::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest} or an equivalent Hash.
777
+ #
778
+ # @param request [::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest, ::Hash]
779
+ # A request object representing the call parameters. Required. To specify no
780
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
781
+ # @param options [::Gapic::CallOptions, ::Hash]
782
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
783
+ #
784
+ # @overload get_policy_tag(name: nil)
785
+ # Pass arguments to `get_policy_tag` via keyword arguments. Note that at
786
+ # least one keyword argument is required. To specify no parameters, or to keep all
787
+ # the default parameter values, pass an empty Hash as a request object (see above).
788
+ #
789
+ # @param name [::String]
790
+ # Required. Resource name of the policy tag.
791
+ # @yield [result, operation] Access the result along with the TransportOperation object
792
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag]
793
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
794
+ #
795
+ # @return [::Google::Cloud::DataCatalog::V1::PolicyTag]
796
+ #
797
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
798
+ def get_policy_tag request, options = nil
799
+ raise ::ArgumentError, "request must be provided" if request.nil?
800
+
801
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest
802
+
803
+ # Converts hash and nil to an options object
804
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
805
+
806
+ # Customize the options with defaults
807
+ call_metadata = @config.rpcs.get_policy_tag.metadata.to_h
808
+
809
+ # Set x-goog-api-client and x-goog-user-project headers
810
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
811
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
812
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
813
+ transports_version_send: [:rest]
814
+
815
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
816
+
817
+ options.apply_defaults timeout: @config.rpcs.get_policy_tag.timeout,
818
+ metadata: call_metadata,
819
+ retry_policy: @config.rpcs.get_policy_tag.retry_policy
820
+
821
+ options.apply_defaults timeout: @config.timeout,
822
+ metadata: @config.metadata,
823
+ retry_policy: @config.retry_policy
824
+
825
+ @policy_tag_manager_stub.get_policy_tag request, options do |result, operation|
826
+ yield result, operation if block_given?
827
+ return result
828
+ end
829
+ rescue ::Gapic::Rest::Error => e
830
+ raise ::Google::Cloud::Error.from_error(e)
831
+ end
832
+
833
+ ##
834
+ # Gets the IAM policy for a policy tag or a taxonomy.
835
+ #
836
+ # @overload get_iam_policy(request, options = nil)
837
+ # Pass arguments to `get_iam_policy` via a request object, either of type
838
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
839
+ #
840
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
841
+ # A request object representing the call parameters. Required. To specify no
842
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
843
+ # @param options [::Gapic::CallOptions, ::Hash]
844
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
845
+ #
846
+ # @overload get_iam_policy(resource: nil, options: nil)
847
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
848
+ # least one keyword argument is required. To specify no parameters, or to keep all
849
+ # the default parameter values, pass an empty Hash as a request object (see above).
850
+ #
851
+ # @param resource [::String]
852
+ # REQUIRED: The resource for which the policy is being requested.
853
+ # See the operation documentation for the appropriate value for this field.
854
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
855
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
856
+ # `GetIamPolicy`.
857
+ # @yield [result, operation] Access the result along with the TransportOperation object
858
+ # @yieldparam result [::Google::Iam::V1::Policy]
859
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
860
+ #
861
+ # @return [::Google::Iam::V1::Policy]
862
+ #
863
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
864
+ def get_iam_policy request, options = nil
865
+ raise ::ArgumentError, "request must be provided" if request.nil?
866
+
867
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
868
+
869
+ # Converts hash and nil to an options object
870
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
871
+
872
+ # Customize the options with defaults
873
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
874
+
875
+ # Set x-goog-api-client and x-goog-user-project headers
876
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
877
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
878
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
879
+ transports_version_send: [:rest]
880
+
881
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
882
+
883
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
884
+ metadata: call_metadata,
885
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
886
+
887
+ options.apply_defaults timeout: @config.timeout,
888
+ metadata: @config.metadata,
889
+ retry_policy: @config.retry_policy
890
+
891
+ @policy_tag_manager_stub.get_iam_policy request, options do |result, operation|
892
+ yield result, operation if block_given?
893
+ return result
894
+ end
895
+ rescue ::Gapic::Rest::Error => e
896
+ raise ::Google::Cloud::Error.from_error(e)
897
+ end
898
+
899
+ ##
900
+ # Sets the IAM policy for a policy tag or a taxonomy.
901
+ #
902
+ # @overload set_iam_policy(request, options = nil)
903
+ # Pass arguments to `set_iam_policy` via a request object, either of type
904
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
905
+ #
906
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
907
+ # A request object representing the call parameters. Required. To specify no
908
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
909
+ # @param options [::Gapic::CallOptions, ::Hash]
910
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
911
+ #
912
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
913
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
914
+ # least one keyword argument is required. To specify no parameters, or to keep all
915
+ # the default parameter values, pass an empty Hash as a request object (see above).
916
+ #
917
+ # @param resource [::String]
918
+ # REQUIRED: The resource for which the policy is being specified.
919
+ # See the operation documentation for the appropriate value for this field.
920
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
921
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
922
+ # the policy is limited to a few 10s of KB. An empty policy is a
923
+ # valid policy but certain Cloud Platform services (such as Projects)
924
+ # might reject them.
925
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
926
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
927
+ # the fields in the mask will be modified. If no mask is provided, the
928
+ # following default mask is used:
929
+ #
930
+ # `paths: "bindings, etag"`
931
+ # @yield [result, operation] Access the result along with the TransportOperation object
932
+ # @yieldparam result [::Google::Iam::V1::Policy]
933
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
934
+ #
935
+ # @return [::Google::Iam::V1::Policy]
936
+ #
937
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
938
+ def set_iam_policy request, options = nil
939
+ raise ::ArgumentError, "request must be provided" if request.nil?
940
+
941
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
942
+
943
+ # Converts hash and nil to an options object
944
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
945
+
946
+ # Customize the options with defaults
947
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
948
+
949
+ # Set x-goog-api-client and x-goog-user-project headers
950
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
951
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
952
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
953
+ transports_version_send: [:rest]
954
+
955
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
956
+
957
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
958
+ metadata: call_metadata,
959
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
960
+
961
+ options.apply_defaults timeout: @config.timeout,
962
+ metadata: @config.metadata,
963
+ retry_policy: @config.retry_policy
964
+
965
+ @policy_tag_manager_stub.set_iam_policy request, options do |result, operation|
966
+ yield result, operation if block_given?
967
+ return result
968
+ end
969
+ rescue ::Gapic::Rest::Error => e
970
+ raise ::Google::Cloud::Error.from_error(e)
971
+ end
972
+
973
+ ##
974
+ # Returns your permissions on a specified policy tag or
975
+ # taxonomy.
976
+ #
977
+ # @overload test_iam_permissions(request, options = nil)
978
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
979
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
980
+ #
981
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
982
+ # A request object representing the call parameters. Required. To specify no
983
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
984
+ # @param options [::Gapic::CallOptions, ::Hash]
985
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
986
+ #
987
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
988
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
989
+ # least one keyword argument is required. To specify no parameters, or to keep all
990
+ # the default parameter values, pass an empty Hash as a request object (see above).
991
+ #
992
+ # @param resource [::String]
993
+ # REQUIRED: The resource for which the policy detail is being requested.
994
+ # See the operation documentation for the appropriate value for this field.
995
+ # @param permissions [::Array<::String>]
996
+ # The set of permissions to check for the `resource`. Permissions with
997
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
998
+ # information see
999
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1000
+ # @yield [result, operation] Access the result along with the TransportOperation object
1001
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
1002
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1003
+ #
1004
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1005
+ #
1006
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1007
+ def test_iam_permissions request, options = nil
1008
+ raise ::ArgumentError, "request must be provided" if request.nil?
1009
+
1010
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1011
+
1012
+ # Converts hash and nil to an options object
1013
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1014
+
1015
+ # Customize the options with defaults
1016
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1017
+
1018
+ # Set x-goog-api-client and x-goog-user-project headers
1019
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1020
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1021
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
1022
+ transports_version_send: [:rest]
1023
+
1024
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1025
+
1026
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1027
+ metadata: call_metadata,
1028
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1029
+
1030
+ options.apply_defaults timeout: @config.timeout,
1031
+ metadata: @config.metadata,
1032
+ retry_policy: @config.retry_policy
1033
+
1034
+ @policy_tag_manager_stub.test_iam_permissions request, options do |result, operation|
1035
+ yield result, operation if block_given?
1036
+ return result
1037
+ end
1038
+ rescue ::Gapic::Rest::Error => e
1039
+ raise ::Google::Cloud::Error.from_error(e)
1040
+ end
1041
+
1042
+ ##
1043
+ # Configuration class for the PolicyTagManager REST API.
1044
+ #
1045
+ # This class represents the configuration for PolicyTagManager REST,
1046
+ # providing control over timeouts, retry behavior, logging, transport
1047
+ # parameters, and other low-level controls. Certain parameters can also be
1048
+ # applied individually to specific RPCs. See
1049
+ # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration::Rpcs}
1050
+ # for a list of RPCs that can be configured independently.
1051
+ #
1052
+ # Configuration can be applied globally to all clients, or to a single client
1053
+ # on construction.
1054
+ #
1055
+ # @example
1056
+ #
1057
+ # # Modify the global config, setting the timeout for
1058
+ # # create_taxonomy to 20 seconds,
1059
+ # # and all remaining timeouts to 10 seconds.
1060
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.configure do |config|
1061
+ # config.timeout = 10.0
1062
+ # config.rpcs.create_taxonomy.timeout = 20.0
1063
+ # end
1064
+ #
1065
+ # # Apply the above configuration only to a new client.
1066
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config|
1067
+ # config.timeout = 10.0
1068
+ # config.rpcs.create_taxonomy.timeout = 20.0
1069
+ # end
1070
+ #
1071
+ # @!attribute [rw] endpoint
1072
+ # The hostname or hostname:port of the service endpoint.
1073
+ # Defaults to `"datacatalog.googleapis.com"`.
1074
+ # @return [::String]
1075
+ # @!attribute [rw] credentials
1076
+ # Credentials to send with calls. You may provide any of the following types:
1077
+ # * (`String`) The path to a service account key file in JSON format
1078
+ # * (`Hash`) A service account key as a Hash
1079
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1080
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1081
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1082
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1083
+ # * (`nil`) indicating no credentials
1084
+ # @return [::Object]
1085
+ # @!attribute [rw] scope
1086
+ # The OAuth scopes
1087
+ # @return [::Array<::String>]
1088
+ # @!attribute [rw] lib_name
1089
+ # The library name as recorded in instrumentation and logging
1090
+ # @return [::String]
1091
+ # @!attribute [rw] lib_version
1092
+ # The library version as recorded in instrumentation and logging
1093
+ # @return [::String]
1094
+ # @!attribute [rw] timeout
1095
+ # The call timeout in seconds.
1096
+ # @return [::Numeric]
1097
+ # @!attribute [rw] metadata
1098
+ # Additional headers to be sent with the call.
1099
+ # @return [::Hash{::Symbol=>::String}]
1100
+ # @!attribute [rw] retry_policy
1101
+ # The retry policy. The value is a hash with the following keys:
1102
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1103
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1104
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1105
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1106
+ # trigger a retry.
1107
+ # @return [::Hash]
1108
+ # @!attribute [rw] quota_project
1109
+ # A separate project against which to charge quota.
1110
+ # @return [::String]
1111
+ #
1112
+ class Configuration
1113
+ extend ::Gapic::Config
1114
+
1115
+ config_attr :endpoint, "datacatalog.googleapis.com", ::String
1116
+ config_attr :credentials, nil do |value|
1117
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1118
+ allowed.any? { |klass| klass === value }
1119
+ end
1120
+ config_attr :scope, nil, ::String, ::Array, nil
1121
+ config_attr :lib_name, nil, ::String, nil
1122
+ config_attr :lib_version, nil, ::String, nil
1123
+ config_attr :timeout, nil, ::Numeric, nil
1124
+ config_attr :metadata, nil, ::Hash, nil
1125
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1126
+ config_attr :quota_project, nil, ::String, nil
1127
+
1128
+ # @private
1129
+ def initialize parent_config = nil
1130
+ @parent_config = parent_config unless parent_config.nil?
1131
+
1132
+ yield self if block_given?
1133
+ end
1134
+
1135
+ ##
1136
+ # Configurations for individual RPCs
1137
+ # @return [Rpcs]
1138
+ #
1139
+ def rpcs
1140
+ @rpcs ||= begin
1141
+ parent_rpcs = nil
1142
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1143
+ Rpcs.new parent_rpcs
1144
+ end
1145
+ end
1146
+
1147
+ ##
1148
+ # Configuration RPC class for the PolicyTagManager API.
1149
+ #
1150
+ # Includes fields providing the configuration for each RPC in this service.
1151
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1152
+ # the following configuration fields:
1153
+ #
1154
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1155
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1156
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1157
+ # include the following keys:
1158
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1159
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1160
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1161
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1162
+ # trigger a retry.
1163
+ #
1164
+ class Rpcs
1165
+ ##
1166
+ # RPC-specific configuration for `create_taxonomy`
1167
+ # @return [::Gapic::Config::Method]
1168
+ #
1169
+ attr_reader :create_taxonomy
1170
+ ##
1171
+ # RPC-specific configuration for `delete_taxonomy`
1172
+ # @return [::Gapic::Config::Method]
1173
+ #
1174
+ attr_reader :delete_taxonomy
1175
+ ##
1176
+ # RPC-specific configuration for `update_taxonomy`
1177
+ # @return [::Gapic::Config::Method]
1178
+ #
1179
+ attr_reader :update_taxonomy
1180
+ ##
1181
+ # RPC-specific configuration for `list_taxonomies`
1182
+ # @return [::Gapic::Config::Method]
1183
+ #
1184
+ attr_reader :list_taxonomies
1185
+ ##
1186
+ # RPC-specific configuration for `get_taxonomy`
1187
+ # @return [::Gapic::Config::Method]
1188
+ #
1189
+ attr_reader :get_taxonomy
1190
+ ##
1191
+ # RPC-specific configuration for `create_policy_tag`
1192
+ # @return [::Gapic::Config::Method]
1193
+ #
1194
+ attr_reader :create_policy_tag
1195
+ ##
1196
+ # RPC-specific configuration for `delete_policy_tag`
1197
+ # @return [::Gapic::Config::Method]
1198
+ #
1199
+ attr_reader :delete_policy_tag
1200
+ ##
1201
+ # RPC-specific configuration for `update_policy_tag`
1202
+ # @return [::Gapic::Config::Method]
1203
+ #
1204
+ attr_reader :update_policy_tag
1205
+ ##
1206
+ # RPC-specific configuration for `list_policy_tags`
1207
+ # @return [::Gapic::Config::Method]
1208
+ #
1209
+ attr_reader :list_policy_tags
1210
+ ##
1211
+ # RPC-specific configuration for `get_policy_tag`
1212
+ # @return [::Gapic::Config::Method]
1213
+ #
1214
+ attr_reader :get_policy_tag
1215
+ ##
1216
+ # RPC-specific configuration for `get_iam_policy`
1217
+ # @return [::Gapic::Config::Method]
1218
+ #
1219
+ attr_reader :get_iam_policy
1220
+ ##
1221
+ # RPC-specific configuration for `set_iam_policy`
1222
+ # @return [::Gapic::Config::Method]
1223
+ #
1224
+ attr_reader :set_iam_policy
1225
+ ##
1226
+ # RPC-specific configuration for `test_iam_permissions`
1227
+ # @return [::Gapic::Config::Method]
1228
+ #
1229
+ attr_reader :test_iam_permissions
1230
+
1231
+ # @private
1232
+ def initialize parent_rpcs = nil
1233
+ create_taxonomy_config = parent_rpcs.create_taxonomy if parent_rpcs.respond_to? :create_taxonomy
1234
+ @create_taxonomy = ::Gapic::Config::Method.new create_taxonomy_config
1235
+ delete_taxonomy_config = parent_rpcs.delete_taxonomy if parent_rpcs.respond_to? :delete_taxonomy
1236
+ @delete_taxonomy = ::Gapic::Config::Method.new delete_taxonomy_config
1237
+ update_taxonomy_config = parent_rpcs.update_taxonomy if parent_rpcs.respond_to? :update_taxonomy
1238
+ @update_taxonomy = ::Gapic::Config::Method.new update_taxonomy_config
1239
+ list_taxonomies_config = parent_rpcs.list_taxonomies if parent_rpcs.respond_to? :list_taxonomies
1240
+ @list_taxonomies = ::Gapic::Config::Method.new list_taxonomies_config
1241
+ get_taxonomy_config = parent_rpcs.get_taxonomy if parent_rpcs.respond_to? :get_taxonomy
1242
+ @get_taxonomy = ::Gapic::Config::Method.new get_taxonomy_config
1243
+ create_policy_tag_config = parent_rpcs.create_policy_tag if parent_rpcs.respond_to? :create_policy_tag
1244
+ @create_policy_tag = ::Gapic::Config::Method.new create_policy_tag_config
1245
+ delete_policy_tag_config = parent_rpcs.delete_policy_tag if parent_rpcs.respond_to? :delete_policy_tag
1246
+ @delete_policy_tag = ::Gapic::Config::Method.new delete_policy_tag_config
1247
+ update_policy_tag_config = parent_rpcs.update_policy_tag if parent_rpcs.respond_to? :update_policy_tag
1248
+ @update_policy_tag = ::Gapic::Config::Method.new update_policy_tag_config
1249
+ list_policy_tags_config = parent_rpcs.list_policy_tags if parent_rpcs.respond_to? :list_policy_tags
1250
+ @list_policy_tags = ::Gapic::Config::Method.new list_policy_tags_config
1251
+ get_policy_tag_config = parent_rpcs.get_policy_tag if parent_rpcs.respond_to? :get_policy_tag
1252
+ @get_policy_tag = ::Gapic::Config::Method.new get_policy_tag_config
1253
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1254
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1255
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1256
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1257
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1258
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1259
+
1260
+ yield self if block_given?
1261
+ end
1262
+ end
1263
+ end
1264
+ end
1265
+ end
1266
+ end
1267
+ end
1268
+ end
1269
+ end
1270
+ end