google-cloud-data_catalog-v1 0.13.0 → 0.14.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.
@@ -0,0 +1,57 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/data_catalog/v1/version"
24
+
25
+ require "google/cloud/data_catalog/v1/policy_tag_manager/credentials"
26
+ require "google/cloud/data_catalog/v1/policy_tag_manager/paths"
27
+ require "google/cloud/data_catalog/v1/policy_tag_manager/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module DataCatalog
32
+ module V1
33
+ ##
34
+ # Policy Tag Manager API service allows you to manage your policy tags and
35
+ # taxonomies.
36
+ #
37
+ # Policy tags are used to tag BigQuery columns and apply additional access
38
+ # control policies. A taxonomy is a hierarchical grouping of policy tags that
39
+ # classify data along a common axis.
40
+ #
41
+ # To load this service and instantiate a REST client:
42
+ #
43
+ # require "google/cloud/data_catalog/v1/policy_tag_manager/rest"
44
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new
45
+ #
46
+ module PolicyTagManager
47
+ # Client for the REST transport
48
+ module Rest
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
57
+ require "google/cloud/data_catalog/v1/policy_tag_manager/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/data_catalog/v1/version"
25
25
  require "google/cloud/data_catalog/v1/policy_tag_manager/credentials"
26
26
  require "google/cloud/data_catalog/v1/policy_tag_manager/paths"
27
27
  require "google/cloud/data_catalog/v1/policy_tag_manager/client"
28
+ require "google/cloud/data_catalog/v1/policy_tag_manager/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -43,6 +44,11 @@ module Google
43
44
  # require "google/cloud/data_catalog/v1/policy_tag_manager"
44
45
  # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new
45
46
  #
47
+ # @example Load this service and instantiate a REST client
48
+ #
49
+ # require "google/cloud/data_catalog/v1/policy_tag_manager/rest"
50
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new
51
+ #
46
52
  module PolicyTagManager
47
53
  end
48
54
  end
@@ -0,0 +1,536 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/datacatalog/v1/policytagmanagerserialization_pb"
21
+ require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub"
22
+ require "google/iam/v1/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module DataCatalog
27
+ module V1
28
+ module PolicyTagManagerSerialization
29
+ module Rest
30
+ ##
31
+ # REST client for the PolicyTagManagerSerialization service.
32
+ #
33
+ # Policy Tag Manager Serialization API service allows you to manipulate
34
+ # your policy tags and taxonomies in a serialized format.
35
+ #
36
+ # Taxonomy is a hierarchical group of policy tags.
37
+ #
38
+ class Client
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :policy_tag_manager_serialization_stub
43
+
44
+ ##
45
+ # Configure the PolicyTagManagerSerialization Client class.
46
+ #
47
+ # See {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all PolicyTagManagerSerialization clients
53
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "DataCatalog", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.timeout = 60.0
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the PolicyTagManagerSerialization Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # Create a new PolicyTagManagerSerialization REST client object.
103
+ #
104
+ # @example
105
+ #
106
+ # # Create a client using the default configuration
107
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new
108
+ #
109
+ # # Create a client using a custom configuration
110
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config|
111
+ # config.timeout = 10.0
112
+ # end
113
+ #
114
+ # @yield [config] Configure the PolicyTagManagerSerialization client.
115
+ # @yieldparam config [Client::Configuration]
116
+ #
117
+ def initialize
118
+ # Create the configuration object
119
+ @config = Configuration.new Client.configure
120
+
121
+ # Yield the configuration if needed
122
+ yield @config if block_given?
123
+
124
+ # Create credentials
125
+ credentials = @config.credentials
126
+ # Use self-signed JWT if the endpoint is unchanged from default,
127
+ # but only if the default endpoint does not have a region prefix.
128
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
129
+ !@config.endpoint.split(".").first.include?("-")
130
+ credentials ||= Credentials.default scope: @config.scope,
131
+ enable_self_signed_jwt: enable_self_signed_jwt
132
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
133
+ credentials = Credentials.new credentials, scope: @config.scope
134
+ end
135
+
136
+ @quota_project_id = @config.quota_project
137
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
138
+
139
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
140
+ config.credentials = credentials
141
+ config.quota_project = @quota_project_id
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
145
+ @policy_tag_manager_serialization_stub = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
146
+ end
147
+
148
+ ##
149
+ # Get the associated client for mix-in of the IAMPolicy.
150
+ #
151
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
152
+ #
153
+ attr_reader :iam_policy_client
154
+
155
+ # Service calls
156
+
157
+ ##
158
+ # Replaces (updates) a taxonomy and all its policy tags.
159
+ #
160
+ # The taxonomy and its entire hierarchy of policy tags must be
161
+ # represented literally by `SerializedTaxonomy` and the nested
162
+ # `SerializedPolicyTag` messages.
163
+ #
164
+ # This operation automatically does the following:
165
+ #
166
+ # - Deletes the existing policy tags that are missing from the
167
+ # `SerializedPolicyTag`.
168
+ # - Creates policy tags that don't have resource names. They are considered
169
+ # new.
170
+ # - Updates policy tags with valid resources names accordingly.
171
+ #
172
+ # @overload replace_taxonomy(request, options = nil)
173
+ # Pass arguments to `replace_taxonomy` via a request object, either of type
174
+ # {::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest} or an equivalent Hash.
175
+ #
176
+ # @param request [::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest, ::Hash]
177
+ # A request object representing the call parameters. Required. To specify no
178
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
179
+ # @param options [::Gapic::CallOptions, ::Hash]
180
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
181
+ #
182
+ # @overload replace_taxonomy(name: nil, serialized_taxonomy: nil)
183
+ # Pass arguments to `replace_taxonomy` via keyword arguments. Note that at
184
+ # least one keyword argument is required. To specify no parameters, or to keep all
185
+ # the default parameter values, pass an empty Hash as a request object (see above).
186
+ #
187
+ # @param name [::String]
188
+ # Required. Resource name of the taxonomy to update.
189
+ # @param serialized_taxonomy [::Google::Cloud::DataCatalog::V1::SerializedTaxonomy, ::Hash]
190
+ # Required. Taxonomy to update along with its child policy tags.
191
+ # @yield [result, operation] Access the result along with the TransportOperation object
192
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy]
193
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
194
+ #
195
+ # @return [::Google::Cloud::DataCatalog::V1::Taxonomy]
196
+ #
197
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
198
+ def replace_taxonomy request, options = nil
199
+ raise ::ArgumentError, "request must be provided" if request.nil?
200
+
201
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest
202
+
203
+ # Converts hash and nil to an options object
204
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
205
+
206
+ # Customize the options with defaults
207
+ call_metadata = @config.rpcs.replace_taxonomy.metadata.to_h
208
+
209
+ # Set x-goog-api-client and x-goog-user-project headers
210
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
211
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
212
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
213
+ transports_version_send: [:rest]
214
+
215
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
216
+
217
+ options.apply_defaults timeout: @config.rpcs.replace_taxonomy.timeout,
218
+ metadata: call_metadata,
219
+ retry_policy: @config.rpcs.replace_taxonomy.retry_policy
220
+
221
+ options.apply_defaults timeout: @config.timeout,
222
+ metadata: @config.metadata,
223
+ retry_policy: @config.retry_policy
224
+
225
+ @policy_tag_manager_serialization_stub.replace_taxonomy request, options do |result, operation|
226
+ yield result, operation if block_given?
227
+ return result
228
+ end
229
+ rescue ::Gapic::Rest::Error => e
230
+ raise ::Google::Cloud::Error.from_error(e)
231
+ end
232
+
233
+ ##
234
+ # Creates new taxonomies (including their policy tags) in a given project
235
+ # by importing from inlined or cross-regional sources.
236
+ #
237
+ # For a cross-regional source, new taxonomies are created by copying
238
+ # from a source in another region.
239
+ #
240
+ # For an inlined source, taxonomies and policy tags are created in bulk using
241
+ # nested protocol buffer structures.
242
+ #
243
+ # @overload import_taxonomies(request, options = nil)
244
+ # Pass arguments to `import_taxonomies` via a request object, either of type
245
+ # {::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest} or an equivalent Hash.
246
+ #
247
+ # @param request [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest, ::Hash]
248
+ # A request object representing the call parameters. Required. To specify no
249
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
250
+ # @param options [::Gapic::CallOptions, ::Hash]
251
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
252
+ #
253
+ # @overload import_taxonomies(parent: nil, inline_source: nil, cross_regional_source: nil)
254
+ # Pass arguments to `import_taxonomies` via keyword arguments. Note that at
255
+ # least one keyword argument is required. To specify no parameters, or to keep all
256
+ # the default parameter values, pass an empty Hash as a request object (see above).
257
+ #
258
+ # @param parent [::String]
259
+ # Required. Resource name of project that the imported taxonomies will belong to.
260
+ # @param inline_source [::Google::Cloud::DataCatalog::V1::InlineSource, ::Hash]
261
+ # Inline source taxonomy to import.
262
+ # @param cross_regional_source [::Google::Cloud::DataCatalog::V1::CrossRegionalSource, ::Hash]
263
+ # Cross-regional source taxonomy to import.
264
+ # @yield [result, operation] Access the result along with the TransportOperation object
265
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse]
266
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
267
+ #
268
+ # @return [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse]
269
+ #
270
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
271
+ def import_taxonomies request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ call_metadata = @config.rpcs.import_taxonomies.metadata.to_h
281
+
282
+ # Set x-goog-api-client and x-goog-user-project headers
283
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
286
+ transports_version_send: [:rest]
287
+
288
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
289
+
290
+ options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout,
291
+ metadata: call_metadata,
292
+ retry_policy: @config.rpcs.import_taxonomies.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @policy_tag_manager_serialization_stub.import_taxonomies request, options do |result, operation|
299
+ yield result, operation if block_given?
300
+ return result
301
+ end
302
+ rescue ::Gapic::Rest::Error => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Exports taxonomies in the requested type and returns them,
308
+ # including their policy tags. The requested taxonomies must belong to the
309
+ # same project.
310
+ #
311
+ # This method generates `SerializedTaxonomy` protocol buffers with nested
312
+ # policy tags that can be used as input for `ImportTaxonomies` calls.
313
+ #
314
+ # @overload export_taxonomies(request, options = nil)
315
+ # Pass arguments to `export_taxonomies` via a request object, either of type
316
+ # {::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest} or an equivalent Hash.
317
+ #
318
+ # @param request [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest, ::Hash]
319
+ # A request object representing the call parameters. Required. To specify no
320
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
321
+ # @param options [::Gapic::CallOptions, ::Hash]
322
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
323
+ #
324
+ # @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil)
325
+ # Pass arguments to `export_taxonomies` via keyword arguments. Note that at
326
+ # least one keyword argument is required. To specify no parameters, or to keep all
327
+ # the default parameter values, pass an empty Hash as a request object (see above).
328
+ #
329
+ # @param parent [::String]
330
+ # Required. Resource name of the project that the exported taxonomies belong to.
331
+ # @param taxonomies [::Array<::String>]
332
+ # Required. Resource names of the taxonomies to export.
333
+ # @param serialized_taxonomies [::Boolean]
334
+ # Serialized export taxonomies that contain all the policy
335
+ # tags as nested protocol buffers.
336
+ # @yield [result, operation] Access the result along with the TransportOperation object
337
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse]
338
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
339
+ #
340
+ # @return [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse]
341
+ #
342
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
343
+ def export_taxonomies request, options = nil
344
+ raise ::ArgumentError, "request must be provided" if request.nil?
345
+
346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest
347
+
348
+ # Converts hash and nil to an options object
349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
350
+
351
+ # Customize the options with defaults
352
+ call_metadata = @config.rpcs.export_taxonomies.metadata.to_h
353
+
354
+ # Set x-goog-api-client and x-goog-user-project headers
355
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
357
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
358
+ transports_version_send: [:rest]
359
+
360
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
361
+
362
+ options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout,
363
+ metadata: call_metadata,
364
+ retry_policy: @config.rpcs.export_taxonomies.retry_policy
365
+
366
+ options.apply_defaults timeout: @config.timeout,
367
+ metadata: @config.metadata,
368
+ retry_policy: @config.retry_policy
369
+
370
+ @policy_tag_manager_serialization_stub.export_taxonomies request, options do |result, operation|
371
+ yield result, operation if block_given?
372
+ return result
373
+ end
374
+ rescue ::Gapic::Rest::Error => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Configuration class for the PolicyTagManagerSerialization REST API.
380
+ #
381
+ # This class represents the configuration for PolicyTagManagerSerialization REST,
382
+ # providing control over timeouts, retry behavior, logging, transport
383
+ # parameters, and other low-level controls. Certain parameters can also be
384
+ # applied individually to specific RPCs. See
385
+ # {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client::Configuration::Rpcs}
386
+ # for a list of RPCs that can be configured independently.
387
+ #
388
+ # Configuration can be applied globally to all clients, or to a single client
389
+ # on construction.
390
+ #
391
+ # @example
392
+ #
393
+ # # Modify the global config, setting the timeout for
394
+ # # replace_taxonomy to 20 seconds,
395
+ # # and all remaining timeouts to 10 seconds.
396
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.configure do |config|
397
+ # config.timeout = 10.0
398
+ # config.rpcs.replace_taxonomy.timeout = 20.0
399
+ # end
400
+ #
401
+ # # Apply the above configuration only to a new client.
402
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config|
403
+ # config.timeout = 10.0
404
+ # config.rpcs.replace_taxonomy.timeout = 20.0
405
+ # end
406
+ #
407
+ # @!attribute [rw] endpoint
408
+ # The hostname or hostname:port of the service endpoint.
409
+ # Defaults to `"datacatalog.googleapis.com"`.
410
+ # @return [::String]
411
+ # @!attribute [rw] credentials
412
+ # Credentials to send with calls. You may provide any of the following types:
413
+ # * (`String`) The path to a service account key file in JSON format
414
+ # * (`Hash`) A service account key as a Hash
415
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
416
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
417
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
418
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
419
+ # * (`nil`) indicating no credentials
420
+ # @return [::Object]
421
+ # @!attribute [rw] scope
422
+ # The OAuth scopes
423
+ # @return [::Array<::String>]
424
+ # @!attribute [rw] lib_name
425
+ # The library name as recorded in instrumentation and logging
426
+ # @return [::String]
427
+ # @!attribute [rw] lib_version
428
+ # The library version as recorded in instrumentation and logging
429
+ # @return [::String]
430
+ # @!attribute [rw] timeout
431
+ # The call timeout in seconds.
432
+ # @return [::Numeric]
433
+ # @!attribute [rw] metadata
434
+ # Additional headers to be sent with the call.
435
+ # @return [::Hash{::Symbol=>::String}]
436
+ # @!attribute [rw] retry_policy
437
+ # The retry policy. The value is a hash with the following keys:
438
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
439
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
440
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
441
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
442
+ # trigger a retry.
443
+ # @return [::Hash]
444
+ # @!attribute [rw] quota_project
445
+ # A separate project against which to charge quota.
446
+ # @return [::String]
447
+ #
448
+ class Configuration
449
+ extend ::Gapic::Config
450
+
451
+ config_attr :endpoint, "datacatalog.googleapis.com", ::String
452
+ config_attr :credentials, nil do |value|
453
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
454
+ allowed.any? { |klass| klass === value }
455
+ end
456
+ config_attr :scope, nil, ::String, ::Array, nil
457
+ config_attr :lib_name, nil, ::String, nil
458
+ config_attr :lib_version, nil, ::String, nil
459
+ config_attr :timeout, nil, ::Numeric, nil
460
+ config_attr :metadata, nil, ::Hash, nil
461
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
462
+ config_attr :quota_project, nil, ::String, nil
463
+
464
+ # @private
465
+ def initialize parent_config = nil
466
+ @parent_config = parent_config unless parent_config.nil?
467
+
468
+ yield self if block_given?
469
+ end
470
+
471
+ ##
472
+ # Configurations for individual RPCs
473
+ # @return [Rpcs]
474
+ #
475
+ def rpcs
476
+ @rpcs ||= begin
477
+ parent_rpcs = nil
478
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
479
+ Rpcs.new parent_rpcs
480
+ end
481
+ end
482
+
483
+ ##
484
+ # Configuration RPC class for the PolicyTagManagerSerialization API.
485
+ #
486
+ # Includes fields providing the configuration for each RPC in this service.
487
+ # Each configuration object is of type `Gapic::Config::Method` and includes
488
+ # the following configuration fields:
489
+ #
490
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
491
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
492
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
493
+ # include the following keys:
494
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
495
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
496
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
497
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
498
+ # trigger a retry.
499
+ #
500
+ class Rpcs
501
+ ##
502
+ # RPC-specific configuration for `replace_taxonomy`
503
+ # @return [::Gapic::Config::Method]
504
+ #
505
+ attr_reader :replace_taxonomy
506
+ ##
507
+ # RPC-specific configuration for `import_taxonomies`
508
+ # @return [::Gapic::Config::Method]
509
+ #
510
+ attr_reader :import_taxonomies
511
+ ##
512
+ # RPC-specific configuration for `export_taxonomies`
513
+ # @return [::Gapic::Config::Method]
514
+ #
515
+ attr_reader :export_taxonomies
516
+
517
+ # @private
518
+ def initialize parent_rpcs = nil
519
+ replace_taxonomy_config = parent_rpcs.replace_taxonomy if parent_rpcs.respond_to? :replace_taxonomy
520
+ @replace_taxonomy = ::Gapic::Config::Method.new replace_taxonomy_config
521
+ import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies
522
+ @import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config
523
+ export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies
524
+ @export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config
525
+
526
+ yield self if block_given?
527
+ end
528
+ end
529
+ end
530
+ end
531
+ end
532
+ end
533
+ end
534
+ end
535
+ end
536
+ end