google-cloud-data_catalog-v1 0.13.0 → 0.15.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/google/cloud/data_catalog/v1/data_catalog/client.rb +276 -13
  4. data/lib/google/cloud/data_catalog/v1/data_catalog/operations.rb +768 -0
  5. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb +3214 -0
  6. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/operations.rb +792 -0
  7. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb +2142 -0
  8. data/lib/google/cloud/data_catalog/v1/data_catalog/rest.rb +54 -0
  9. data/lib/google/cloud/data_catalog/v1/data_catalog.rb +7 -0
  10. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb +6 -3
  11. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb +1273 -0
  12. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb +846 -0
  13. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest.rb +57 -0
  14. data/lib/google/cloud/data_catalog/v1/policy_tag_manager.rb +6 -0
  15. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb +6 -4
  16. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb +538 -0
  17. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb +227 -0
  18. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest.rb +55 -0
  19. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization.rb +6 -0
  20. data/lib/google/cloud/data_catalog/v1/rest.rb +39 -0
  21. data/lib/google/cloud/data_catalog/v1/version.rb +1 -1
  22. data/lib/google/cloud/data_catalog/v1.rb +5 -0
  23. data/lib/google/cloud/datacatalog/v1/common_pb.rb +8 -0
  24. data/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb +90 -0
  25. data/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb +33 -0
  26. data/lib/google/cloud/datacatalog/v1/dump_content_pb.rb +35 -0
  27. data/lib/google/cloud/datacatalog/v1/policytagmanager_pb.rb +8 -0
  28. data/lib/google/cloud/datacatalog/v1/schema_pb.rb +28 -0
  29. data/lib/google/cloud/datacatalog/v1/usage_pb.rb +6 -0
  30. data/proto_docs/google/api/client.rb +9 -3
  31. data/proto_docs/google/cloud/datacatalog/v1/common.rb +19 -0
  32. data/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb +283 -21
  33. data/proto_docs/google/cloud/datacatalog/v1/dump_content.rb +53 -0
  34. data/proto_docs/google/cloud/datacatalog/v1/gcs_fileset_spec.rb +2 -1
  35. data/proto_docs/google/cloud/datacatalog/v1/policytagmanager.rb +23 -2
  36. data/proto_docs/google/cloud/datacatalog/v1/policytagmanagerserialization.rb +6 -3
  37. data/proto_docs/google/cloud/datacatalog/v1/schema.rb +68 -3
  38. data/proto_docs/google/cloud/datacatalog/v1/search.rb +2 -2
  39. data/proto_docs/google/cloud/datacatalog/v1/table_spec.rb +5 -5
  40. data/proto_docs/google/cloud/datacatalog/v1/tags.rb +11 -8
  41. data/proto_docs/google/cloud/datacatalog/v1/usage.rb +30 -1
  42. data/proto_docs/google/longrunning/operations.rb +164 -0
  43. data/proto_docs/google/protobuf/any.rb +141 -0
  44. data/proto_docs/google/rpc/status.rb +48 -0
  45. metadata +23 -5
@@ -0,0 +1,1273 @@
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, filter: 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
+ # @param filter [::String]
391
+ # Supported field for filter is 'service' and value is 'dataplex'.
392
+ # Eg: service=dataplex.
393
+ # @yield [result, operation] Access the result along with the TransportOperation object
394
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>]
395
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
396
+ #
397
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>]
398
+ #
399
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
400
+ def list_taxonomies request, options = nil
401
+ raise ::ArgumentError, "request must be provided" if request.nil?
402
+
403
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest
404
+
405
+ # Converts hash and nil to an options object
406
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
407
+
408
+ # Customize the options with defaults
409
+ call_metadata = @config.rpcs.list_taxonomies.metadata.to_h
410
+
411
+ # Set x-goog-api-client and x-goog-user-project headers
412
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
413
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
414
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
415
+ transports_version_send: [:rest]
416
+
417
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
418
+
419
+ options.apply_defaults timeout: @config.rpcs.list_taxonomies.timeout,
420
+ metadata: call_metadata,
421
+ retry_policy: @config.rpcs.list_taxonomies.retry_policy
422
+
423
+ options.apply_defaults timeout: @config.timeout,
424
+ metadata: @config.metadata,
425
+ retry_policy: @config.retry_policy
426
+
427
+ @policy_tag_manager_stub.list_taxonomies request, options do |result, operation|
428
+ result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, "taxonomies", request, result, options
429
+ yield result, operation if block_given?
430
+ return result
431
+ end
432
+ rescue ::Gapic::Rest::Error => e
433
+ raise ::Google::Cloud::Error.from_error(e)
434
+ end
435
+
436
+ ##
437
+ # Gets a taxonomy.
438
+ #
439
+ # @overload get_taxonomy(request, options = nil)
440
+ # Pass arguments to `get_taxonomy` via a request object, either of type
441
+ # {::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest} or an equivalent Hash.
442
+ #
443
+ # @param request [::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest, ::Hash]
444
+ # A request object representing the call parameters. Required. To specify no
445
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
446
+ # @param options [::Gapic::CallOptions, ::Hash]
447
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
448
+ #
449
+ # @overload get_taxonomy(name: nil)
450
+ # Pass arguments to `get_taxonomy` via keyword arguments. Note that at
451
+ # least one keyword argument is required. To specify no parameters, or to keep all
452
+ # the default parameter values, pass an empty Hash as a request object (see above).
453
+ #
454
+ # @param name [::String]
455
+ # Required. Resource name of the taxonomy to get.
456
+ # @yield [result, operation] Access the result along with the TransportOperation object
457
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy]
458
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
459
+ #
460
+ # @return [::Google::Cloud::DataCatalog::V1::Taxonomy]
461
+ #
462
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
463
+ def get_taxonomy request, options = nil
464
+ raise ::ArgumentError, "request must be provided" if request.nil?
465
+
466
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest
467
+
468
+ # Converts hash and nil to an options object
469
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
470
+
471
+ # Customize the options with defaults
472
+ call_metadata = @config.rpcs.get_taxonomy.metadata.to_h
473
+
474
+ # Set x-goog-api-client and x-goog-user-project headers
475
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
476
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
477
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
478
+ transports_version_send: [:rest]
479
+
480
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
481
+
482
+ options.apply_defaults timeout: @config.rpcs.get_taxonomy.timeout,
483
+ metadata: call_metadata,
484
+ retry_policy: @config.rpcs.get_taxonomy.retry_policy
485
+
486
+ options.apply_defaults timeout: @config.timeout,
487
+ metadata: @config.metadata,
488
+ retry_policy: @config.retry_policy
489
+
490
+ @policy_tag_manager_stub.get_taxonomy request, options do |result, operation|
491
+ yield result, operation if block_given?
492
+ return result
493
+ end
494
+ rescue ::Gapic::Rest::Error => e
495
+ raise ::Google::Cloud::Error.from_error(e)
496
+ end
497
+
498
+ ##
499
+ # Creates a policy tag in a taxonomy.
500
+ #
501
+ # @overload create_policy_tag(request, options = nil)
502
+ # Pass arguments to `create_policy_tag` via a request object, either of type
503
+ # {::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest} or an equivalent Hash.
504
+ #
505
+ # @param request [::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest, ::Hash]
506
+ # A request object representing the call parameters. Required. To specify no
507
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
508
+ # @param options [::Gapic::CallOptions, ::Hash]
509
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
510
+ #
511
+ # @overload create_policy_tag(parent: nil, policy_tag: nil)
512
+ # Pass arguments to `create_policy_tag` via keyword arguments. Note that at
513
+ # least one keyword argument is required. To specify no parameters, or to keep all
514
+ # the default parameter values, pass an empty Hash as a request object (see above).
515
+ #
516
+ # @param parent [::String]
517
+ # Required. Resource name of the taxonomy that the policy tag will belong to.
518
+ # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash]
519
+ # The policy tag to create.
520
+ # @yield [result, operation] Access the result along with the TransportOperation object
521
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag]
522
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
523
+ #
524
+ # @return [::Google::Cloud::DataCatalog::V1::PolicyTag]
525
+ #
526
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
527
+ def create_policy_tag request, options = nil
528
+ raise ::ArgumentError, "request must be provided" if request.nil?
529
+
530
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest
531
+
532
+ # Converts hash and nil to an options object
533
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
534
+
535
+ # Customize the options with defaults
536
+ call_metadata = @config.rpcs.create_policy_tag.metadata.to_h
537
+
538
+ # Set x-goog-api-client and x-goog-user-project headers
539
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
540
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
541
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
542
+ transports_version_send: [:rest]
543
+
544
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
545
+
546
+ options.apply_defaults timeout: @config.rpcs.create_policy_tag.timeout,
547
+ metadata: call_metadata,
548
+ retry_policy: @config.rpcs.create_policy_tag.retry_policy
549
+
550
+ options.apply_defaults timeout: @config.timeout,
551
+ metadata: @config.metadata,
552
+ retry_policy: @config.retry_policy
553
+
554
+ @policy_tag_manager_stub.create_policy_tag request, options do |result, operation|
555
+ yield result, operation if block_given?
556
+ return result
557
+ end
558
+ rescue ::Gapic::Rest::Error => e
559
+ raise ::Google::Cloud::Error.from_error(e)
560
+ end
561
+
562
+ ##
563
+ # Deletes a policy tag together with the following:
564
+ #
565
+ # * All of its descendant policy tags, if any
566
+ # * Policies associated with the policy tag and its descendants
567
+ # * References from BigQuery table schema of the policy tag and its
568
+ # descendants
569
+ #
570
+ # @overload delete_policy_tag(request, options = nil)
571
+ # Pass arguments to `delete_policy_tag` via a request object, either of type
572
+ # {::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest} or an equivalent Hash.
573
+ #
574
+ # @param request [::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest, ::Hash]
575
+ # A request object representing the call parameters. Required. To specify no
576
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
577
+ # @param options [::Gapic::CallOptions, ::Hash]
578
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
579
+ #
580
+ # @overload delete_policy_tag(name: nil)
581
+ # Pass arguments to `delete_policy_tag` via keyword arguments. Note that at
582
+ # least one keyword argument is required. To specify no parameters, or to keep all
583
+ # the default parameter values, pass an empty Hash as a request object (see above).
584
+ #
585
+ # @param name [::String]
586
+ # Required. Resource name of the policy tag to delete.
587
+ #
588
+ # Note: All of its descendant policy tags are also deleted.
589
+ # @yield [result, operation] Access the result along with the TransportOperation object
590
+ # @yieldparam result [::Google::Protobuf::Empty]
591
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
592
+ #
593
+ # @return [::Google::Protobuf::Empty]
594
+ #
595
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
596
+ def delete_policy_tag request, options = nil
597
+ raise ::ArgumentError, "request must be provided" if request.nil?
598
+
599
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest
600
+
601
+ # Converts hash and nil to an options object
602
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
603
+
604
+ # Customize the options with defaults
605
+ call_metadata = @config.rpcs.delete_policy_tag.metadata.to_h
606
+
607
+ # Set x-goog-api-client and x-goog-user-project headers
608
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
609
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
610
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
611
+ transports_version_send: [:rest]
612
+
613
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
614
+
615
+ options.apply_defaults timeout: @config.rpcs.delete_policy_tag.timeout,
616
+ metadata: call_metadata,
617
+ retry_policy: @config.rpcs.delete_policy_tag.retry_policy
618
+
619
+ options.apply_defaults timeout: @config.timeout,
620
+ metadata: @config.metadata,
621
+ retry_policy: @config.retry_policy
622
+
623
+ @policy_tag_manager_stub.delete_policy_tag request, options do |result, operation|
624
+ yield result, operation if block_given?
625
+ return result
626
+ end
627
+ rescue ::Gapic::Rest::Error => e
628
+ raise ::Google::Cloud::Error.from_error(e)
629
+ end
630
+
631
+ ##
632
+ # Updates a policy tag, including its display
633
+ # name, description, and parent policy tag.
634
+ #
635
+ # @overload update_policy_tag(request, options = nil)
636
+ # Pass arguments to `update_policy_tag` via a request object, either of type
637
+ # {::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest} or an equivalent Hash.
638
+ #
639
+ # @param request [::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest, ::Hash]
640
+ # A request object representing the call parameters. Required. To specify no
641
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
642
+ # @param options [::Gapic::CallOptions, ::Hash]
643
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
644
+ #
645
+ # @overload update_policy_tag(policy_tag: nil, update_mask: nil)
646
+ # Pass arguments to `update_policy_tag` via keyword arguments. Note that at
647
+ # least one keyword argument is required. To specify no parameters, or to keep all
648
+ # the default parameter values, pass an empty Hash as a request object (see above).
649
+ #
650
+ # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash]
651
+ # The policy tag to update. You can update only its description, display
652
+ # name, and parent policy tag fields.
653
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
654
+ # Specifies the fields to update.
655
+ #
656
+ # You can update only display name, description, and parent policy tag.
657
+ # If not set, defaults to all updatable fields.
658
+ # For more information, see [FieldMask]
659
+ # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask).
660
+ # @yield [result, operation] Access the result along with the TransportOperation object
661
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag]
662
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
663
+ #
664
+ # @return [::Google::Cloud::DataCatalog::V1::PolicyTag]
665
+ #
666
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
667
+ def update_policy_tag request, options = nil
668
+ raise ::ArgumentError, "request must be provided" if request.nil?
669
+
670
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest
671
+
672
+ # Converts hash and nil to an options object
673
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
674
+
675
+ # Customize the options with defaults
676
+ call_metadata = @config.rpcs.update_policy_tag.metadata.to_h
677
+
678
+ # Set x-goog-api-client and x-goog-user-project headers
679
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
680
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
681
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
682
+ transports_version_send: [:rest]
683
+
684
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
685
+
686
+ options.apply_defaults timeout: @config.rpcs.update_policy_tag.timeout,
687
+ metadata: call_metadata,
688
+ retry_policy: @config.rpcs.update_policy_tag.retry_policy
689
+
690
+ options.apply_defaults timeout: @config.timeout,
691
+ metadata: @config.metadata,
692
+ retry_policy: @config.retry_policy
693
+
694
+ @policy_tag_manager_stub.update_policy_tag request, options do |result, operation|
695
+ yield result, operation if block_given?
696
+ return result
697
+ end
698
+ rescue ::Gapic::Rest::Error => e
699
+ raise ::Google::Cloud::Error.from_error(e)
700
+ end
701
+
702
+ ##
703
+ # Lists all policy tags in a taxonomy.
704
+ #
705
+ # @overload list_policy_tags(request, options = nil)
706
+ # Pass arguments to `list_policy_tags` via a request object, either of type
707
+ # {::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest} or an equivalent Hash.
708
+ #
709
+ # @param request [::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest, ::Hash]
710
+ # A request object representing the call parameters. Required. To specify no
711
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
712
+ # @param options [::Gapic::CallOptions, ::Hash]
713
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
714
+ #
715
+ # @overload list_policy_tags(parent: nil, page_size: nil, page_token: nil)
716
+ # Pass arguments to `list_policy_tags` via keyword arguments. Note that at
717
+ # least one keyword argument is required. To specify no parameters, or to keep all
718
+ # the default parameter values, pass an empty Hash as a request object (see above).
719
+ #
720
+ # @param parent [::String]
721
+ # Required. Resource name of the taxonomy to list the policy tags of.
722
+ # @param page_size [::Integer]
723
+ # The maximum number of items to return. Must be a value between 1 and 1000
724
+ # inclusively.
725
+ # If not set, defaults to 50.
726
+ # @param page_token [::String]
727
+ # The pagination token of the next results page. If not set, returns the
728
+ # first page.
729
+ #
730
+ # The token is returned in the response to a previous list request.
731
+ # @yield [result, operation] Access the result along with the TransportOperation object
732
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>]
733
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
734
+ #
735
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>]
736
+ #
737
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
738
+ def list_policy_tags request, options = nil
739
+ raise ::ArgumentError, "request must be provided" if request.nil?
740
+
741
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest
742
+
743
+ # Converts hash and nil to an options object
744
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
745
+
746
+ # Customize the options with defaults
747
+ call_metadata = @config.rpcs.list_policy_tags.metadata.to_h
748
+
749
+ # Set x-goog-api-client and x-goog-user-project headers
750
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
751
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
752
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
753
+ transports_version_send: [:rest]
754
+
755
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
756
+
757
+ options.apply_defaults timeout: @config.rpcs.list_policy_tags.timeout,
758
+ metadata: call_metadata,
759
+ retry_policy: @config.rpcs.list_policy_tags.retry_policy
760
+
761
+ options.apply_defaults timeout: @config.timeout,
762
+ metadata: @config.metadata,
763
+ retry_policy: @config.retry_policy
764
+
765
+ @policy_tag_manager_stub.list_policy_tags request, options do |result, operation|
766
+ result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, "policy_tags", request, result, options
767
+ yield result, operation if block_given?
768
+ return result
769
+ end
770
+ rescue ::Gapic::Rest::Error => e
771
+ raise ::Google::Cloud::Error.from_error(e)
772
+ end
773
+
774
+ ##
775
+ # Gets a policy tag.
776
+ #
777
+ # @overload get_policy_tag(request, options = nil)
778
+ # Pass arguments to `get_policy_tag` via a request object, either of type
779
+ # {::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest} or an equivalent Hash.
780
+ #
781
+ # @param request [::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest, ::Hash]
782
+ # A request object representing the call parameters. Required. To specify no
783
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
784
+ # @param options [::Gapic::CallOptions, ::Hash]
785
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
786
+ #
787
+ # @overload get_policy_tag(name: nil)
788
+ # Pass arguments to `get_policy_tag` via keyword arguments. Note that at
789
+ # least one keyword argument is required. To specify no parameters, or to keep all
790
+ # the default parameter values, pass an empty Hash as a request object (see above).
791
+ #
792
+ # @param name [::String]
793
+ # Required. Resource name of the policy tag.
794
+ # @yield [result, operation] Access the result along with the TransportOperation object
795
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag]
796
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
797
+ #
798
+ # @return [::Google::Cloud::DataCatalog::V1::PolicyTag]
799
+ #
800
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
801
+ def get_policy_tag request, options = nil
802
+ raise ::ArgumentError, "request must be provided" if request.nil?
803
+
804
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest
805
+
806
+ # Converts hash and nil to an options object
807
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
808
+
809
+ # Customize the options with defaults
810
+ call_metadata = @config.rpcs.get_policy_tag.metadata.to_h
811
+
812
+ # Set x-goog-api-client and x-goog-user-project headers
813
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
814
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
815
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
816
+ transports_version_send: [:rest]
817
+
818
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
819
+
820
+ options.apply_defaults timeout: @config.rpcs.get_policy_tag.timeout,
821
+ metadata: call_metadata,
822
+ retry_policy: @config.rpcs.get_policy_tag.retry_policy
823
+
824
+ options.apply_defaults timeout: @config.timeout,
825
+ metadata: @config.metadata,
826
+ retry_policy: @config.retry_policy
827
+
828
+ @policy_tag_manager_stub.get_policy_tag request, options do |result, operation|
829
+ yield result, operation if block_given?
830
+ return result
831
+ end
832
+ rescue ::Gapic::Rest::Error => e
833
+ raise ::Google::Cloud::Error.from_error(e)
834
+ end
835
+
836
+ ##
837
+ # Gets the IAM policy for a policy tag or a taxonomy.
838
+ #
839
+ # @overload get_iam_policy(request, options = nil)
840
+ # Pass arguments to `get_iam_policy` via a request object, either of type
841
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
842
+ #
843
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
844
+ # A request object representing the call parameters. Required. To specify no
845
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
846
+ # @param options [::Gapic::CallOptions, ::Hash]
847
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
848
+ #
849
+ # @overload get_iam_policy(resource: nil, options: nil)
850
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
851
+ # least one keyword argument is required. To specify no parameters, or to keep all
852
+ # the default parameter values, pass an empty Hash as a request object (see above).
853
+ #
854
+ # @param resource [::String]
855
+ # REQUIRED: The resource for which the policy is being requested.
856
+ # See the operation documentation for the appropriate value for this field.
857
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
858
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
859
+ # `GetIamPolicy`.
860
+ # @yield [result, operation] Access the result along with the TransportOperation object
861
+ # @yieldparam result [::Google::Iam::V1::Policy]
862
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
863
+ #
864
+ # @return [::Google::Iam::V1::Policy]
865
+ #
866
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
867
+ def get_iam_policy request, options = nil
868
+ raise ::ArgumentError, "request must be provided" if request.nil?
869
+
870
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
871
+
872
+ # Converts hash and nil to an options object
873
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
874
+
875
+ # Customize the options with defaults
876
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
877
+
878
+ # Set x-goog-api-client and x-goog-user-project headers
879
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
880
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
881
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
882
+ transports_version_send: [:rest]
883
+
884
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
885
+
886
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
887
+ metadata: call_metadata,
888
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
889
+
890
+ options.apply_defaults timeout: @config.timeout,
891
+ metadata: @config.metadata,
892
+ retry_policy: @config.retry_policy
893
+
894
+ @policy_tag_manager_stub.get_iam_policy request, options do |result, operation|
895
+ yield result, operation if block_given?
896
+ return result
897
+ end
898
+ rescue ::Gapic::Rest::Error => e
899
+ raise ::Google::Cloud::Error.from_error(e)
900
+ end
901
+
902
+ ##
903
+ # Sets the IAM policy for a policy tag or a taxonomy.
904
+ #
905
+ # @overload set_iam_policy(request, options = nil)
906
+ # Pass arguments to `set_iam_policy` via a request object, either of type
907
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
908
+ #
909
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
910
+ # A request object representing the call parameters. Required. To specify no
911
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
912
+ # @param options [::Gapic::CallOptions, ::Hash]
913
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
914
+ #
915
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
916
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
917
+ # least one keyword argument is required. To specify no parameters, or to keep all
918
+ # the default parameter values, pass an empty Hash as a request object (see above).
919
+ #
920
+ # @param resource [::String]
921
+ # REQUIRED: The resource for which the policy is being specified.
922
+ # See the operation documentation for the appropriate value for this field.
923
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
924
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
925
+ # the policy is limited to a few 10s of KB. An empty policy is a
926
+ # valid policy but certain Cloud Platform services (such as Projects)
927
+ # might reject them.
928
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
929
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
930
+ # the fields in the mask will be modified. If no mask is provided, the
931
+ # following default mask is used:
932
+ #
933
+ # `paths: "bindings, etag"`
934
+ # @yield [result, operation] Access the result along with the TransportOperation object
935
+ # @yieldparam result [::Google::Iam::V1::Policy]
936
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
937
+ #
938
+ # @return [::Google::Iam::V1::Policy]
939
+ #
940
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
941
+ def set_iam_policy request, options = nil
942
+ raise ::ArgumentError, "request must be provided" if request.nil?
943
+
944
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
945
+
946
+ # Converts hash and nil to an options object
947
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
948
+
949
+ # Customize the options with defaults
950
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
951
+
952
+ # Set x-goog-api-client and x-goog-user-project headers
953
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
954
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
955
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
956
+ transports_version_send: [:rest]
957
+
958
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
959
+
960
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
961
+ metadata: call_metadata,
962
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
963
+
964
+ options.apply_defaults timeout: @config.timeout,
965
+ metadata: @config.metadata,
966
+ retry_policy: @config.retry_policy
967
+
968
+ @policy_tag_manager_stub.set_iam_policy request, options do |result, operation|
969
+ yield result, operation if block_given?
970
+ return result
971
+ end
972
+ rescue ::Gapic::Rest::Error => e
973
+ raise ::Google::Cloud::Error.from_error(e)
974
+ end
975
+
976
+ ##
977
+ # Returns your permissions on a specified policy tag or
978
+ # taxonomy.
979
+ #
980
+ # @overload test_iam_permissions(request, options = nil)
981
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
982
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
983
+ #
984
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
985
+ # A request object representing the call parameters. Required. To specify no
986
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
987
+ # @param options [::Gapic::CallOptions, ::Hash]
988
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
989
+ #
990
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
991
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
992
+ # least one keyword argument is required. To specify no parameters, or to keep all
993
+ # the default parameter values, pass an empty Hash as a request object (see above).
994
+ #
995
+ # @param resource [::String]
996
+ # REQUIRED: The resource for which the policy detail is being requested.
997
+ # See the operation documentation for the appropriate value for this field.
998
+ # @param permissions [::Array<::String>]
999
+ # The set of permissions to check for the `resource`. Permissions with
1000
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1001
+ # information see
1002
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1003
+ # @yield [result, operation] Access the result along with the TransportOperation object
1004
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
1005
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1006
+ #
1007
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1008
+ #
1009
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1010
+ def test_iam_permissions request, options = nil
1011
+ raise ::ArgumentError, "request must be provided" if request.nil?
1012
+
1013
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1014
+
1015
+ # Converts hash and nil to an options object
1016
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1017
+
1018
+ # Customize the options with defaults
1019
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1020
+
1021
+ # Set x-goog-api-client and x-goog-user-project headers
1022
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1023
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1024
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
1025
+ transports_version_send: [:rest]
1026
+
1027
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1028
+
1029
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1030
+ metadata: call_metadata,
1031
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1032
+
1033
+ options.apply_defaults timeout: @config.timeout,
1034
+ metadata: @config.metadata,
1035
+ retry_policy: @config.retry_policy
1036
+
1037
+ @policy_tag_manager_stub.test_iam_permissions request, options do |result, operation|
1038
+ yield result, operation if block_given?
1039
+ return result
1040
+ end
1041
+ rescue ::Gapic::Rest::Error => e
1042
+ raise ::Google::Cloud::Error.from_error(e)
1043
+ end
1044
+
1045
+ ##
1046
+ # Configuration class for the PolicyTagManager REST API.
1047
+ #
1048
+ # This class represents the configuration for PolicyTagManager REST,
1049
+ # providing control over timeouts, retry behavior, logging, transport
1050
+ # parameters, and other low-level controls. Certain parameters can also be
1051
+ # applied individually to specific RPCs. See
1052
+ # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration::Rpcs}
1053
+ # for a list of RPCs that can be configured independently.
1054
+ #
1055
+ # Configuration can be applied globally to all clients, or to a single client
1056
+ # on construction.
1057
+ #
1058
+ # @example
1059
+ #
1060
+ # # Modify the global config, setting the timeout for
1061
+ # # create_taxonomy to 20 seconds,
1062
+ # # and all remaining timeouts to 10 seconds.
1063
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.configure do |config|
1064
+ # config.timeout = 10.0
1065
+ # config.rpcs.create_taxonomy.timeout = 20.0
1066
+ # end
1067
+ #
1068
+ # # Apply the above configuration only to a new client.
1069
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config|
1070
+ # config.timeout = 10.0
1071
+ # config.rpcs.create_taxonomy.timeout = 20.0
1072
+ # end
1073
+ #
1074
+ # @!attribute [rw] endpoint
1075
+ # The hostname or hostname:port of the service endpoint.
1076
+ # Defaults to `"datacatalog.googleapis.com"`.
1077
+ # @return [::String]
1078
+ # @!attribute [rw] credentials
1079
+ # Credentials to send with calls. You may provide any of the following types:
1080
+ # * (`String`) The path to a service account key file in JSON format
1081
+ # * (`Hash`) A service account key as a Hash
1082
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1083
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1084
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1085
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1086
+ # * (`nil`) indicating no credentials
1087
+ # @return [::Object]
1088
+ # @!attribute [rw] scope
1089
+ # The OAuth scopes
1090
+ # @return [::Array<::String>]
1091
+ # @!attribute [rw] lib_name
1092
+ # The library name as recorded in instrumentation and logging
1093
+ # @return [::String]
1094
+ # @!attribute [rw] lib_version
1095
+ # The library version as recorded in instrumentation and logging
1096
+ # @return [::String]
1097
+ # @!attribute [rw] timeout
1098
+ # The call timeout in seconds.
1099
+ # @return [::Numeric]
1100
+ # @!attribute [rw] metadata
1101
+ # Additional headers to be sent with the call.
1102
+ # @return [::Hash{::Symbol=>::String}]
1103
+ # @!attribute [rw] retry_policy
1104
+ # The retry policy. The value is a hash with the following keys:
1105
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1106
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1107
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1108
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1109
+ # trigger a retry.
1110
+ # @return [::Hash]
1111
+ # @!attribute [rw] quota_project
1112
+ # A separate project against which to charge quota.
1113
+ # @return [::String]
1114
+ #
1115
+ class Configuration
1116
+ extend ::Gapic::Config
1117
+
1118
+ config_attr :endpoint, "datacatalog.googleapis.com", ::String
1119
+ config_attr :credentials, nil do |value|
1120
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1121
+ allowed.any? { |klass| klass === value }
1122
+ end
1123
+ config_attr :scope, nil, ::String, ::Array, nil
1124
+ config_attr :lib_name, nil, ::String, nil
1125
+ config_attr :lib_version, nil, ::String, nil
1126
+ config_attr :timeout, nil, ::Numeric, nil
1127
+ config_attr :metadata, nil, ::Hash, nil
1128
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1129
+ config_attr :quota_project, nil, ::String, nil
1130
+
1131
+ # @private
1132
+ def initialize parent_config = nil
1133
+ @parent_config = parent_config unless parent_config.nil?
1134
+
1135
+ yield self if block_given?
1136
+ end
1137
+
1138
+ ##
1139
+ # Configurations for individual RPCs
1140
+ # @return [Rpcs]
1141
+ #
1142
+ def rpcs
1143
+ @rpcs ||= begin
1144
+ parent_rpcs = nil
1145
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1146
+ Rpcs.new parent_rpcs
1147
+ end
1148
+ end
1149
+
1150
+ ##
1151
+ # Configuration RPC class for the PolicyTagManager API.
1152
+ #
1153
+ # Includes fields providing the configuration for each RPC in this service.
1154
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1155
+ # the following configuration fields:
1156
+ #
1157
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1158
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1159
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1160
+ # include the following keys:
1161
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1162
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1163
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1164
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1165
+ # trigger a retry.
1166
+ #
1167
+ class Rpcs
1168
+ ##
1169
+ # RPC-specific configuration for `create_taxonomy`
1170
+ # @return [::Gapic::Config::Method]
1171
+ #
1172
+ attr_reader :create_taxonomy
1173
+ ##
1174
+ # RPC-specific configuration for `delete_taxonomy`
1175
+ # @return [::Gapic::Config::Method]
1176
+ #
1177
+ attr_reader :delete_taxonomy
1178
+ ##
1179
+ # RPC-specific configuration for `update_taxonomy`
1180
+ # @return [::Gapic::Config::Method]
1181
+ #
1182
+ attr_reader :update_taxonomy
1183
+ ##
1184
+ # RPC-specific configuration for `list_taxonomies`
1185
+ # @return [::Gapic::Config::Method]
1186
+ #
1187
+ attr_reader :list_taxonomies
1188
+ ##
1189
+ # RPC-specific configuration for `get_taxonomy`
1190
+ # @return [::Gapic::Config::Method]
1191
+ #
1192
+ attr_reader :get_taxonomy
1193
+ ##
1194
+ # RPC-specific configuration for `create_policy_tag`
1195
+ # @return [::Gapic::Config::Method]
1196
+ #
1197
+ attr_reader :create_policy_tag
1198
+ ##
1199
+ # RPC-specific configuration for `delete_policy_tag`
1200
+ # @return [::Gapic::Config::Method]
1201
+ #
1202
+ attr_reader :delete_policy_tag
1203
+ ##
1204
+ # RPC-specific configuration for `update_policy_tag`
1205
+ # @return [::Gapic::Config::Method]
1206
+ #
1207
+ attr_reader :update_policy_tag
1208
+ ##
1209
+ # RPC-specific configuration for `list_policy_tags`
1210
+ # @return [::Gapic::Config::Method]
1211
+ #
1212
+ attr_reader :list_policy_tags
1213
+ ##
1214
+ # RPC-specific configuration for `get_policy_tag`
1215
+ # @return [::Gapic::Config::Method]
1216
+ #
1217
+ attr_reader :get_policy_tag
1218
+ ##
1219
+ # RPC-specific configuration for `get_iam_policy`
1220
+ # @return [::Gapic::Config::Method]
1221
+ #
1222
+ attr_reader :get_iam_policy
1223
+ ##
1224
+ # RPC-specific configuration for `set_iam_policy`
1225
+ # @return [::Gapic::Config::Method]
1226
+ #
1227
+ attr_reader :set_iam_policy
1228
+ ##
1229
+ # RPC-specific configuration for `test_iam_permissions`
1230
+ # @return [::Gapic::Config::Method]
1231
+ #
1232
+ attr_reader :test_iam_permissions
1233
+
1234
+ # @private
1235
+ def initialize parent_rpcs = nil
1236
+ create_taxonomy_config = parent_rpcs.create_taxonomy if parent_rpcs.respond_to? :create_taxonomy
1237
+ @create_taxonomy = ::Gapic::Config::Method.new create_taxonomy_config
1238
+ delete_taxonomy_config = parent_rpcs.delete_taxonomy if parent_rpcs.respond_to? :delete_taxonomy
1239
+ @delete_taxonomy = ::Gapic::Config::Method.new delete_taxonomy_config
1240
+ update_taxonomy_config = parent_rpcs.update_taxonomy if parent_rpcs.respond_to? :update_taxonomy
1241
+ @update_taxonomy = ::Gapic::Config::Method.new update_taxonomy_config
1242
+ list_taxonomies_config = parent_rpcs.list_taxonomies if parent_rpcs.respond_to? :list_taxonomies
1243
+ @list_taxonomies = ::Gapic::Config::Method.new list_taxonomies_config
1244
+ get_taxonomy_config = parent_rpcs.get_taxonomy if parent_rpcs.respond_to? :get_taxonomy
1245
+ @get_taxonomy = ::Gapic::Config::Method.new get_taxonomy_config
1246
+ create_policy_tag_config = parent_rpcs.create_policy_tag if parent_rpcs.respond_to? :create_policy_tag
1247
+ @create_policy_tag = ::Gapic::Config::Method.new create_policy_tag_config
1248
+ delete_policy_tag_config = parent_rpcs.delete_policy_tag if parent_rpcs.respond_to? :delete_policy_tag
1249
+ @delete_policy_tag = ::Gapic::Config::Method.new delete_policy_tag_config
1250
+ update_policy_tag_config = parent_rpcs.update_policy_tag if parent_rpcs.respond_to? :update_policy_tag
1251
+ @update_policy_tag = ::Gapic::Config::Method.new update_policy_tag_config
1252
+ list_policy_tags_config = parent_rpcs.list_policy_tags if parent_rpcs.respond_to? :list_policy_tags
1253
+ @list_policy_tags = ::Gapic::Config::Method.new list_policy_tags_config
1254
+ get_policy_tag_config = parent_rpcs.get_policy_tag if parent_rpcs.respond_to? :get_policy_tag
1255
+ @get_policy_tag = ::Gapic::Config::Method.new get_policy_tag_config
1256
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1257
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1258
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1259
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1260
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1261
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1262
+
1263
+ yield self if block_given?
1264
+ end
1265
+ end
1266
+ end
1267
+ end
1268
+ end
1269
+ end
1270
+ end
1271
+ end
1272
+ end
1273
+ end