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