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