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

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 +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,69 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module DataCatalog
23
+ module V1beta1
24
+ module PolicyTagManagerSerialization
25
+ # Path helper methods for the PolicyTagManagerSerialization API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Location resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ #
37
+ # @return [::String]
38
+ def location_path project:, location:
39
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/locations/#{location}"
42
+ end
43
+
44
+ ##
45
+ # Create a fully-qualified Taxonomy resource string.
46
+ #
47
+ # The resource will be in the following format:
48
+ #
49
+ # `projects/{project}/locations/{location}/taxonomies/{taxonomy}`
50
+ #
51
+ # @param project [String]
52
+ # @param location [String]
53
+ # @param taxonomy [String]
54
+ #
55
+ # @return [::String]
56
+ def taxonomy_path project:, location:, taxonomy:
57
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
58
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
59
+
60
+ "projects/#{project}/locations/#{location}/taxonomies/#{taxonomy}"
61
+ end
62
+
63
+ extend self
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,479 @@
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/policytagmanagerserialization_pb"
21
+ require "google/cloud/data_catalog/v1beta1/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 V1beta1
28
+ module PolicyTagManagerSerialization
29
+ module Rest
30
+ ##
31
+ # REST client for the PolicyTagManagerSerialization service.
32
+ #
33
+ # Policy tag manager serialization API service allows clients to manipulate
34
+ # their taxonomies and policy tags data with serialized format.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :policy_tag_manager_serialization_stub
41
+
42
+ ##
43
+ # Configure the PolicyTagManagerSerialization Client class.
44
+ #
45
+ # See {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all PolicyTagManagerSerialization clients
51
+ # ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::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 PolicyTagManagerSerialization 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::PolicyTagManagerSerialization::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 PolicyTagManagerSerialization REST client object.
101
+ #
102
+ # @example
103
+ #
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.new
106
+ #
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the PolicyTagManagerSerialization 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_serialization_stub = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::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
+ # Imports all taxonomies and their policy tags to a project as new
157
+ # taxonomies.
158
+ #
159
+ # This method provides a bulk taxonomy / policy tag creation using nested
160
+ # proto structure.
161
+ #
162
+ # @overload import_taxonomies(request, options = nil)
163
+ # Pass arguments to `import_taxonomies` via a request object, either of type
164
+ # {::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest} or an equivalent Hash.
165
+ #
166
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest, ::Hash]
167
+ # A request object representing the call parameters. Required. To specify no
168
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
169
+ # @param options [::Gapic::CallOptions, ::Hash]
170
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
171
+ #
172
+ # @overload import_taxonomies(parent: nil, inline_source: nil)
173
+ # Pass arguments to `import_taxonomies` via keyword arguments. Note that at
174
+ # least one keyword argument is required. To specify no parameters, or to keep all
175
+ # the default parameter values, pass an empty Hash as a request object (see above).
176
+ #
177
+ # @param parent [::String]
178
+ # Required. Resource name of project that the imported taxonomies will belong
179
+ # to.
180
+ # @param inline_source [::Google::Cloud::DataCatalog::V1beta1::InlineSource, ::Hash]
181
+ # Inline source used for taxonomies to be imported.
182
+ # @yield [result, operation] Access the result along with the TransportOperation object
183
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
184
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
185
+ #
186
+ # @return [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
187
+ #
188
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
189
+ #
190
+ # @example Basic example
191
+ # require "google/cloud/data_catalog/v1beta1"
192
+ #
193
+ # # Create a client object. The client can be reused for multiple calls.
194
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.new
195
+ #
196
+ # # Create a request. To set request fields, pass in keyword arguments.
197
+ # request = Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest.new
198
+ #
199
+ # # Call the import_taxonomies method.
200
+ # result = client.import_taxonomies request
201
+ #
202
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse.
203
+ # p result
204
+ #
205
+ def import_taxonomies request, options = nil
206
+ raise ::ArgumentError, "request must be provided" if request.nil?
207
+
208
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest
209
+
210
+ # Converts hash and nil to an options object
211
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
212
+
213
+ # Customize the options with defaults
214
+ call_metadata = @config.rpcs.import_taxonomies.metadata.to_h
215
+
216
+ # Set x-goog-api-client and x-goog-user-project headers
217
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
218
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
219
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION,
220
+ transports_version_send: [:rest]
221
+
222
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
223
+
224
+ options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout,
225
+ metadata: call_metadata,
226
+ retry_policy: @config.rpcs.import_taxonomies.retry_policy
227
+
228
+ options.apply_defaults timeout: @config.timeout,
229
+ metadata: @config.metadata,
230
+ retry_policy: @config.retry_policy
231
+
232
+ @policy_tag_manager_serialization_stub.import_taxonomies request, options do |result, operation|
233
+ yield result, operation if block_given?
234
+ return result
235
+ end
236
+ rescue ::Gapic::Rest::Error => e
237
+ raise ::Google::Cloud::Error.from_error(e)
238
+ end
239
+
240
+ ##
241
+ # Exports all taxonomies and their policy tags in a project.
242
+ #
243
+ # This method generates SerializedTaxonomy protos with nested policy tags
244
+ # that can be used as an input for future ImportTaxonomies calls.
245
+ #
246
+ # @overload export_taxonomies(request, options = nil)
247
+ # Pass arguments to `export_taxonomies` via a request object, either of type
248
+ # {::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest} or an equivalent Hash.
249
+ #
250
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest, ::Hash]
251
+ # A request object representing the call parameters. Required. To specify no
252
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
253
+ # @param options [::Gapic::CallOptions, ::Hash]
254
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
255
+ #
256
+ # @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil)
257
+ # Pass arguments to `export_taxonomies` via keyword arguments. Note that at
258
+ # least one keyword argument is required. To specify no parameters, or to keep all
259
+ # the default parameter values, pass an empty Hash as a request object (see above).
260
+ #
261
+ # @param parent [::String]
262
+ # Required. Resource name of the project that taxonomies to be exported
263
+ # will share.
264
+ # @param taxonomies [::Array<::String>]
265
+ # Required. Resource names of the taxonomies to be exported.
266
+ # @param serialized_taxonomies [::Boolean]
267
+ # Export taxonomies as serialized taxonomies.
268
+ # @yield [result, operation] Access the result along with the TransportOperation object
269
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
270
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
271
+ #
272
+ # @return [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
273
+ #
274
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
275
+ #
276
+ # @example Basic example
277
+ # require "google/cloud/data_catalog/v1beta1"
278
+ #
279
+ # # Create a client object. The client can be reused for multiple calls.
280
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.new
281
+ #
282
+ # # Create a request. To set request fields, pass in keyword arguments.
283
+ # request = Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest.new
284
+ #
285
+ # # Call the export_taxonomies method.
286
+ # result = client.export_taxonomies request
287
+ #
288
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse.
289
+ # p result
290
+ #
291
+ def export_taxonomies request, options = nil
292
+ raise ::ArgumentError, "request must be provided" if request.nil?
293
+
294
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest
295
+
296
+ # Converts hash and nil to an options object
297
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
298
+
299
+ # Customize the options with defaults
300
+ call_metadata = @config.rpcs.export_taxonomies.metadata.to_h
301
+
302
+ # Set x-goog-api-client and x-goog-user-project headers
303
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
304
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
305
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION,
306
+ transports_version_send: [:rest]
307
+
308
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
309
+
310
+ options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout,
311
+ metadata: call_metadata,
312
+ retry_policy: @config.rpcs.export_taxonomies.retry_policy
313
+
314
+ options.apply_defaults timeout: @config.timeout,
315
+ metadata: @config.metadata,
316
+ retry_policy: @config.retry_policy
317
+
318
+ @policy_tag_manager_serialization_stub.export_taxonomies request, options do |result, operation|
319
+ yield result, operation if block_given?
320
+ return result
321
+ end
322
+ rescue ::Gapic::Rest::Error => e
323
+ raise ::Google::Cloud::Error.from_error(e)
324
+ end
325
+
326
+ ##
327
+ # Configuration class for the PolicyTagManagerSerialization REST API.
328
+ #
329
+ # This class represents the configuration for PolicyTagManagerSerialization REST,
330
+ # providing control over timeouts, retry behavior, logging, transport
331
+ # parameters, and other low-level controls. Certain parameters can also be
332
+ # applied individually to specific RPCs. See
333
+ # {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client::Configuration::Rpcs}
334
+ # for a list of RPCs that can be configured independently.
335
+ #
336
+ # Configuration can be applied globally to all clients, or to a single client
337
+ # on construction.
338
+ #
339
+ # @example
340
+ #
341
+ # # Modify the global config, setting the timeout for
342
+ # # import_taxonomies to 20 seconds,
343
+ # # and all remaining timeouts to 10 seconds.
344
+ # ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.configure do |config|
345
+ # config.timeout = 10.0
346
+ # config.rpcs.import_taxonomies.timeout = 20.0
347
+ # end
348
+ #
349
+ # # Apply the above configuration only to a new client.
350
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.new do |config|
351
+ # config.timeout = 10.0
352
+ # config.rpcs.import_taxonomies.timeout = 20.0
353
+ # end
354
+ #
355
+ # @!attribute [rw] endpoint
356
+ # The hostname or hostname:port of the service endpoint.
357
+ # Defaults to `"datacatalog.googleapis.com"`.
358
+ # @return [::String]
359
+ # @!attribute [rw] credentials
360
+ # Credentials to send with calls. You may provide any of the following types:
361
+ # * (`String`) The path to a service account key file in JSON format
362
+ # * (`Hash`) A service account key as a Hash
363
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
364
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
365
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
366
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
367
+ # * (`nil`) indicating no credentials
368
+ # @return [::Object]
369
+ # @!attribute [rw] scope
370
+ # The OAuth scopes
371
+ # @return [::Array<::String>]
372
+ # @!attribute [rw] lib_name
373
+ # The library name as recorded in instrumentation and logging
374
+ # @return [::String]
375
+ # @!attribute [rw] lib_version
376
+ # The library version as recorded in instrumentation and logging
377
+ # @return [::String]
378
+ # @!attribute [rw] timeout
379
+ # The call timeout in seconds.
380
+ # @return [::Numeric]
381
+ # @!attribute [rw] metadata
382
+ # Additional headers to be sent with the call.
383
+ # @return [::Hash{::Symbol=>::String}]
384
+ # @!attribute [rw] retry_policy
385
+ # The retry policy. The value is a hash with the following keys:
386
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
387
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
388
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
389
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
390
+ # trigger a retry.
391
+ # @return [::Hash]
392
+ # @!attribute [rw] quota_project
393
+ # A separate project against which to charge quota.
394
+ # @return [::String]
395
+ #
396
+ class Configuration
397
+ extend ::Gapic::Config
398
+
399
+ DEFAULT_ENDPOINT = "datacatalog.googleapis.com"
400
+
401
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
402
+ config_attr :credentials, nil do |value|
403
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
404
+ allowed.any? { |klass| klass === value }
405
+ end
406
+ config_attr :scope, nil, ::String, ::Array, nil
407
+ config_attr :lib_name, nil, ::String, nil
408
+ config_attr :lib_version, nil, ::String, nil
409
+ config_attr :timeout, nil, ::Numeric, nil
410
+ config_attr :metadata, nil, ::Hash, nil
411
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
412
+ config_attr :quota_project, nil, ::String, nil
413
+
414
+ # @private
415
+ def initialize parent_config = nil
416
+ @parent_config = parent_config unless parent_config.nil?
417
+
418
+ yield self if block_given?
419
+ end
420
+
421
+ ##
422
+ # Configurations for individual RPCs
423
+ # @return [Rpcs]
424
+ #
425
+ def rpcs
426
+ @rpcs ||= begin
427
+ parent_rpcs = nil
428
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
429
+ Rpcs.new parent_rpcs
430
+ end
431
+ end
432
+
433
+ ##
434
+ # Configuration RPC class for the PolicyTagManagerSerialization API.
435
+ #
436
+ # Includes fields providing the configuration for each RPC in this service.
437
+ # Each configuration object is of type `Gapic::Config::Method` and includes
438
+ # the following configuration fields:
439
+ #
440
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
441
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
442
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
443
+ # include the following keys:
444
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
445
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
446
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
447
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
448
+ # trigger a retry.
449
+ #
450
+ class Rpcs
451
+ ##
452
+ # RPC-specific configuration for `import_taxonomies`
453
+ # @return [::Gapic::Config::Method]
454
+ #
455
+ attr_reader :import_taxonomies
456
+ ##
457
+ # RPC-specific configuration for `export_taxonomies`
458
+ # @return [::Gapic::Config::Method]
459
+ #
460
+ attr_reader :export_taxonomies
461
+
462
+ # @private
463
+ def initialize parent_rpcs = nil
464
+ import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies
465
+ @import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config
466
+ export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies
467
+ @export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config
468
+
469
+ yield self if block_given?
470
+ end
471
+ end
472
+ end
473
+ end
474
+ end
475
+ end
476
+ end
477
+ end
478
+ end
479
+ end