google-cloud-data_catalog-v1 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/google/cloud/data_catalog/v1/data_catalog/client.rb +276 -13
  4. data/lib/google/cloud/data_catalog/v1/data_catalog/operations.rb +768 -0
  5. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb +3214 -0
  6. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/operations.rb +792 -0
  7. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb +2142 -0
  8. data/lib/google/cloud/data_catalog/v1/data_catalog/rest.rb +54 -0
  9. data/lib/google/cloud/data_catalog/v1/data_catalog.rb +7 -0
  10. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb +6 -3
  11. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb +1273 -0
  12. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb +846 -0
  13. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest.rb +57 -0
  14. data/lib/google/cloud/data_catalog/v1/policy_tag_manager.rb +6 -0
  15. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb +6 -4
  16. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb +538 -0
  17. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb +227 -0
  18. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest.rb +55 -0
  19. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization.rb +6 -0
  20. data/lib/google/cloud/data_catalog/v1/rest.rb +39 -0
  21. data/lib/google/cloud/data_catalog/v1/version.rb +1 -1
  22. data/lib/google/cloud/data_catalog/v1.rb +5 -0
  23. data/lib/google/cloud/datacatalog/v1/common_pb.rb +8 -0
  24. data/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb +90 -0
  25. data/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb +33 -0
  26. data/lib/google/cloud/datacatalog/v1/dump_content_pb.rb +35 -0
  27. data/lib/google/cloud/datacatalog/v1/policytagmanager_pb.rb +8 -0
  28. data/lib/google/cloud/datacatalog/v1/schema_pb.rb +28 -0
  29. data/lib/google/cloud/datacatalog/v1/usage_pb.rb +6 -0
  30. data/proto_docs/google/api/client.rb +9 -3
  31. data/proto_docs/google/cloud/datacatalog/v1/common.rb +19 -0
  32. data/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb +283 -21
  33. data/proto_docs/google/cloud/datacatalog/v1/dump_content.rb +53 -0
  34. data/proto_docs/google/cloud/datacatalog/v1/gcs_fileset_spec.rb +2 -1
  35. data/proto_docs/google/cloud/datacatalog/v1/policytagmanager.rb +23 -2
  36. data/proto_docs/google/cloud/datacatalog/v1/policytagmanagerserialization.rb +6 -3
  37. data/proto_docs/google/cloud/datacatalog/v1/schema.rb +68 -3
  38. data/proto_docs/google/cloud/datacatalog/v1/search.rb +2 -2
  39. data/proto_docs/google/cloud/datacatalog/v1/table_spec.rb +5 -5
  40. data/proto_docs/google/cloud/datacatalog/v1/tags.rb +11 -8
  41. data/proto_docs/google/cloud/datacatalog/v1/usage.rb +30 -1
  42. data/proto_docs/google/longrunning/operations.rb +164 -0
  43. data/proto_docs/google/protobuf/any.rb +141 -0
  44. data/proto_docs/google/rpc/status.rb +48 -0
  45. metadata +23 -5
@@ -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
@@ -288,7 +288,8 @@ module Google
288
288
  # the default parameter values, pass an empty Hash as a request object (see above).
289
289
  #
290
290
  # @param parent [::String]
291
- # Required. Resource name of project that the imported taxonomies will belong to.
291
+ # Required. Resource name of project that the imported taxonomies will belong
292
+ # to.
292
293
  # @param inline_source [::Google::Cloud::DataCatalog::V1::InlineSource, ::Hash]
293
294
  # Inline source taxonomy to import.
294
295
  # @param cross_regional_source [::Google::Cloud::DataCatalog::V1::CrossRegionalSource, ::Hash]
@@ -382,7 +383,8 @@ module Google
382
383
  # the default parameter values, pass an empty Hash as a request object (see above).
383
384
  #
384
385
  # @param parent [::String]
385
- # Required. Resource name of the project that the exported taxonomies belong to.
386
+ # Required. Resource name of the project that the exported taxonomies belong
387
+ # to.
386
388
  # @param taxonomies [::Array<::String>]
387
389
  # Required. Resource names of the taxonomies to export.
388
390
  # @param serialized_taxonomies [::Boolean]
@@ -491,9 +493,9 @@ module Google
491
493
  # * (`String`) The path to a service account key file in JSON format
492
494
  # * (`Hash`) A service account key as a Hash
493
495
  # * (`Google::Auth::Credentials`) A googleauth credentials object
494
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
496
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
495
497
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
496
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
498
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
497
499
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
498
500
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
499
501
  # * (`nil`) indicating no credentials
@@ -0,0 +1,538 @@
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
260
+ # to.
261
+ # @param inline_source [::Google::Cloud::DataCatalog::V1::InlineSource, ::Hash]
262
+ # Inline source taxonomy to import.
263
+ # @param cross_regional_source [::Google::Cloud::DataCatalog::V1::CrossRegionalSource, ::Hash]
264
+ # Cross-regional source taxonomy to import.
265
+ # @yield [result, operation] Access the result along with the TransportOperation object
266
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse]
267
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
268
+ #
269
+ # @return [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse]
270
+ #
271
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
272
+ def import_taxonomies request, options = nil
273
+ raise ::ArgumentError, "request must be provided" if request.nil?
274
+
275
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest
276
+
277
+ # Converts hash and nil to an options object
278
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
279
+
280
+ # Customize the options with defaults
281
+ call_metadata = @config.rpcs.import_taxonomies.metadata.to_h
282
+
283
+ # Set x-goog-api-client and x-goog-user-project headers
284
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
285
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
286
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
287
+ transports_version_send: [:rest]
288
+
289
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
290
+
291
+ options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout,
292
+ metadata: call_metadata,
293
+ retry_policy: @config.rpcs.import_taxonomies.retry_policy
294
+
295
+ options.apply_defaults timeout: @config.timeout,
296
+ metadata: @config.metadata,
297
+ retry_policy: @config.retry_policy
298
+
299
+ @policy_tag_manager_serialization_stub.import_taxonomies request, options do |result, operation|
300
+ yield result, operation if block_given?
301
+ return result
302
+ end
303
+ rescue ::Gapic::Rest::Error => e
304
+ raise ::Google::Cloud::Error.from_error(e)
305
+ end
306
+
307
+ ##
308
+ # Exports taxonomies in the requested type and returns them,
309
+ # including their policy tags. The requested taxonomies must belong to the
310
+ # same project.
311
+ #
312
+ # This method generates `SerializedTaxonomy` protocol buffers with nested
313
+ # policy tags that can be used as input for `ImportTaxonomies` calls.
314
+ #
315
+ # @overload export_taxonomies(request, options = nil)
316
+ # Pass arguments to `export_taxonomies` via a request object, either of type
317
+ # {::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest} or an equivalent Hash.
318
+ #
319
+ # @param request [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest, ::Hash]
320
+ # A request object representing the call parameters. Required. To specify no
321
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
322
+ # @param options [::Gapic::CallOptions, ::Hash]
323
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
324
+ #
325
+ # @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil)
326
+ # Pass arguments to `export_taxonomies` via keyword arguments. Note that at
327
+ # least one keyword argument is required. To specify no parameters, or to keep all
328
+ # the default parameter values, pass an empty Hash as a request object (see above).
329
+ #
330
+ # @param parent [::String]
331
+ # Required. Resource name of the project that the exported taxonomies belong
332
+ # to.
333
+ # @param taxonomies [::Array<::String>]
334
+ # Required. Resource names of the taxonomies to export.
335
+ # @param serialized_taxonomies [::Boolean]
336
+ # Serialized export taxonomies that contain all the policy
337
+ # tags as nested protocol buffers.
338
+ # @yield [result, operation] Access the result along with the TransportOperation object
339
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse]
340
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
341
+ #
342
+ # @return [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse]
343
+ #
344
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
345
+ def export_taxonomies request, options = nil
346
+ raise ::ArgumentError, "request must be provided" if request.nil?
347
+
348
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest
349
+
350
+ # Converts hash and nil to an options object
351
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
352
+
353
+ # Customize the options with defaults
354
+ call_metadata = @config.rpcs.export_taxonomies.metadata.to_h
355
+
356
+ # Set x-goog-api-client and x-goog-user-project headers
357
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
358
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
359
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
360
+ transports_version_send: [:rest]
361
+
362
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
363
+
364
+ options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout,
365
+ metadata: call_metadata,
366
+ retry_policy: @config.rpcs.export_taxonomies.retry_policy
367
+
368
+ options.apply_defaults timeout: @config.timeout,
369
+ metadata: @config.metadata,
370
+ retry_policy: @config.retry_policy
371
+
372
+ @policy_tag_manager_serialization_stub.export_taxonomies request, options do |result, operation|
373
+ yield result, operation if block_given?
374
+ return result
375
+ end
376
+ rescue ::Gapic::Rest::Error => e
377
+ raise ::Google::Cloud::Error.from_error(e)
378
+ end
379
+
380
+ ##
381
+ # Configuration class for the PolicyTagManagerSerialization REST API.
382
+ #
383
+ # This class represents the configuration for PolicyTagManagerSerialization REST,
384
+ # providing control over timeouts, retry behavior, logging, transport
385
+ # parameters, and other low-level controls. Certain parameters can also be
386
+ # applied individually to specific RPCs. See
387
+ # {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client::Configuration::Rpcs}
388
+ # for a list of RPCs that can be configured independently.
389
+ #
390
+ # Configuration can be applied globally to all clients, or to a single client
391
+ # on construction.
392
+ #
393
+ # @example
394
+ #
395
+ # # Modify the global config, setting the timeout for
396
+ # # replace_taxonomy to 20 seconds,
397
+ # # and all remaining timeouts to 10 seconds.
398
+ # ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.configure do |config|
399
+ # config.timeout = 10.0
400
+ # config.rpcs.replace_taxonomy.timeout = 20.0
401
+ # end
402
+ #
403
+ # # Apply the above configuration only to a new client.
404
+ # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config|
405
+ # config.timeout = 10.0
406
+ # config.rpcs.replace_taxonomy.timeout = 20.0
407
+ # end
408
+ #
409
+ # @!attribute [rw] endpoint
410
+ # The hostname or hostname:port of the service endpoint.
411
+ # Defaults to `"datacatalog.googleapis.com"`.
412
+ # @return [::String]
413
+ # @!attribute [rw] credentials
414
+ # Credentials to send with calls. You may provide any of the following types:
415
+ # * (`String`) The path to a service account key file in JSON format
416
+ # * (`Hash`) A service account key as a Hash
417
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
418
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
419
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
420
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
421
+ # * (`nil`) indicating no credentials
422
+ # @return [::Object]
423
+ # @!attribute [rw] scope
424
+ # The OAuth scopes
425
+ # @return [::Array<::String>]
426
+ # @!attribute [rw] lib_name
427
+ # The library name as recorded in instrumentation and logging
428
+ # @return [::String]
429
+ # @!attribute [rw] lib_version
430
+ # The library version as recorded in instrumentation and logging
431
+ # @return [::String]
432
+ # @!attribute [rw] timeout
433
+ # The call timeout in seconds.
434
+ # @return [::Numeric]
435
+ # @!attribute [rw] metadata
436
+ # Additional headers to be sent with the call.
437
+ # @return [::Hash{::Symbol=>::String}]
438
+ # @!attribute [rw] retry_policy
439
+ # The retry policy. The value is a hash with the following keys:
440
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
441
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
442
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
443
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
444
+ # trigger a retry.
445
+ # @return [::Hash]
446
+ # @!attribute [rw] quota_project
447
+ # A separate project against which to charge quota.
448
+ # @return [::String]
449
+ #
450
+ class Configuration
451
+ extend ::Gapic::Config
452
+
453
+ config_attr :endpoint, "datacatalog.googleapis.com", ::String
454
+ config_attr :credentials, nil do |value|
455
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
456
+ allowed.any? { |klass| klass === value }
457
+ end
458
+ config_attr :scope, nil, ::String, ::Array, nil
459
+ config_attr :lib_name, nil, ::String, nil
460
+ config_attr :lib_version, nil, ::String, nil
461
+ config_attr :timeout, nil, ::Numeric, nil
462
+ config_attr :metadata, nil, ::Hash, nil
463
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
464
+ config_attr :quota_project, nil, ::String, nil
465
+
466
+ # @private
467
+ def initialize parent_config = nil
468
+ @parent_config = parent_config unless parent_config.nil?
469
+
470
+ yield self if block_given?
471
+ end
472
+
473
+ ##
474
+ # Configurations for individual RPCs
475
+ # @return [Rpcs]
476
+ #
477
+ def rpcs
478
+ @rpcs ||= begin
479
+ parent_rpcs = nil
480
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
481
+ Rpcs.new parent_rpcs
482
+ end
483
+ end
484
+
485
+ ##
486
+ # Configuration RPC class for the PolicyTagManagerSerialization API.
487
+ #
488
+ # Includes fields providing the configuration for each RPC in this service.
489
+ # Each configuration object is of type `Gapic::Config::Method` and includes
490
+ # the following configuration fields:
491
+ #
492
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
493
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
494
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
495
+ # include the following keys:
496
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
497
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
498
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
499
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
500
+ # trigger a retry.
501
+ #
502
+ class Rpcs
503
+ ##
504
+ # RPC-specific configuration for `replace_taxonomy`
505
+ # @return [::Gapic::Config::Method]
506
+ #
507
+ attr_reader :replace_taxonomy
508
+ ##
509
+ # RPC-specific configuration for `import_taxonomies`
510
+ # @return [::Gapic::Config::Method]
511
+ #
512
+ attr_reader :import_taxonomies
513
+ ##
514
+ # RPC-specific configuration for `export_taxonomies`
515
+ # @return [::Gapic::Config::Method]
516
+ #
517
+ attr_reader :export_taxonomies
518
+
519
+ # @private
520
+ def initialize parent_rpcs = nil
521
+ replace_taxonomy_config = parent_rpcs.replace_taxonomy if parent_rpcs.respond_to? :replace_taxonomy
522
+ @replace_taxonomy = ::Gapic::Config::Method.new replace_taxonomy_config
523
+ import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies
524
+ @import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config
525
+ export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies
526
+ @export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config
527
+
528
+ yield self if block_given?
529
+ end
530
+ end
531
+ end
532
+ end
533
+ end
534
+ end
535
+ end
536
+ end
537
+ end
538
+ end