google-cloud-data_catalog-v1beta1 0.a → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/data_catalog/v1beta1/data_catalog/client.rb +3294 -0
  6. data/lib/google/cloud/data_catalog/v1beta1/data_catalog/credentials.rb +47 -0
  7. data/lib/google/cloud/data_catalog/v1beta1/data_catalog/paths.rb +176 -0
  8. data/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/client.rb +2629 -0
  9. data/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/service_stub.rb +1782 -0
  10. data/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest.rb +53 -0
  11. data/lib/google/cloud/data_catalog/v1beta1/data_catalog.rb +56 -0
  12. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/client.rb +1581 -0
  13. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/credentials.rb +47 -0
  14. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/paths.rb +90 -0
  15. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb +1254 -0
  16. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/service_stub.rb +846 -0
  17. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest.rb +53 -0
  18. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager.rb +56 -0
  19. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/client.rb +513 -0
  20. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/credentials.rb +47 -0
  21. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/paths.rb +69 -0
  22. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/client.rb +447 -0
  23. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/service_stub.rb +167 -0
  24. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest.rb +53 -0
  25. data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization.rb +56 -0
  26. data/lib/google/cloud/data_catalog/v1beta1/rest.rb +39 -0
  27. data/lib/google/cloud/data_catalog/v1beta1/version.rb +7 -2
  28. data/lib/google/cloud/data_catalog/v1beta1.rb +47 -0
  29. data/lib/google/cloud/datacatalog/v1beta1/common_pb.rb +43 -0
  30. data/lib/google/cloud/datacatalog/v1beta1/datacatalog_pb.rb +99 -0
  31. data/lib/google/cloud/datacatalog/v1beta1/datacatalog_services_pb.rb +229 -0
  32. data/lib/google/cloud/datacatalog/v1beta1/gcs_fileset_spec_pb.rb +47 -0
  33. data/lib/google/cloud/datacatalog/v1beta1/policytagmanager_pb.rb +70 -0
  34. data/lib/google/cloud/datacatalog/v1beta1/policytagmanager_services_pb.rb +73 -0
  35. data/lib/google/cloud/datacatalog/v1beta1/policytagmanagerserialization_pb.rb +55 -0
  36. data/lib/google/cloud/datacatalog/v1beta1/policytagmanagerserialization_services_pb.rb +55 -0
  37. data/lib/google/cloud/datacatalog/v1beta1/schema_pb.rb +45 -0
  38. data/lib/google/cloud/datacatalog/v1beta1/search_pb.rb +47 -0
  39. data/lib/google/cloud/datacatalog/v1beta1/table_spec_pb.rb +49 -0
  40. data/lib/google/cloud/datacatalog/v1beta1/tags_pb.rb +55 -0
  41. data/lib/google/cloud/datacatalog/v1beta1/timestamps_pb.rb +46 -0
  42. data/lib/google/cloud/datacatalog/v1beta1/usage_pb.rb +46 -0
  43. data/lib/google-cloud-data_catalog-v1beta1.rb +21 -0
  44. data/proto_docs/README.md +4 -0
  45. data/proto_docs/google/api/client.rb +381 -0
  46. data/proto_docs/google/api/field_behavior.rb +71 -0
  47. data/proto_docs/google/api/launch_stage.rb +71 -0
  48. data/proto_docs/google/api/resource.rb +222 -0
  49. data/proto_docs/google/cloud/datacatalog/v1beta1/common.rb +52 -0
  50. data/proto_docs/google/cloud/datacatalog/v1beta1/datacatalog.rb +830 -0
  51. data/proto_docs/google/cloud/datacatalog/v1beta1/gcs_fileset_spec.rb +81 -0
  52. data/proto_docs/google/cloud/datacatalog/v1beta1/policytagmanager.rb +300 -0
  53. data/proto_docs/google/cloud/datacatalog/v1beta1/policytagmanagerserialization.rb +131 -0
  54. data/proto_docs/google/cloud/datacatalog/v1beta1/schema.rb +61 -0
  55. data/proto_docs/google/cloud/datacatalog/v1beta1/search.rb +75 -0
  56. data/proto_docs/google/cloud/datacatalog/v1beta1/table_spec.rb +102 -0
  57. data/proto_docs/google/cloud/datacatalog/v1beta1/tags.rb +242 -0
  58. data/proto_docs/google/cloud/datacatalog/v1beta1/timestamps.rb +42 -0
  59. data/proto_docs/google/cloud/datacatalog/v1beta1/usage.rb +74 -0
  60. data/proto_docs/google/protobuf/duration.rb +98 -0
  61. data/proto_docs/google/protobuf/empty.rb +34 -0
  62. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  63. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  64. data/proto_docs/google/type/expr.rb +75 -0
  65. metadata +240 -11
@@ -0,0 +1,1581 @@
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/v1beta1/policytagmanager_pb"
21
+ require "google/iam/v1"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DataCatalog
26
+ module V1beta1
27
+ module PolicyTagManager
28
+ ##
29
+ # Client for the PolicyTagManager service.
30
+ #
31
+ # The policy tag manager API service allows clients to manage their taxonomies
32
+ # and policy tags.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :policy_tag_manager_stub
39
+
40
+ ##
41
+ # Configure the PolicyTagManager Client class.
42
+ #
43
+ # See {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all PolicyTagManager clients
49
+ # ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "DataCatalog", "V1beta1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.timeout = 60.0
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the PolicyTagManager Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # Create a new PolicyTagManager client object.
99
+ #
100
+ # @example
101
+ #
102
+ # # Create a client using the default configuration
103
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
104
+ #
105
+ # # Create a client using a custom configuration
106
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new do |config|
107
+ # config.timeout = 10.0
108
+ # end
109
+ #
110
+ # @yield [config] Configure the PolicyTagManager client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ def initialize
114
+ # These require statements are intentionally placed here to initialize
115
+ # the gRPC module only when it's required.
116
+ # See https://github.com/googleapis/toolkit/issues/446
117
+ require "gapic/grpc"
118
+ require "google/cloud/datacatalog/v1beta1/policytagmanager_services_pb"
119
+
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 == Configuration::DEFAULT_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
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ end
145
+
146
+ @policy_tag_manager_stub = ::Gapic::ServiceStub.new(
147
+ ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Stub,
148
+ credentials: credentials,
149
+ endpoint: @config.endpoint,
150
+ channel_args: @config.channel_args,
151
+ interceptors: @config.interceptors
152
+ )
153
+ end
154
+
155
+ ##
156
+ # Get the associated client for mix-in of the IAMPolicy.
157
+ #
158
+ # @return [Google::Iam::V1::IAMPolicy::Client]
159
+ #
160
+ attr_reader :iam_policy_client
161
+
162
+ # Service calls
163
+
164
+ ##
165
+ # Creates a taxonomy in the specified project.
166
+ #
167
+ # @overload create_taxonomy(request, options = nil)
168
+ # Pass arguments to `create_taxonomy` via a request object, either of type
169
+ # {::Google::Cloud::DataCatalog::V1beta1::CreateTaxonomyRequest} or an equivalent Hash.
170
+ #
171
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::CreateTaxonomyRequest, ::Hash]
172
+ # A request object representing the call parameters. Required. To specify no
173
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
174
+ # @param options [::Gapic::CallOptions, ::Hash]
175
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
176
+ #
177
+ # @overload create_taxonomy(parent: nil, taxonomy: nil)
178
+ # Pass arguments to `create_taxonomy` via keyword arguments. Note that at
179
+ # least one keyword argument is required. To specify no parameters, or to keep all
180
+ # the default parameter values, pass an empty Hash as a request object (see above).
181
+ #
182
+ # @param parent [::String]
183
+ # Required. Resource name of the project that the taxonomy will belong to.
184
+ # @param taxonomy [::Google::Cloud::DataCatalog::V1beta1::Taxonomy, ::Hash]
185
+ # The taxonomy to be created.
186
+ #
187
+ # @yield [response, operation] Access the result along with the RPC operation
188
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::Taxonomy]
189
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
190
+ #
191
+ # @return [::Google::Cloud::DataCatalog::V1beta1::Taxonomy]
192
+ #
193
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
194
+ #
195
+ # @example Basic example
196
+ # require "google/cloud/data_catalog/v1beta1"
197
+ #
198
+ # # Create a client object. The client can be reused for multiple calls.
199
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
200
+ #
201
+ # # Create a request. To set request fields, pass in keyword arguments.
202
+ # request = Google::Cloud::DataCatalog::V1beta1::CreateTaxonomyRequest.new
203
+ #
204
+ # # Call the create_taxonomy method.
205
+ # result = client.create_taxonomy request
206
+ #
207
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::Taxonomy.
208
+ # p result
209
+ #
210
+ def create_taxonomy request, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request.nil?
212
+
213
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::CreateTaxonomyRequest
214
+
215
+ # Converts hash and nil to an options object
216
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
217
+
218
+ # Customize the options with defaults
219
+ metadata = @config.rpcs.create_taxonomy.metadata.to_h
220
+
221
+ # Set x-goog-api-client and x-goog-user-project headers
222
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
223
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
224
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
225
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
226
+
227
+ header_params = {}
228
+ if request.parent
229
+ header_params["parent"] = request.parent
230
+ end
231
+
232
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
233
+ metadata[:"x-goog-request-params"] ||= request_params_header
234
+
235
+ options.apply_defaults timeout: @config.rpcs.create_taxonomy.timeout,
236
+ metadata: metadata,
237
+ retry_policy: @config.rpcs.create_taxonomy.retry_policy
238
+
239
+ options.apply_defaults timeout: @config.timeout,
240
+ metadata: @config.metadata,
241
+ retry_policy: @config.retry_policy
242
+
243
+ @policy_tag_manager_stub.call_rpc :create_taxonomy, request, options: options do |response, operation|
244
+ yield response, operation if block_given?
245
+ return response
246
+ end
247
+ rescue ::GRPC::BadStatus => e
248
+ raise ::Google::Cloud::Error.from_error(e)
249
+ end
250
+
251
+ ##
252
+ # Deletes a taxonomy. This operation will also delete all
253
+ # policy tags in this taxonomy along with their associated policies.
254
+ #
255
+ # @overload delete_taxonomy(request, options = nil)
256
+ # Pass arguments to `delete_taxonomy` via a request object, either of type
257
+ # {::Google::Cloud::DataCatalog::V1beta1::DeleteTaxonomyRequest} or an equivalent Hash.
258
+ #
259
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::DeleteTaxonomyRequest, ::Hash]
260
+ # A request object representing the call parameters. Required. To specify no
261
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
262
+ # @param options [::Gapic::CallOptions, ::Hash]
263
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
264
+ #
265
+ # @overload delete_taxonomy(name: nil)
266
+ # Pass arguments to `delete_taxonomy` via keyword arguments. Note that at
267
+ # least one keyword argument is required. To specify no parameters, or to keep all
268
+ # the default parameter values, pass an empty Hash as a request object (see above).
269
+ #
270
+ # @param name [::String]
271
+ # Required. Resource name of the taxonomy to be deleted. All policy tags in
272
+ # this taxonomy will also be deleted.
273
+ #
274
+ # @yield [response, operation] Access the result along with the RPC operation
275
+ # @yieldparam response [::Google::Protobuf::Empty]
276
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
277
+ #
278
+ # @return [::Google::Protobuf::Empty]
279
+ #
280
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
281
+ #
282
+ # @example Basic example
283
+ # require "google/cloud/data_catalog/v1beta1"
284
+ #
285
+ # # Create a client object. The client can be reused for multiple calls.
286
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
287
+ #
288
+ # # Create a request. To set request fields, pass in keyword arguments.
289
+ # request = Google::Cloud::DataCatalog::V1beta1::DeleteTaxonomyRequest.new
290
+ #
291
+ # # Call the delete_taxonomy method.
292
+ # result = client.delete_taxonomy request
293
+ #
294
+ # # The returned object is of type Google::Protobuf::Empty.
295
+ # p result
296
+ #
297
+ def delete_taxonomy request, options = nil
298
+ raise ::ArgumentError, "request must be provided" if request.nil?
299
+
300
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::DeleteTaxonomyRequest
301
+
302
+ # Converts hash and nil to an options object
303
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
304
+
305
+ # Customize the options with defaults
306
+ metadata = @config.rpcs.delete_taxonomy.metadata.to_h
307
+
308
+ # Set x-goog-api-client and x-goog-user-project headers
309
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
310
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
311
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
312
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
313
+
314
+ header_params = {}
315
+ if request.name
316
+ header_params["name"] = request.name
317
+ end
318
+
319
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
320
+ metadata[:"x-goog-request-params"] ||= request_params_header
321
+
322
+ options.apply_defaults timeout: @config.rpcs.delete_taxonomy.timeout,
323
+ metadata: metadata,
324
+ retry_policy: @config.rpcs.delete_taxonomy.retry_policy
325
+
326
+ options.apply_defaults timeout: @config.timeout,
327
+ metadata: @config.metadata,
328
+ retry_policy: @config.retry_policy
329
+
330
+ @policy_tag_manager_stub.call_rpc :delete_taxonomy, request, options: options do |response, operation|
331
+ yield response, operation if block_given?
332
+ return response
333
+ end
334
+ rescue ::GRPC::BadStatus => e
335
+ raise ::Google::Cloud::Error.from_error(e)
336
+ end
337
+
338
+ ##
339
+ # Updates a taxonomy.
340
+ #
341
+ # @overload update_taxonomy(request, options = nil)
342
+ # Pass arguments to `update_taxonomy` via a request object, either of type
343
+ # {::Google::Cloud::DataCatalog::V1beta1::UpdateTaxonomyRequest} or an equivalent Hash.
344
+ #
345
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::UpdateTaxonomyRequest, ::Hash]
346
+ # A request object representing the call parameters. Required. To specify no
347
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
348
+ # @param options [::Gapic::CallOptions, ::Hash]
349
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
350
+ #
351
+ # @overload update_taxonomy(taxonomy: nil, update_mask: nil)
352
+ # Pass arguments to `update_taxonomy` via keyword arguments. Note that at
353
+ # least one keyword argument is required. To specify no parameters, or to keep all
354
+ # the default parameter values, pass an empty Hash as a request object (see above).
355
+ #
356
+ # @param taxonomy [::Google::Cloud::DataCatalog::V1beta1::Taxonomy, ::Hash]
357
+ # The taxonomy to update. Only description, display_name, and activated
358
+ # policy types can be updated.
359
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
360
+ # The update mask applies to the resource. For the `FieldMask` definition,
361
+ # see
362
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
363
+ # If not set, defaults to all of the fields that are allowed to update.
364
+ #
365
+ # @yield [response, operation] Access the result along with the RPC operation
366
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::Taxonomy]
367
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
368
+ #
369
+ # @return [::Google::Cloud::DataCatalog::V1beta1::Taxonomy]
370
+ #
371
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
372
+ #
373
+ # @example Basic example
374
+ # require "google/cloud/data_catalog/v1beta1"
375
+ #
376
+ # # Create a client object. The client can be reused for multiple calls.
377
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
378
+ #
379
+ # # Create a request. To set request fields, pass in keyword arguments.
380
+ # request = Google::Cloud::DataCatalog::V1beta1::UpdateTaxonomyRequest.new
381
+ #
382
+ # # Call the update_taxonomy method.
383
+ # result = client.update_taxonomy request
384
+ #
385
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::Taxonomy.
386
+ # p result
387
+ #
388
+ def update_taxonomy request, options = nil
389
+ raise ::ArgumentError, "request must be provided" if request.nil?
390
+
391
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::UpdateTaxonomyRequest
392
+
393
+ # Converts hash and nil to an options object
394
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
395
+
396
+ # Customize the options with defaults
397
+ metadata = @config.rpcs.update_taxonomy.metadata.to_h
398
+
399
+ # Set x-goog-api-client and x-goog-user-project headers
400
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
401
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
402
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
403
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
404
+
405
+ header_params = {}
406
+ if request.taxonomy&.name
407
+ header_params["taxonomy.name"] = request.taxonomy.name
408
+ end
409
+
410
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
411
+ metadata[:"x-goog-request-params"] ||= request_params_header
412
+
413
+ options.apply_defaults timeout: @config.rpcs.update_taxonomy.timeout,
414
+ metadata: metadata,
415
+ retry_policy: @config.rpcs.update_taxonomy.retry_policy
416
+
417
+ options.apply_defaults timeout: @config.timeout,
418
+ metadata: @config.metadata,
419
+ retry_policy: @config.retry_policy
420
+
421
+ @policy_tag_manager_stub.call_rpc :update_taxonomy, request, options: options do |response, operation|
422
+ yield response, operation if block_given?
423
+ return response
424
+ end
425
+ rescue ::GRPC::BadStatus => e
426
+ raise ::Google::Cloud::Error.from_error(e)
427
+ end
428
+
429
+ ##
430
+ # Lists all taxonomies in a project in a particular location that the caller
431
+ # has permission to view.
432
+ #
433
+ # @overload list_taxonomies(request, options = nil)
434
+ # Pass arguments to `list_taxonomies` via a request object, either of type
435
+ # {::Google::Cloud::DataCatalog::V1beta1::ListTaxonomiesRequest} or an equivalent Hash.
436
+ #
437
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::ListTaxonomiesRequest, ::Hash]
438
+ # A request object representing the call parameters. Required. To specify no
439
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
440
+ # @param options [::Gapic::CallOptions, ::Hash]
441
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
442
+ #
443
+ # @overload list_taxonomies(parent: nil, page_size: nil, page_token: nil, filter: nil)
444
+ # Pass arguments to `list_taxonomies` via keyword arguments. Note that at
445
+ # least one keyword argument is required. To specify no parameters, or to keep all
446
+ # the default parameter values, pass an empty Hash as a request object (see above).
447
+ #
448
+ # @param parent [::String]
449
+ # Required. Resource name of the project to list the taxonomies of.
450
+ # @param page_size [::Integer]
451
+ # The maximum number of items to return. Must be a value between 1 and 1000.
452
+ # If not set, defaults to 50.
453
+ # @param page_token [::String]
454
+ # The next_page_token value returned from a previous list request, if any. If
455
+ # not set, defaults to an empty string.
456
+ # @param filter [::String]
457
+ # Supported field for filter is 'service' and value is 'dataplex'.
458
+ # Eg: service=dataplex.
459
+ #
460
+ # @yield [response, operation] Access the result along with the RPC operation
461
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1beta1::Taxonomy>]
462
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
463
+ #
464
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1beta1::Taxonomy>]
465
+ #
466
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
467
+ #
468
+ # @example Basic example
469
+ # require "google/cloud/data_catalog/v1beta1"
470
+ #
471
+ # # Create a client object. The client can be reused for multiple calls.
472
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
473
+ #
474
+ # # Create a request. To set request fields, pass in keyword arguments.
475
+ # request = Google::Cloud::DataCatalog::V1beta1::ListTaxonomiesRequest.new
476
+ #
477
+ # # Call the list_taxonomies method.
478
+ # result = client.list_taxonomies request
479
+ #
480
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
481
+ # # over elements, and API calls will be issued to fetch pages as needed.
482
+ # result.each do |item|
483
+ # # Each element is of type ::Google::Cloud::DataCatalog::V1beta1::Taxonomy.
484
+ # p item
485
+ # end
486
+ #
487
+ def list_taxonomies request, options = nil
488
+ raise ::ArgumentError, "request must be provided" if request.nil?
489
+
490
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ListTaxonomiesRequest
491
+
492
+ # Converts hash and nil to an options object
493
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
494
+
495
+ # Customize the options with defaults
496
+ metadata = @config.rpcs.list_taxonomies.metadata.to_h
497
+
498
+ # Set x-goog-api-client and x-goog-user-project headers
499
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
500
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
501
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
502
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
503
+
504
+ header_params = {}
505
+ if request.parent
506
+ header_params["parent"] = request.parent
507
+ end
508
+
509
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
510
+ metadata[:"x-goog-request-params"] ||= request_params_header
511
+
512
+ options.apply_defaults timeout: @config.rpcs.list_taxonomies.timeout,
513
+ metadata: metadata,
514
+ retry_policy: @config.rpcs.list_taxonomies.retry_policy
515
+
516
+ options.apply_defaults timeout: @config.timeout,
517
+ metadata: @config.metadata,
518
+ retry_policy: @config.retry_policy
519
+
520
+ @policy_tag_manager_stub.call_rpc :list_taxonomies, request, options: options do |response, operation|
521
+ response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, request, response, operation, options
522
+ yield response, operation if block_given?
523
+ return response
524
+ end
525
+ rescue ::GRPC::BadStatus => e
526
+ raise ::Google::Cloud::Error.from_error(e)
527
+ end
528
+
529
+ ##
530
+ # Gets a taxonomy.
531
+ #
532
+ # @overload get_taxonomy(request, options = nil)
533
+ # Pass arguments to `get_taxonomy` via a request object, either of type
534
+ # {::Google::Cloud::DataCatalog::V1beta1::GetTaxonomyRequest} or an equivalent Hash.
535
+ #
536
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::GetTaxonomyRequest, ::Hash]
537
+ # A request object representing the call parameters. Required. To specify no
538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
539
+ # @param options [::Gapic::CallOptions, ::Hash]
540
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
541
+ #
542
+ # @overload get_taxonomy(name: nil)
543
+ # Pass arguments to `get_taxonomy` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param name [::String]
548
+ # Required. Resource name of the requested taxonomy.
549
+ #
550
+ # @yield [response, operation] Access the result along with the RPC operation
551
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::Taxonomy]
552
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
553
+ #
554
+ # @return [::Google::Cloud::DataCatalog::V1beta1::Taxonomy]
555
+ #
556
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
557
+ #
558
+ # @example Basic example
559
+ # require "google/cloud/data_catalog/v1beta1"
560
+ #
561
+ # # Create a client object. The client can be reused for multiple calls.
562
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
563
+ #
564
+ # # Create a request. To set request fields, pass in keyword arguments.
565
+ # request = Google::Cloud::DataCatalog::V1beta1::GetTaxonomyRequest.new
566
+ #
567
+ # # Call the get_taxonomy method.
568
+ # result = client.get_taxonomy request
569
+ #
570
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::Taxonomy.
571
+ # p result
572
+ #
573
+ def get_taxonomy request, options = nil
574
+ raise ::ArgumentError, "request must be provided" if request.nil?
575
+
576
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::GetTaxonomyRequest
577
+
578
+ # Converts hash and nil to an options object
579
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
580
+
581
+ # Customize the options with defaults
582
+ metadata = @config.rpcs.get_taxonomy.metadata.to_h
583
+
584
+ # Set x-goog-api-client and x-goog-user-project headers
585
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
586
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
587
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
588
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
589
+
590
+ header_params = {}
591
+ if request.name
592
+ header_params["name"] = request.name
593
+ end
594
+
595
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
596
+ metadata[:"x-goog-request-params"] ||= request_params_header
597
+
598
+ options.apply_defaults timeout: @config.rpcs.get_taxonomy.timeout,
599
+ metadata: metadata,
600
+ retry_policy: @config.rpcs.get_taxonomy.retry_policy
601
+
602
+ options.apply_defaults timeout: @config.timeout,
603
+ metadata: @config.metadata,
604
+ retry_policy: @config.retry_policy
605
+
606
+ @policy_tag_manager_stub.call_rpc :get_taxonomy, request, options: options do |response, operation|
607
+ yield response, operation if block_given?
608
+ return response
609
+ end
610
+ rescue ::GRPC::BadStatus => e
611
+ raise ::Google::Cloud::Error.from_error(e)
612
+ end
613
+
614
+ ##
615
+ # Creates a policy tag in the specified taxonomy.
616
+ #
617
+ # @overload create_policy_tag(request, options = nil)
618
+ # Pass arguments to `create_policy_tag` via a request object, either of type
619
+ # {::Google::Cloud::DataCatalog::V1beta1::CreatePolicyTagRequest} or an equivalent Hash.
620
+ #
621
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::CreatePolicyTagRequest, ::Hash]
622
+ # A request object representing the call parameters. Required. To specify no
623
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
624
+ # @param options [::Gapic::CallOptions, ::Hash]
625
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
626
+ #
627
+ # @overload create_policy_tag(parent: nil, policy_tag: nil)
628
+ # Pass arguments to `create_policy_tag` via keyword arguments. Note that at
629
+ # least one keyword argument is required. To specify no parameters, or to keep all
630
+ # the default parameter values, pass an empty Hash as a request object (see above).
631
+ #
632
+ # @param parent [::String]
633
+ # Required. Resource name of the taxonomy that the policy tag will belong to.
634
+ # @param policy_tag [::Google::Cloud::DataCatalog::V1beta1::PolicyTag, ::Hash]
635
+ # The policy tag to be created.
636
+ #
637
+ # @yield [response, operation] Access the result along with the RPC operation
638
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::PolicyTag]
639
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
640
+ #
641
+ # @return [::Google::Cloud::DataCatalog::V1beta1::PolicyTag]
642
+ #
643
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
644
+ #
645
+ # @example Basic example
646
+ # require "google/cloud/data_catalog/v1beta1"
647
+ #
648
+ # # Create a client object. The client can be reused for multiple calls.
649
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
650
+ #
651
+ # # Create a request. To set request fields, pass in keyword arguments.
652
+ # request = Google::Cloud::DataCatalog::V1beta1::CreatePolicyTagRequest.new
653
+ #
654
+ # # Call the create_policy_tag method.
655
+ # result = client.create_policy_tag request
656
+ #
657
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::PolicyTag.
658
+ # p result
659
+ #
660
+ def create_policy_tag request, options = nil
661
+ raise ::ArgumentError, "request must be provided" if request.nil?
662
+
663
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::CreatePolicyTagRequest
664
+
665
+ # Converts hash and nil to an options object
666
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
667
+
668
+ # Customize the options with defaults
669
+ metadata = @config.rpcs.create_policy_tag.metadata.to_h
670
+
671
+ # Set x-goog-api-client and x-goog-user-project headers
672
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
673
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
674
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
675
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
676
+
677
+ header_params = {}
678
+ if request.parent
679
+ header_params["parent"] = request.parent
680
+ end
681
+
682
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
683
+ metadata[:"x-goog-request-params"] ||= request_params_header
684
+
685
+ options.apply_defaults timeout: @config.rpcs.create_policy_tag.timeout,
686
+ metadata: metadata,
687
+ retry_policy: @config.rpcs.create_policy_tag.retry_policy
688
+
689
+ options.apply_defaults timeout: @config.timeout,
690
+ metadata: @config.metadata,
691
+ retry_policy: @config.retry_policy
692
+
693
+ @policy_tag_manager_stub.call_rpc :create_policy_tag, request, options: options do |response, operation|
694
+ yield response, operation if block_given?
695
+ return response
696
+ end
697
+ rescue ::GRPC::BadStatus => e
698
+ raise ::Google::Cloud::Error.from_error(e)
699
+ end
700
+
701
+ ##
702
+ # Deletes a policy tag. Also deletes all of its descendant policy tags.
703
+ #
704
+ # @overload delete_policy_tag(request, options = nil)
705
+ # Pass arguments to `delete_policy_tag` via a request object, either of type
706
+ # {::Google::Cloud::DataCatalog::V1beta1::DeletePolicyTagRequest} or an equivalent Hash.
707
+ #
708
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::DeletePolicyTagRequest, ::Hash]
709
+ # A request object representing the call parameters. Required. To specify no
710
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
711
+ # @param options [::Gapic::CallOptions, ::Hash]
712
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
713
+ #
714
+ # @overload delete_policy_tag(name: nil)
715
+ # Pass arguments to `delete_policy_tag` via keyword arguments. Note that at
716
+ # least one keyword argument is required. To specify no parameters, or to keep all
717
+ # the default parameter values, pass an empty Hash as a request object (see above).
718
+ #
719
+ # @param name [::String]
720
+ # Required. Resource name of the policy tag to be deleted. All of its
721
+ # descendant policy tags will also be deleted.
722
+ #
723
+ # @yield [response, operation] Access the result along with the RPC operation
724
+ # @yieldparam response [::Google::Protobuf::Empty]
725
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
726
+ #
727
+ # @return [::Google::Protobuf::Empty]
728
+ #
729
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
730
+ #
731
+ # @example Basic example
732
+ # require "google/cloud/data_catalog/v1beta1"
733
+ #
734
+ # # Create a client object. The client can be reused for multiple calls.
735
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
736
+ #
737
+ # # Create a request. To set request fields, pass in keyword arguments.
738
+ # request = Google::Cloud::DataCatalog::V1beta1::DeletePolicyTagRequest.new
739
+ #
740
+ # # Call the delete_policy_tag method.
741
+ # result = client.delete_policy_tag request
742
+ #
743
+ # # The returned object is of type Google::Protobuf::Empty.
744
+ # p result
745
+ #
746
+ def delete_policy_tag request, options = nil
747
+ raise ::ArgumentError, "request must be provided" if request.nil?
748
+
749
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::DeletePolicyTagRequest
750
+
751
+ # Converts hash and nil to an options object
752
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
753
+
754
+ # Customize the options with defaults
755
+ metadata = @config.rpcs.delete_policy_tag.metadata.to_h
756
+
757
+ # Set x-goog-api-client and x-goog-user-project headers
758
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
759
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
760
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
761
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
762
+
763
+ header_params = {}
764
+ if request.name
765
+ header_params["name"] = request.name
766
+ end
767
+
768
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
769
+ metadata[:"x-goog-request-params"] ||= request_params_header
770
+
771
+ options.apply_defaults timeout: @config.rpcs.delete_policy_tag.timeout,
772
+ metadata: metadata,
773
+ retry_policy: @config.rpcs.delete_policy_tag.retry_policy
774
+
775
+ options.apply_defaults timeout: @config.timeout,
776
+ metadata: @config.metadata,
777
+ retry_policy: @config.retry_policy
778
+
779
+ @policy_tag_manager_stub.call_rpc :delete_policy_tag, request, options: options do |response, operation|
780
+ yield response, operation if block_given?
781
+ return response
782
+ end
783
+ rescue ::GRPC::BadStatus => e
784
+ raise ::Google::Cloud::Error.from_error(e)
785
+ end
786
+
787
+ ##
788
+ # Updates a policy tag.
789
+ #
790
+ # @overload update_policy_tag(request, options = nil)
791
+ # Pass arguments to `update_policy_tag` via a request object, either of type
792
+ # {::Google::Cloud::DataCatalog::V1beta1::UpdatePolicyTagRequest} or an equivalent Hash.
793
+ #
794
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::UpdatePolicyTagRequest, ::Hash]
795
+ # A request object representing the call parameters. Required. To specify no
796
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
797
+ # @param options [::Gapic::CallOptions, ::Hash]
798
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
799
+ #
800
+ # @overload update_policy_tag(policy_tag: nil, update_mask: nil)
801
+ # Pass arguments to `update_policy_tag` via keyword arguments. Note that at
802
+ # least one keyword argument is required. To specify no parameters, or to keep all
803
+ # the default parameter values, pass an empty Hash as a request object (see above).
804
+ #
805
+ # @param policy_tag [::Google::Cloud::DataCatalog::V1beta1::PolicyTag, ::Hash]
806
+ # The policy tag to update. Only the description, display_name, and
807
+ # parent_policy_tag fields can be updated.
808
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
809
+ # The update mask applies to the resource. Only display_name, description and
810
+ # parent_policy_tag can be updated and thus can be listed in the mask. If
811
+ # update_mask is not provided, all allowed fields (i.e. display_name,
812
+ # description and parent) will be updated. For more information including the
813
+ # `FieldMask` definition, see
814
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
815
+ # If not set, defaults to all of the fields that are allowed to update.
816
+ #
817
+ # @yield [response, operation] Access the result along with the RPC operation
818
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::PolicyTag]
819
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
820
+ #
821
+ # @return [::Google::Cloud::DataCatalog::V1beta1::PolicyTag]
822
+ #
823
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
824
+ #
825
+ # @example Basic example
826
+ # require "google/cloud/data_catalog/v1beta1"
827
+ #
828
+ # # Create a client object. The client can be reused for multiple calls.
829
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
830
+ #
831
+ # # Create a request. To set request fields, pass in keyword arguments.
832
+ # request = Google::Cloud::DataCatalog::V1beta1::UpdatePolicyTagRequest.new
833
+ #
834
+ # # Call the update_policy_tag method.
835
+ # result = client.update_policy_tag request
836
+ #
837
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::PolicyTag.
838
+ # p result
839
+ #
840
+ def update_policy_tag request, options = nil
841
+ raise ::ArgumentError, "request must be provided" if request.nil?
842
+
843
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::UpdatePolicyTagRequest
844
+
845
+ # Converts hash and nil to an options object
846
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
847
+
848
+ # Customize the options with defaults
849
+ metadata = @config.rpcs.update_policy_tag.metadata.to_h
850
+
851
+ # Set x-goog-api-client and x-goog-user-project headers
852
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
853
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
854
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
855
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
856
+
857
+ header_params = {}
858
+ if request.policy_tag&.name
859
+ header_params["policy_tag.name"] = request.policy_tag.name
860
+ end
861
+
862
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
863
+ metadata[:"x-goog-request-params"] ||= request_params_header
864
+
865
+ options.apply_defaults timeout: @config.rpcs.update_policy_tag.timeout,
866
+ metadata: metadata,
867
+ retry_policy: @config.rpcs.update_policy_tag.retry_policy
868
+
869
+ options.apply_defaults timeout: @config.timeout,
870
+ metadata: @config.metadata,
871
+ retry_policy: @config.retry_policy
872
+
873
+ @policy_tag_manager_stub.call_rpc :update_policy_tag, request, options: options do |response, operation|
874
+ yield response, operation if block_given?
875
+ return response
876
+ end
877
+ rescue ::GRPC::BadStatus => e
878
+ raise ::Google::Cloud::Error.from_error(e)
879
+ end
880
+
881
+ ##
882
+ # Lists all policy tags in a taxonomy.
883
+ #
884
+ # @overload list_policy_tags(request, options = nil)
885
+ # Pass arguments to `list_policy_tags` via a request object, either of type
886
+ # {::Google::Cloud::DataCatalog::V1beta1::ListPolicyTagsRequest} or an equivalent Hash.
887
+ #
888
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::ListPolicyTagsRequest, ::Hash]
889
+ # A request object representing the call parameters. Required. To specify no
890
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
891
+ # @param options [::Gapic::CallOptions, ::Hash]
892
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
893
+ #
894
+ # @overload list_policy_tags(parent: nil, page_size: nil, page_token: nil)
895
+ # Pass arguments to `list_policy_tags` via keyword arguments. Note that at
896
+ # least one keyword argument is required. To specify no parameters, or to keep all
897
+ # the default parameter values, pass an empty Hash as a request object (see above).
898
+ #
899
+ # @param parent [::String]
900
+ # Required. Resource name of the taxonomy to list the policy tags of.
901
+ # @param page_size [::Integer]
902
+ # The maximum number of items to return. Must be a value between 1 and 1000.
903
+ # If not set, defaults to 50.
904
+ # @param page_token [::String]
905
+ # The next_page_token value returned from a previous List request, if any. If
906
+ # not set, defaults to an empty string.
907
+ #
908
+ # @yield [response, operation] Access the result along with the RPC operation
909
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1beta1::PolicyTag>]
910
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
911
+ #
912
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1beta1::PolicyTag>]
913
+ #
914
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
915
+ #
916
+ # @example Basic example
917
+ # require "google/cloud/data_catalog/v1beta1"
918
+ #
919
+ # # Create a client object. The client can be reused for multiple calls.
920
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
921
+ #
922
+ # # Create a request. To set request fields, pass in keyword arguments.
923
+ # request = Google::Cloud::DataCatalog::V1beta1::ListPolicyTagsRequest.new
924
+ #
925
+ # # Call the list_policy_tags method.
926
+ # result = client.list_policy_tags request
927
+ #
928
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
929
+ # # over elements, and API calls will be issued to fetch pages as needed.
930
+ # result.each do |item|
931
+ # # Each element is of type ::Google::Cloud::DataCatalog::V1beta1::PolicyTag.
932
+ # p item
933
+ # end
934
+ #
935
+ def list_policy_tags request, options = nil
936
+ raise ::ArgumentError, "request must be provided" if request.nil?
937
+
938
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ListPolicyTagsRequest
939
+
940
+ # Converts hash and nil to an options object
941
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
942
+
943
+ # Customize the options with defaults
944
+ metadata = @config.rpcs.list_policy_tags.metadata.to_h
945
+
946
+ # Set x-goog-api-client and x-goog-user-project headers
947
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
948
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
949
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
950
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
951
+
952
+ header_params = {}
953
+ if request.parent
954
+ header_params["parent"] = request.parent
955
+ end
956
+
957
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
958
+ metadata[:"x-goog-request-params"] ||= request_params_header
959
+
960
+ options.apply_defaults timeout: @config.rpcs.list_policy_tags.timeout,
961
+ metadata: metadata,
962
+ retry_policy: @config.rpcs.list_policy_tags.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.call_rpc :list_policy_tags, request, options: options do |response, operation|
969
+ response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, request, response, operation, options
970
+ yield response, operation if block_given?
971
+ return response
972
+ end
973
+ rescue ::GRPC::BadStatus => e
974
+ raise ::Google::Cloud::Error.from_error(e)
975
+ end
976
+
977
+ ##
978
+ # Gets a policy tag.
979
+ #
980
+ # @overload get_policy_tag(request, options = nil)
981
+ # Pass arguments to `get_policy_tag` via a request object, either of type
982
+ # {::Google::Cloud::DataCatalog::V1beta1::GetPolicyTagRequest} or an equivalent Hash.
983
+ #
984
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::GetPolicyTagRequest, ::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 get_policy_tag(name: nil)
991
+ # Pass arguments to `get_policy_tag` 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 name [::String]
996
+ # Required. Resource name of the requested policy tag.
997
+ #
998
+ # @yield [response, operation] Access the result along with the RPC operation
999
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::PolicyTag]
1000
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1001
+ #
1002
+ # @return [::Google::Cloud::DataCatalog::V1beta1::PolicyTag]
1003
+ #
1004
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1005
+ #
1006
+ # @example Basic example
1007
+ # require "google/cloud/data_catalog/v1beta1"
1008
+ #
1009
+ # # Create a client object. The client can be reused for multiple calls.
1010
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
1011
+ #
1012
+ # # Create a request. To set request fields, pass in keyword arguments.
1013
+ # request = Google::Cloud::DataCatalog::V1beta1::GetPolicyTagRequest.new
1014
+ #
1015
+ # # Call the get_policy_tag method.
1016
+ # result = client.get_policy_tag request
1017
+ #
1018
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::PolicyTag.
1019
+ # p result
1020
+ #
1021
+ def get_policy_tag request, options = nil
1022
+ raise ::ArgumentError, "request must be provided" if request.nil?
1023
+
1024
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::GetPolicyTagRequest
1025
+
1026
+ # Converts hash and nil to an options object
1027
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1028
+
1029
+ # Customize the options with defaults
1030
+ metadata = @config.rpcs.get_policy_tag.metadata.to_h
1031
+
1032
+ # Set x-goog-api-client and x-goog-user-project headers
1033
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1034
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1035
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
1036
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1037
+
1038
+ header_params = {}
1039
+ if request.name
1040
+ header_params["name"] = request.name
1041
+ end
1042
+
1043
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1044
+ metadata[:"x-goog-request-params"] ||= request_params_header
1045
+
1046
+ options.apply_defaults timeout: @config.rpcs.get_policy_tag.timeout,
1047
+ metadata: metadata,
1048
+ retry_policy: @config.rpcs.get_policy_tag.retry_policy
1049
+
1050
+ options.apply_defaults timeout: @config.timeout,
1051
+ metadata: @config.metadata,
1052
+ retry_policy: @config.retry_policy
1053
+
1054
+ @policy_tag_manager_stub.call_rpc :get_policy_tag, request, options: options do |response, operation|
1055
+ yield response, operation if block_given?
1056
+ return response
1057
+ end
1058
+ rescue ::GRPC::BadStatus => e
1059
+ raise ::Google::Cloud::Error.from_error(e)
1060
+ end
1061
+
1062
+ ##
1063
+ # Gets the IAM policy for a taxonomy or a policy tag.
1064
+ #
1065
+ # @overload get_iam_policy(request, options = nil)
1066
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1067
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1068
+ #
1069
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1070
+ # A request object representing the call parameters. Required. To specify no
1071
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1072
+ # @param options [::Gapic::CallOptions, ::Hash]
1073
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1074
+ #
1075
+ # @overload get_iam_policy(resource: nil, options: nil)
1076
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1077
+ # least one keyword argument is required. To specify no parameters, or to keep all
1078
+ # the default parameter values, pass an empty Hash as a request object (see above).
1079
+ #
1080
+ # @param resource [::String]
1081
+ # REQUIRED: The resource for which the policy is being requested.
1082
+ # See the operation documentation for the appropriate value for this field.
1083
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1084
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1085
+ # `GetIamPolicy`.
1086
+ #
1087
+ # @yield [response, operation] Access the result along with the RPC operation
1088
+ # @yieldparam response [::Google::Iam::V1::Policy]
1089
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1090
+ #
1091
+ # @return [::Google::Iam::V1::Policy]
1092
+ #
1093
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1094
+ #
1095
+ # @example Basic example
1096
+ # require "google/cloud/data_catalog/v1beta1"
1097
+ #
1098
+ # # Create a client object. The client can be reused for multiple calls.
1099
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
1100
+ #
1101
+ # # Create a request. To set request fields, pass in keyword arguments.
1102
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1103
+ #
1104
+ # # Call the get_iam_policy method.
1105
+ # result = client.get_iam_policy request
1106
+ #
1107
+ # # The returned object is of type Google::Iam::V1::Policy.
1108
+ # p result
1109
+ #
1110
+ def get_iam_policy request, options = nil
1111
+ raise ::ArgumentError, "request must be provided" if request.nil?
1112
+
1113
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1114
+
1115
+ # Converts hash and nil to an options object
1116
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1117
+
1118
+ # Customize the options with defaults
1119
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
1120
+
1121
+ # Set x-goog-api-client and x-goog-user-project headers
1122
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1123
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1124
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
1125
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1126
+
1127
+ header_params = {}
1128
+ if request.resource
1129
+ header_params["resource"] = request.resource
1130
+ end
1131
+
1132
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1133
+ metadata[:"x-goog-request-params"] ||= request_params_header
1134
+
1135
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1136
+ metadata: metadata,
1137
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1138
+
1139
+ options.apply_defaults timeout: @config.timeout,
1140
+ metadata: @config.metadata,
1141
+ retry_policy: @config.retry_policy
1142
+
1143
+ @policy_tag_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1144
+ yield response, operation if block_given?
1145
+ return response
1146
+ end
1147
+ rescue ::GRPC::BadStatus => e
1148
+ raise ::Google::Cloud::Error.from_error(e)
1149
+ end
1150
+
1151
+ ##
1152
+ # Sets the IAM policy for a taxonomy or a policy tag.
1153
+ #
1154
+ # @overload set_iam_policy(request, options = nil)
1155
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1156
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1157
+ #
1158
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1159
+ # A request object representing the call parameters. Required. To specify no
1160
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1161
+ # @param options [::Gapic::CallOptions, ::Hash]
1162
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1163
+ #
1164
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1165
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1166
+ # least one keyword argument is required. To specify no parameters, or to keep all
1167
+ # the default parameter values, pass an empty Hash as a request object (see above).
1168
+ #
1169
+ # @param resource [::String]
1170
+ # REQUIRED: The resource for which the policy is being specified.
1171
+ # See the operation documentation for the appropriate value for this field.
1172
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1173
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1174
+ # the policy is limited to a few 10s of KB. An empty policy is a
1175
+ # valid policy but certain Cloud Platform services (such as Projects)
1176
+ # might reject them.
1177
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1178
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1179
+ # the fields in the mask will be modified. If no mask is provided, the
1180
+ # following default mask is used:
1181
+ #
1182
+ # `paths: "bindings, etag"`
1183
+ #
1184
+ # @yield [response, operation] Access the result along with the RPC operation
1185
+ # @yieldparam response [::Google::Iam::V1::Policy]
1186
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1187
+ #
1188
+ # @return [::Google::Iam::V1::Policy]
1189
+ #
1190
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1191
+ #
1192
+ # @example Basic example
1193
+ # require "google/cloud/data_catalog/v1beta1"
1194
+ #
1195
+ # # Create a client object. The client can be reused for multiple calls.
1196
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
1197
+ #
1198
+ # # Create a request. To set request fields, pass in keyword arguments.
1199
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1200
+ #
1201
+ # # Call the set_iam_policy method.
1202
+ # result = client.set_iam_policy request
1203
+ #
1204
+ # # The returned object is of type Google::Iam::V1::Policy.
1205
+ # p result
1206
+ #
1207
+ def set_iam_policy request, options = nil
1208
+ raise ::ArgumentError, "request must be provided" if request.nil?
1209
+
1210
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1211
+
1212
+ # Converts hash and nil to an options object
1213
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1214
+
1215
+ # Customize the options with defaults
1216
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
1217
+
1218
+ # Set x-goog-api-client and x-goog-user-project headers
1219
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1220
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1221
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
1222
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1223
+
1224
+ header_params = {}
1225
+ if request.resource
1226
+ header_params["resource"] = request.resource
1227
+ end
1228
+
1229
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1230
+ metadata[:"x-goog-request-params"] ||= request_params_header
1231
+
1232
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1233
+ metadata: metadata,
1234
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1235
+
1236
+ options.apply_defaults timeout: @config.timeout,
1237
+ metadata: @config.metadata,
1238
+ retry_policy: @config.retry_policy
1239
+
1240
+ @policy_tag_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1241
+ yield response, operation if block_given?
1242
+ return response
1243
+ end
1244
+ rescue ::GRPC::BadStatus => e
1245
+ raise ::Google::Cloud::Error.from_error(e)
1246
+ end
1247
+
1248
+ ##
1249
+ # Returns the permissions that a caller has on the specified taxonomy or
1250
+ # policy tag.
1251
+ #
1252
+ # @overload test_iam_permissions(request, options = nil)
1253
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1254
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
1255
+ #
1256
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
1257
+ # A request object representing the call parameters. Required. To specify no
1258
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1259
+ # @param options [::Gapic::CallOptions, ::Hash]
1260
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1261
+ #
1262
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
1263
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1264
+ # least one keyword argument is required. To specify no parameters, or to keep all
1265
+ # the default parameter values, pass an empty Hash as a request object (see above).
1266
+ #
1267
+ # @param resource [::String]
1268
+ # REQUIRED: The resource for which the policy detail is being requested.
1269
+ # See the operation documentation for the appropriate value for this field.
1270
+ # @param permissions [::Array<::String>]
1271
+ # The set of permissions to check for the `resource`. Permissions with
1272
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1273
+ # information see
1274
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1275
+ #
1276
+ # @yield [response, operation] Access the result along with the RPC operation
1277
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
1278
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1279
+ #
1280
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1281
+ #
1282
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1283
+ #
1284
+ # @example Basic example
1285
+ # require "google/cloud/data_catalog/v1beta1"
1286
+ #
1287
+ # # Create a client object. The client can be reused for multiple calls.
1288
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
1289
+ #
1290
+ # # Create a request. To set request fields, pass in keyword arguments.
1291
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1292
+ #
1293
+ # # Call the test_iam_permissions method.
1294
+ # result = client.test_iam_permissions request
1295
+ #
1296
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1297
+ # p result
1298
+ #
1299
+ def test_iam_permissions request, options = nil
1300
+ raise ::ArgumentError, "request must be provided" if request.nil?
1301
+
1302
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1303
+
1304
+ # Converts hash and nil to an options object
1305
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1306
+
1307
+ # Customize the options with defaults
1308
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1309
+
1310
+ # Set x-goog-api-client and x-goog-user-project headers
1311
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1312
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1313
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
1314
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1315
+
1316
+ header_params = {}
1317
+ if request.resource
1318
+ header_params["resource"] = request.resource
1319
+ end
1320
+
1321
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1322
+ metadata[:"x-goog-request-params"] ||= request_params_header
1323
+
1324
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1325
+ metadata: metadata,
1326
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1327
+
1328
+ options.apply_defaults timeout: @config.timeout,
1329
+ metadata: @config.metadata,
1330
+ retry_policy: @config.retry_policy
1331
+
1332
+ @policy_tag_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1333
+ yield response, operation if block_given?
1334
+ return response
1335
+ end
1336
+ rescue ::GRPC::BadStatus => e
1337
+ raise ::Google::Cloud::Error.from_error(e)
1338
+ end
1339
+
1340
+ ##
1341
+ # Configuration class for the PolicyTagManager API.
1342
+ #
1343
+ # This class represents the configuration for PolicyTagManager,
1344
+ # providing control over timeouts, retry behavior, logging, transport
1345
+ # parameters, and other low-level controls. Certain parameters can also be
1346
+ # applied individually to specific RPCs. See
1347
+ # {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client::Configuration::Rpcs}
1348
+ # for a list of RPCs that can be configured independently.
1349
+ #
1350
+ # Configuration can be applied globally to all clients, or to a single client
1351
+ # on construction.
1352
+ #
1353
+ # @example
1354
+ #
1355
+ # # Modify the global config, setting the timeout for
1356
+ # # create_taxonomy to 20 seconds,
1357
+ # # and all remaining timeouts to 10 seconds.
1358
+ # ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.configure do |config|
1359
+ # config.timeout = 10.0
1360
+ # config.rpcs.create_taxonomy.timeout = 20.0
1361
+ # end
1362
+ #
1363
+ # # Apply the above configuration only to a new client.
1364
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new do |config|
1365
+ # config.timeout = 10.0
1366
+ # config.rpcs.create_taxonomy.timeout = 20.0
1367
+ # end
1368
+ #
1369
+ # @!attribute [rw] endpoint
1370
+ # The hostname or hostname:port of the service endpoint.
1371
+ # Defaults to `"datacatalog.googleapis.com"`.
1372
+ # @return [::String]
1373
+ # @!attribute [rw] credentials
1374
+ # Credentials to send with calls. You may provide any of the following types:
1375
+ # * (`String`) The path to a service account key file in JSON format
1376
+ # * (`Hash`) A service account key as a Hash
1377
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1378
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1379
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1380
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1381
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1382
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1383
+ # * (`nil`) indicating no credentials
1384
+ # @return [::Object]
1385
+ # @!attribute [rw] scope
1386
+ # The OAuth scopes
1387
+ # @return [::Array<::String>]
1388
+ # @!attribute [rw] lib_name
1389
+ # The library name as recorded in instrumentation and logging
1390
+ # @return [::String]
1391
+ # @!attribute [rw] lib_version
1392
+ # The library version as recorded in instrumentation and logging
1393
+ # @return [::String]
1394
+ # @!attribute [rw] channel_args
1395
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1396
+ # `GRPC::Core::Channel` object is provided as the credential.
1397
+ # @return [::Hash]
1398
+ # @!attribute [rw] interceptors
1399
+ # An array of interceptors that are run before calls are executed.
1400
+ # @return [::Array<::GRPC::ClientInterceptor>]
1401
+ # @!attribute [rw] timeout
1402
+ # The call timeout in seconds.
1403
+ # @return [::Numeric]
1404
+ # @!attribute [rw] metadata
1405
+ # Additional gRPC headers to be sent with the call.
1406
+ # @return [::Hash{::Symbol=>::String}]
1407
+ # @!attribute [rw] retry_policy
1408
+ # The retry policy. The value is a hash with the following keys:
1409
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1410
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1411
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1412
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1413
+ # trigger a retry.
1414
+ # @return [::Hash]
1415
+ # @!attribute [rw] quota_project
1416
+ # A separate project against which to charge quota.
1417
+ # @return [::String]
1418
+ #
1419
+ class Configuration
1420
+ extend ::Gapic::Config
1421
+
1422
+ DEFAULT_ENDPOINT = "datacatalog.googleapis.com"
1423
+
1424
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1425
+ config_attr :credentials, nil do |value|
1426
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1427
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1428
+ allowed.any? { |klass| klass === value }
1429
+ end
1430
+ config_attr :scope, nil, ::String, ::Array, nil
1431
+ config_attr :lib_name, nil, ::String, nil
1432
+ config_attr :lib_version, nil, ::String, nil
1433
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1434
+ config_attr :interceptors, nil, ::Array, nil
1435
+ config_attr :timeout, nil, ::Numeric, nil
1436
+ config_attr :metadata, nil, ::Hash, nil
1437
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1438
+ config_attr :quota_project, nil, ::String, nil
1439
+
1440
+ # @private
1441
+ def initialize parent_config = nil
1442
+ @parent_config = parent_config unless parent_config.nil?
1443
+
1444
+ yield self if block_given?
1445
+ end
1446
+
1447
+ ##
1448
+ # Configurations for individual RPCs
1449
+ # @return [Rpcs]
1450
+ #
1451
+ def rpcs
1452
+ @rpcs ||= begin
1453
+ parent_rpcs = nil
1454
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1455
+ Rpcs.new parent_rpcs
1456
+ end
1457
+ end
1458
+
1459
+ ##
1460
+ # Configuration RPC class for the PolicyTagManager API.
1461
+ #
1462
+ # Includes fields providing the configuration for each RPC in this service.
1463
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1464
+ # the following configuration fields:
1465
+ #
1466
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1467
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1468
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1469
+ # include the following keys:
1470
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1471
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1472
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1473
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1474
+ # trigger a retry.
1475
+ #
1476
+ class Rpcs
1477
+ ##
1478
+ # RPC-specific configuration for `create_taxonomy`
1479
+ # @return [::Gapic::Config::Method]
1480
+ #
1481
+ attr_reader :create_taxonomy
1482
+ ##
1483
+ # RPC-specific configuration for `delete_taxonomy`
1484
+ # @return [::Gapic::Config::Method]
1485
+ #
1486
+ attr_reader :delete_taxonomy
1487
+ ##
1488
+ # RPC-specific configuration for `update_taxonomy`
1489
+ # @return [::Gapic::Config::Method]
1490
+ #
1491
+ attr_reader :update_taxonomy
1492
+ ##
1493
+ # RPC-specific configuration for `list_taxonomies`
1494
+ # @return [::Gapic::Config::Method]
1495
+ #
1496
+ attr_reader :list_taxonomies
1497
+ ##
1498
+ # RPC-specific configuration for `get_taxonomy`
1499
+ # @return [::Gapic::Config::Method]
1500
+ #
1501
+ attr_reader :get_taxonomy
1502
+ ##
1503
+ # RPC-specific configuration for `create_policy_tag`
1504
+ # @return [::Gapic::Config::Method]
1505
+ #
1506
+ attr_reader :create_policy_tag
1507
+ ##
1508
+ # RPC-specific configuration for `delete_policy_tag`
1509
+ # @return [::Gapic::Config::Method]
1510
+ #
1511
+ attr_reader :delete_policy_tag
1512
+ ##
1513
+ # RPC-specific configuration for `update_policy_tag`
1514
+ # @return [::Gapic::Config::Method]
1515
+ #
1516
+ attr_reader :update_policy_tag
1517
+ ##
1518
+ # RPC-specific configuration for `list_policy_tags`
1519
+ # @return [::Gapic::Config::Method]
1520
+ #
1521
+ attr_reader :list_policy_tags
1522
+ ##
1523
+ # RPC-specific configuration for `get_policy_tag`
1524
+ # @return [::Gapic::Config::Method]
1525
+ #
1526
+ attr_reader :get_policy_tag
1527
+ ##
1528
+ # RPC-specific configuration for `get_iam_policy`
1529
+ # @return [::Gapic::Config::Method]
1530
+ #
1531
+ attr_reader :get_iam_policy
1532
+ ##
1533
+ # RPC-specific configuration for `set_iam_policy`
1534
+ # @return [::Gapic::Config::Method]
1535
+ #
1536
+ attr_reader :set_iam_policy
1537
+ ##
1538
+ # RPC-specific configuration for `test_iam_permissions`
1539
+ # @return [::Gapic::Config::Method]
1540
+ #
1541
+ attr_reader :test_iam_permissions
1542
+
1543
+ # @private
1544
+ def initialize parent_rpcs = nil
1545
+ create_taxonomy_config = parent_rpcs.create_taxonomy if parent_rpcs.respond_to? :create_taxonomy
1546
+ @create_taxonomy = ::Gapic::Config::Method.new create_taxonomy_config
1547
+ delete_taxonomy_config = parent_rpcs.delete_taxonomy if parent_rpcs.respond_to? :delete_taxonomy
1548
+ @delete_taxonomy = ::Gapic::Config::Method.new delete_taxonomy_config
1549
+ update_taxonomy_config = parent_rpcs.update_taxonomy if parent_rpcs.respond_to? :update_taxonomy
1550
+ @update_taxonomy = ::Gapic::Config::Method.new update_taxonomy_config
1551
+ list_taxonomies_config = parent_rpcs.list_taxonomies if parent_rpcs.respond_to? :list_taxonomies
1552
+ @list_taxonomies = ::Gapic::Config::Method.new list_taxonomies_config
1553
+ get_taxonomy_config = parent_rpcs.get_taxonomy if parent_rpcs.respond_to? :get_taxonomy
1554
+ @get_taxonomy = ::Gapic::Config::Method.new get_taxonomy_config
1555
+ create_policy_tag_config = parent_rpcs.create_policy_tag if parent_rpcs.respond_to? :create_policy_tag
1556
+ @create_policy_tag = ::Gapic::Config::Method.new create_policy_tag_config
1557
+ delete_policy_tag_config = parent_rpcs.delete_policy_tag if parent_rpcs.respond_to? :delete_policy_tag
1558
+ @delete_policy_tag = ::Gapic::Config::Method.new delete_policy_tag_config
1559
+ update_policy_tag_config = parent_rpcs.update_policy_tag if parent_rpcs.respond_to? :update_policy_tag
1560
+ @update_policy_tag = ::Gapic::Config::Method.new update_policy_tag_config
1561
+ list_policy_tags_config = parent_rpcs.list_policy_tags if parent_rpcs.respond_to? :list_policy_tags
1562
+ @list_policy_tags = ::Gapic::Config::Method.new list_policy_tags_config
1563
+ get_policy_tag_config = parent_rpcs.get_policy_tag if parent_rpcs.respond_to? :get_policy_tag
1564
+ @get_policy_tag = ::Gapic::Config::Method.new get_policy_tag_config
1565
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1566
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1567
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1568
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1569
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1570
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1571
+
1572
+ yield self if block_given?
1573
+ end
1574
+ end
1575
+ end
1576
+ end
1577
+ end
1578
+ end
1579
+ end
1580
+ end
1581
+ end