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,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,447 @@
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
+ def import_taxonomies request, options = nil
190
+ raise ::ArgumentError, "request must be provided" if request.nil?
191
+
192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest
193
+
194
+ # Converts hash and nil to an options object
195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
196
+
197
+ # Customize the options with defaults
198
+ call_metadata = @config.rpcs.import_taxonomies.metadata.to_h
199
+
200
+ # Set x-goog-api-client and x-goog-user-project headers
201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
203
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION,
204
+ transports_version_send: [:rest]
205
+
206
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
207
+
208
+ options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout,
209
+ metadata: call_metadata,
210
+ retry_policy: @config.rpcs.import_taxonomies.retry_policy
211
+
212
+ options.apply_defaults timeout: @config.timeout,
213
+ metadata: @config.metadata,
214
+ retry_policy: @config.retry_policy
215
+
216
+ @policy_tag_manager_serialization_stub.import_taxonomies request, options do |result, operation|
217
+ yield result, operation if block_given?
218
+ return result
219
+ end
220
+ rescue ::Gapic::Rest::Error => e
221
+ raise ::Google::Cloud::Error.from_error(e)
222
+ end
223
+
224
+ ##
225
+ # Exports all taxonomies and their policy tags in a project.
226
+ #
227
+ # This method generates SerializedTaxonomy protos with nested policy tags
228
+ # that can be used as an input for future ImportTaxonomies calls.
229
+ #
230
+ # @overload export_taxonomies(request, options = nil)
231
+ # Pass arguments to `export_taxonomies` via a request object, either of type
232
+ # {::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest} or an equivalent Hash.
233
+ #
234
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest, ::Hash]
235
+ # A request object representing the call parameters. Required. To specify no
236
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
237
+ # @param options [::Gapic::CallOptions, ::Hash]
238
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
239
+ #
240
+ # @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil)
241
+ # Pass arguments to `export_taxonomies` via keyword arguments. Note that at
242
+ # least one keyword argument is required. To specify no parameters, or to keep all
243
+ # the default parameter values, pass an empty Hash as a request object (see above).
244
+ #
245
+ # @param parent [::String]
246
+ # Required. Resource name of the project that taxonomies to be exported
247
+ # will share.
248
+ # @param taxonomies [::Array<::String>]
249
+ # Required. Resource names of the taxonomies to be exported.
250
+ # @param serialized_taxonomies [::Boolean]
251
+ # Export taxonomies as serialized taxonomies.
252
+ # @yield [result, operation] Access the result along with the TransportOperation object
253
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
254
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
255
+ #
256
+ # @return [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
257
+ #
258
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
259
+ def export_taxonomies request, options = nil
260
+ raise ::ArgumentError, "request must be provided" if request.nil?
261
+
262
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest
263
+
264
+ # Converts hash and nil to an options object
265
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
266
+
267
+ # Customize the options with defaults
268
+ call_metadata = @config.rpcs.export_taxonomies.metadata.to_h
269
+
270
+ # Set x-goog-api-client and x-goog-user-project headers
271
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
272
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
273
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION,
274
+ transports_version_send: [:rest]
275
+
276
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
277
+
278
+ options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout,
279
+ metadata: call_metadata,
280
+ retry_policy: @config.rpcs.export_taxonomies.retry_policy
281
+
282
+ options.apply_defaults timeout: @config.timeout,
283
+ metadata: @config.metadata,
284
+ retry_policy: @config.retry_policy
285
+
286
+ @policy_tag_manager_serialization_stub.export_taxonomies request, options do |result, operation|
287
+ yield result, operation if block_given?
288
+ return result
289
+ end
290
+ rescue ::Gapic::Rest::Error => e
291
+ raise ::Google::Cloud::Error.from_error(e)
292
+ end
293
+
294
+ ##
295
+ # Configuration class for the PolicyTagManagerSerialization REST API.
296
+ #
297
+ # This class represents the configuration for PolicyTagManagerSerialization REST,
298
+ # providing control over timeouts, retry behavior, logging, transport
299
+ # parameters, and other low-level controls. Certain parameters can also be
300
+ # applied individually to specific RPCs. See
301
+ # {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client::Configuration::Rpcs}
302
+ # for a list of RPCs that can be configured independently.
303
+ #
304
+ # Configuration can be applied globally to all clients, or to a single client
305
+ # on construction.
306
+ #
307
+ # @example
308
+ #
309
+ # # Modify the global config, setting the timeout for
310
+ # # import_taxonomies to 20 seconds,
311
+ # # and all remaining timeouts to 10 seconds.
312
+ # ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.configure do |config|
313
+ # config.timeout = 10.0
314
+ # config.rpcs.import_taxonomies.timeout = 20.0
315
+ # end
316
+ #
317
+ # # Apply the above configuration only to a new client.
318
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.new do |config|
319
+ # config.timeout = 10.0
320
+ # config.rpcs.import_taxonomies.timeout = 20.0
321
+ # end
322
+ #
323
+ # @!attribute [rw] endpoint
324
+ # The hostname or hostname:port of the service endpoint.
325
+ # Defaults to `"datacatalog.googleapis.com"`.
326
+ # @return [::String]
327
+ # @!attribute [rw] credentials
328
+ # Credentials to send with calls. You may provide any of the following types:
329
+ # * (`String`) The path to a service account key file in JSON format
330
+ # * (`Hash`) A service account key as a Hash
331
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
332
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
333
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
334
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
335
+ # * (`nil`) indicating no credentials
336
+ # @return [::Object]
337
+ # @!attribute [rw] scope
338
+ # The OAuth scopes
339
+ # @return [::Array<::String>]
340
+ # @!attribute [rw] lib_name
341
+ # The library name as recorded in instrumentation and logging
342
+ # @return [::String]
343
+ # @!attribute [rw] lib_version
344
+ # The library version as recorded in instrumentation and logging
345
+ # @return [::String]
346
+ # @!attribute [rw] timeout
347
+ # The call timeout in seconds.
348
+ # @return [::Numeric]
349
+ # @!attribute [rw] metadata
350
+ # Additional headers to be sent with the call.
351
+ # @return [::Hash{::Symbol=>::String}]
352
+ # @!attribute [rw] retry_policy
353
+ # The retry policy. The value is a hash with the following keys:
354
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
355
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
356
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
357
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
358
+ # trigger a retry.
359
+ # @return [::Hash]
360
+ # @!attribute [rw] quota_project
361
+ # A separate project against which to charge quota.
362
+ # @return [::String]
363
+ #
364
+ class Configuration
365
+ extend ::Gapic::Config
366
+
367
+ DEFAULT_ENDPOINT = "datacatalog.googleapis.com"
368
+
369
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
370
+ config_attr :credentials, nil do |value|
371
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
372
+ allowed.any? { |klass| klass === value }
373
+ end
374
+ config_attr :scope, nil, ::String, ::Array, nil
375
+ config_attr :lib_name, nil, ::String, nil
376
+ config_attr :lib_version, nil, ::String, nil
377
+ config_attr :timeout, nil, ::Numeric, nil
378
+ config_attr :metadata, nil, ::Hash, nil
379
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
380
+ config_attr :quota_project, nil, ::String, nil
381
+
382
+ # @private
383
+ def initialize parent_config = nil
384
+ @parent_config = parent_config unless parent_config.nil?
385
+
386
+ yield self if block_given?
387
+ end
388
+
389
+ ##
390
+ # Configurations for individual RPCs
391
+ # @return [Rpcs]
392
+ #
393
+ def rpcs
394
+ @rpcs ||= begin
395
+ parent_rpcs = nil
396
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
397
+ Rpcs.new parent_rpcs
398
+ end
399
+ end
400
+
401
+ ##
402
+ # Configuration RPC class for the PolicyTagManagerSerialization API.
403
+ #
404
+ # Includes fields providing the configuration for each RPC in this service.
405
+ # Each configuration object is of type `Gapic::Config::Method` and includes
406
+ # the following configuration fields:
407
+ #
408
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
409
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
410
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
411
+ # include the following keys:
412
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
413
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
414
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
415
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
416
+ # trigger a retry.
417
+ #
418
+ class Rpcs
419
+ ##
420
+ # RPC-specific configuration for `import_taxonomies`
421
+ # @return [::Gapic::Config::Method]
422
+ #
423
+ attr_reader :import_taxonomies
424
+ ##
425
+ # RPC-specific configuration for `export_taxonomies`
426
+ # @return [::Gapic::Config::Method]
427
+ #
428
+ attr_reader :export_taxonomies
429
+
430
+ # @private
431
+ def initialize parent_rpcs = nil
432
+ import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies
433
+ @import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config
434
+ export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies
435
+ @export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config
436
+
437
+ yield self if block_given?
438
+ end
439
+ end
440
+ end
441
+ end
442
+ end
443
+ end
444
+ end
445
+ end
446
+ end
447
+ end
@@ -0,0 +1,167 @@
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/datacatalog/v1beta1/policytagmanagerserialization_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DataCatalog
24
+ module V1beta1
25
+ module PolicyTagManagerSerialization
26
+ module Rest
27
+ ##
28
+ # REST service stub for the PolicyTagManagerSerialization service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: false,
40
+ raise_faraday_errors: false
41
+ end
42
+
43
+ ##
44
+ # Baseline implementation for the import_taxonomies REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
56
+ # A result object deserialized from the server's reply
57
+ def import_taxonomies request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_import_taxonomies_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
81
+ ##
82
+ # Baseline implementation for the export_taxonomies REST call
83
+ #
84
+ # @param request_pb [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest]
85
+ # A request object representing the call parameters. Required.
86
+ # @param options [::Gapic::CallOptions]
87
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
88
+ #
89
+ # @yield [result, operation] Access the result along with the TransportOperation object
90
+ # @yieldparam result [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
91
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
92
+ #
93
+ # @return [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
94
+ # A result object deserialized from the server's reply
95
+ def export_taxonomies request_pb, options = nil
96
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
97
+
98
+ verb, uri, query_string_params, body = ServiceStub.transcode_export_taxonomies_request request_pb
99
+ query_string_params = if query_string_params.any?
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
+ else
102
+ {}
103
+ end
104
+
105
+ response = @client_stub.make_http_request(
106
+ verb,
107
+ uri: uri,
108
+ body: body || "",
109
+ params: query_string_params,
110
+ options: options
111
+ )
112
+ operation = ::Gapic::Rest::TransportOperation.new response
113
+ result = ::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse.decode_json response.body, ignore_unknown_fields: true
114
+
115
+ yield result, operation if block_given?
116
+ result
117
+ end
118
+
119
+ ##
120
+ # @private
121
+ #
122
+ # GRPC transcoding helper method for the import_taxonomies REST call
123
+ #
124
+ # @param request_pb [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest]
125
+ # A request object representing the call parameters. Required.
126
+ # @return [Array(String, [String, nil], Hash{String => String})]
127
+ # Uri, Body, Query string parameters
128
+ def self.transcode_import_taxonomies_request request_pb
129
+ transcoder = Gapic::Rest::GrpcTranscoder.new
130
+ .with_bindings(
131
+ uri_method: :post,
132
+ uri_template: "/v1beta1/{parent}/taxonomies:import",
133
+ body: "*",
134
+ matches: [
135
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
136
+ ]
137
+ )
138
+ transcoder.transcode request_pb
139
+ end
140
+
141
+ ##
142
+ # @private
143
+ #
144
+ # GRPC transcoding helper method for the export_taxonomies REST call
145
+ #
146
+ # @param request_pb [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest]
147
+ # A request object representing the call parameters. Required.
148
+ # @return [Array(String, [String, nil], Hash{String => String})]
149
+ # Uri, Body, Query string parameters
150
+ def self.transcode_export_taxonomies_request request_pb
151
+ transcoder = Gapic::Rest::GrpcTranscoder.new
152
+ .with_bindings(
153
+ uri_method: :get,
154
+ uri_template: "/v1beta1/{parent}/taxonomies:export",
155
+ matches: [
156
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
157
+ ]
158
+ )
159
+ transcoder.transcode request_pb
160
+ end
161
+ end
162
+ end
163
+ end
164
+ end
165
+ end
166
+ end
167
+ end