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,53 @@
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/v1beta1/version"
24
+
25
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/credentials"
26
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/paths"
27
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module DataCatalog
32
+ module V1beta1
33
+ ##
34
+ # The policy tag manager API service allows clients to manage their taxonomies
35
+ # and policy tags.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest"
40
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Rest::Client.new
41
+ #
42
+ module PolicyTagManager
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,56 @@
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/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/data_catalog/v1beta1/version"
24
+
25
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/credentials"
26
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/paths"
27
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/client"
28
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest"
29
+
30
+ module Google
31
+ module Cloud
32
+ module DataCatalog
33
+ module V1beta1
34
+ ##
35
+ # The policy tag manager API service allows clients to manage their taxonomies
36
+ # and policy tags.
37
+ #
38
+ # @example Load this service and instantiate a gRPC client
39
+ #
40
+ # require "google/cloud/data_catalog/v1beta1/policy_tag_manager"
41
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
42
+ #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest"
46
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Rest::Client.new
47
+ #
48
+ module PolicyTagManager
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ helper_path = ::File.join __dir__, "policy_tag_manager", "helpers.rb"
56
+ require "google/cloud/data_catalog/v1beta1/policy_tag_manager/helpers" if ::File.file? helper_path
@@ -0,0 +1,513 @@
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/iam/v1"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DataCatalog
26
+ module V1beta1
27
+ module PolicyTagManagerSerialization
28
+ ##
29
+ # Client for the PolicyTagManagerSerialization service.
30
+ #
31
+ # Policy tag manager serialization API service allows clients to manipulate
32
+ # their taxonomies and policy tags data with serialized format.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :policy_tag_manager_serialization_stub
39
+
40
+ ##
41
+ # Configure the PolicyTagManagerSerialization Client class.
42
+ #
43
+ # See {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all PolicyTagManagerSerialization clients
49
+ # ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "DataCatalog", "V1beta1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.timeout = 60.0
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the PolicyTagManagerSerialization Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # Create a new PolicyTagManagerSerialization client object.
99
+ #
100
+ # @example
101
+ #
102
+ # # Create a client using the default configuration
103
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new
104
+ #
105
+ # # Create a client using a custom configuration
106
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new do |config|
107
+ # config.timeout = 10.0
108
+ # end
109
+ #
110
+ # @yield [config] Configure the PolicyTagManagerSerialization client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ def initialize
114
+ # These require statements are intentionally placed here to initialize
115
+ # the gRPC module only when it's required.
116
+ # See https://github.com/googleapis/toolkit/issues/446
117
+ require "gapic/grpc"
118
+ require "google/cloud/datacatalog/v1beta1/policytagmanagerserialization_services_pb"
119
+
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ # Use self-signed JWT if the endpoint is unchanged from default,
129
+ # but only if the default endpoint does not have a region prefix.
130
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
131
+ !@config.endpoint.split(".").first.include?("-")
132
+ credentials ||= Credentials.default scope: @config.scope,
133
+ enable_self_signed_jwt: enable_self_signed_jwt
134
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ end
145
+
146
+ @policy_tag_manager_serialization_stub = ::Gapic::ServiceStub.new(
147
+ ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Stub,
148
+ credentials: credentials,
149
+ endpoint: @config.endpoint,
150
+ channel_args: @config.channel_args,
151
+ interceptors: @config.interceptors
152
+ )
153
+ end
154
+
155
+ ##
156
+ # Get the associated client for mix-in of the IAMPolicy.
157
+ #
158
+ # @return [Google::Iam::V1::IAMPolicy::Client]
159
+ #
160
+ attr_reader :iam_policy_client
161
+
162
+ # Service calls
163
+
164
+ ##
165
+ # Imports all taxonomies and their policy tags to a project as new
166
+ # taxonomies.
167
+ #
168
+ # This method provides a bulk taxonomy / policy tag creation using nested
169
+ # proto structure.
170
+ #
171
+ # @overload import_taxonomies(request, options = nil)
172
+ # Pass arguments to `import_taxonomies` via a request object, either of type
173
+ # {::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest} or an equivalent Hash.
174
+ #
175
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest, ::Hash]
176
+ # A request object representing the call parameters. Required. To specify no
177
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
178
+ # @param options [::Gapic::CallOptions, ::Hash]
179
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
180
+ #
181
+ # @overload import_taxonomies(parent: nil, inline_source: nil)
182
+ # Pass arguments to `import_taxonomies` via keyword arguments. Note that at
183
+ # least one keyword argument is required. To specify no parameters, or to keep all
184
+ # the default parameter values, pass an empty Hash as a request object (see above).
185
+ #
186
+ # @param parent [::String]
187
+ # Required. Resource name of project that the imported taxonomies will belong
188
+ # to.
189
+ # @param inline_source [::Google::Cloud::DataCatalog::V1beta1::InlineSource, ::Hash]
190
+ # Inline source used for taxonomies to be imported.
191
+ #
192
+ # @yield [response, operation] Access the result along with the RPC operation
193
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
194
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
195
+ #
196
+ # @return [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
197
+ #
198
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
199
+ #
200
+ # @example Basic example
201
+ # require "google/cloud/data_catalog/v1beta1"
202
+ #
203
+ # # Create a client object. The client can be reused for multiple calls.
204
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new
205
+ #
206
+ # # Create a request. To set request fields, pass in keyword arguments.
207
+ # request = Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest.new
208
+ #
209
+ # # Call the import_taxonomies method.
210
+ # result = client.import_taxonomies request
211
+ #
212
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse.
213
+ # p result
214
+ #
215
+ def import_taxonomies request, options = nil
216
+ raise ::ArgumentError, "request must be provided" if request.nil?
217
+
218
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest
219
+
220
+ # Converts hash and nil to an options object
221
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
222
+
223
+ # Customize the options with defaults
224
+ metadata = @config.rpcs.import_taxonomies.metadata.to_h
225
+
226
+ # Set x-goog-api-client and x-goog-user-project headers
227
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
228
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
229
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
230
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
+
232
+ header_params = {}
233
+ if request.parent
234
+ header_params["parent"] = request.parent
235
+ end
236
+
237
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
238
+ metadata[:"x-goog-request-params"] ||= request_params_header
239
+
240
+ options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout,
241
+ metadata: metadata,
242
+ retry_policy: @config.rpcs.import_taxonomies.retry_policy
243
+
244
+ options.apply_defaults timeout: @config.timeout,
245
+ metadata: @config.metadata,
246
+ retry_policy: @config.retry_policy
247
+
248
+ @policy_tag_manager_serialization_stub.call_rpc :import_taxonomies, request, options: options do |response, operation|
249
+ yield response, operation if block_given?
250
+ return response
251
+ end
252
+ rescue ::GRPC::BadStatus => e
253
+ raise ::Google::Cloud::Error.from_error(e)
254
+ end
255
+
256
+ ##
257
+ # Exports all taxonomies and their policy tags in a project.
258
+ #
259
+ # This method generates SerializedTaxonomy protos with nested policy tags
260
+ # that can be used as an input for future ImportTaxonomies calls.
261
+ #
262
+ # @overload export_taxonomies(request, options = nil)
263
+ # Pass arguments to `export_taxonomies` via a request object, either of type
264
+ # {::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest} or an equivalent Hash.
265
+ #
266
+ # @param request [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest, ::Hash]
267
+ # A request object representing the call parameters. Required. To specify no
268
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
269
+ # @param options [::Gapic::CallOptions, ::Hash]
270
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
271
+ #
272
+ # @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil)
273
+ # Pass arguments to `export_taxonomies` via keyword arguments. Note that at
274
+ # least one keyword argument is required. To specify no parameters, or to keep all
275
+ # the default parameter values, pass an empty Hash as a request object (see above).
276
+ #
277
+ # @param parent [::String]
278
+ # Required. Resource name of the project that taxonomies to be exported
279
+ # will share.
280
+ # @param taxonomies [::Array<::String>]
281
+ # Required. Resource names of the taxonomies to be exported.
282
+ # @param serialized_taxonomies [::Boolean]
283
+ # Export taxonomies as serialized taxonomies.
284
+ #
285
+ # @yield [response, operation] Access the result along with the RPC operation
286
+ # @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
287
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
288
+ #
289
+ # @return [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
290
+ #
291
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
292
+ #
293
+ # @example Basic example
294
+ # require "google/cloud/data_catalog/v1beta1"
295
+ #
296
+ # # Create a client object. The client can be reused for multiple calls.
297
+ # client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new
298
+ #
299
+ # # Create a request. To set request fields, pass in keyword arguments.
300
+ # request = Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest.new
301
+ #
302
+ # # Call the export_taxonomies method.
303
+ # result = client.export_taxonomies request
304
+ #
305
+ # # The returned object is of type Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse.
306
+ # p result
307
+ #
308
+ def export_taxonomies request, options = nil
309
+ raise ::ArgumentError, "request must be provided" if request.nil?
310
+
311
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest
312
+
313
+ # Converts hash and nil to an options object
314
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
315
+
316
+ # Customize the options with defaults
317
+ metadata = @config.rpcs.export_taxonomies.metadata.to_h
318
+
319
+ # Set x-goog-api-client and x-goog-user-project headers
320
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
321
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
322
+ gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
323
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
324
+
325
+ header_params = {}
326
+ if request.parent
327
+ header_params["parent"] = request.parent
328
+ end
329
+
330
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
331
+ metadata[:"x-goog-request-params"] ||= request_params_header
332
+
333
+ options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout,
334
+ metadata: metadata,
335
+ retry_policy: @config.rpcs.export_taxonomies.retry_policy
336
+
337
+ options.apply_defaults timeout: @config.timeout,
338
+ metadata: @config.metadata,
339
+ retry_policy: @config.retry_policy
340
+
341
+ @policy_tag_manager_serialization_stub.call_rpc :export_taxonomies, request, options: options do |response, operation|
342
+ yield response, operation if block_given?
343
+ return response
344
+ end
345
+ rescue ::GRPC::BadStatus => e
346
+ raise ::Google::Cloud::Error.from_error(e)
347
+ end
348
+
349
+ ##
350
+ # Configuration class for the PolicyTagManagerSerialization API.
351
+ #
352
+ # This class represents the configuration for PolicyTagManagerSerialization,
353
+ # providing control over timeouts, retry behavior, logging, transport
354
+ # parameters, and other low-level controls. Certain parameters can also be
355
+ # applied individually to specific RPCs. See
356
+ # {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client::Configuration::Rpcs}
357
+ # for a list of RPCs that can be configured independently.
358
+ #
359
+ # Configuration can be applied globally to all clients, or to a single client
360
+ # on construction.
361
+ #
362
+ # @example
363
+ #
364
+ # # Modify the global config, setting the timeout for
365
+ # # import_taxonomies to 20 seconds,
366
+ # # and all remaining timeouts to 10 seconds.
367
+ # ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.configure do |config|
368
+ # config.timeout = 10.0
369
+ # config.rpcs.import_taxonomies.timeout = 20.0
370
+ # end
371
+ #
372
+ # # Apply the above configuration only to a new client.
373
+ # client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new do |config|
374
+ # config.timeout = 10.0
375
+ # config.rpcs.import_taxonomies.timeout = 20.0
376
+ # end
377
+ #
378
+ # @!attribute [rw] endpoint
379
+ # The hostname or hostname:port of the service endpoint.
380
+ # Defaults to `"datacatalog.googleapis.com"`.
381
+ # @return [::String]
382
+ # @!attribute [rw] credentials
383
+ # Credentials to send with calls. You may provide any of the following types:
384
+ # * (`String`) The path to a service account key file in JSON format
385
+ # * (`Hash`) A service account key as a Hash
386
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
387
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
388
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
389
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
390
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
391
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
392
+ # * (`nil`) indicating no credentials
393
+ # @return [::Object]
394
+ # @!attribute [rw] scope
395
+ # The OAuth scopes
396
+ # @return [::Array<::String>]
397
+ # @!attribute [rw] lib_name
398
+ # The library name as recorded in instrumentation and logging
399
+ # @return [::String]
400
+ # @!attribute [rw] lib_version
401
+ # The library version as recorded in instrumentation and logging
402
+ # @return [::String]
403
+ # @!attribute [rw] channel_args
404
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
405
+ # `GRPC::Core::Channel` object is provided as the credential.
406
+ # @return [::Hash]
407
+ # @!attribute [rw] interceptors
408
+ # An array of interceptors that are run before calls are executed.
409
+ # @return [::Array<::GRPC::ClientInterceptor>]
410
+ # @!attribute [rw] timeout
411
+ # The call timeout in seconds.
412
+ # @return [::Numeric]
413
+ # @!attribute [rw] metadata
414
+ # Additional gRPC headers to be sent with the call.
415
+ # @return [::Hash{::Symbol=>::String}]
416
+ # @!attribute [rw] retry_policy
417
+ # The retry policy. The value is a hash with the following keys:
418
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
419
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
420
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
421
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
422
+ # trigger a retry.
423
+ # @return [::Hash]
424
+ # @!attribute [rw] quota_project
425
+ # A separate project against which to charge quota.
426
+ # @return [::String]
427
+ #
428
+ class Configuration
429
+ extend ::Gapic::Config
430
+
431
+ DEFAULT_ENDPOINT = "datacatalog.googleapis.com"
432
+
433
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
434
+ config_attr :credentials, nil do |value|
435
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
436
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
437
+ allowed.any? { |klass| klass === value }
438
+ end
439
+ config_attr :scope, nil, ::String, ::Array, nil
440
+ config_attr :lib_name, nil, ::String, nil
441
+ config_attr :lib_version, nil, ::String, nil
442
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
443
+ config_attr :interceptors, nil, ::Array, nil
444
+ config_attr :timeout, nil, ::Numeric, nil
445
+ config_attr :metadata, nil, ::Hash, nil
446
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
447
+ config_attr :quota_project, nil, ::String, nil
448
+
449
+ # @private
450
+ def initialize parent_config = nil
451
+ @parent_config = parent_config unless parent_config.nil?
452
+
453
+ yield self if block_given?
454
+ end
455
+
456
+ ##
457
+ # Configurations for individual RPCs
458
+ # @return [Rpcs]
459
+ #
460
+ def rpcs
461
+ @rpcs ||= begin
462
+ parent_rpcs = nil
463
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
464
+ Rpcs.new parent_rpcs
465
+ end
466
+ end
467
+
468
+ ##
469
+ # Configuration RPC class for the PolicyTagManagerSerialization API.
470
+ #
471
+ # Includes fields providing the configuration for each RPC in this service.
472
+ # Each configuration object is of type `Gapic::Config::Method` and includes
473
+ # the following configuration fields:
474
+ #
475
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
476
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
477
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
478
+ # include the following keys:
479
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
480
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
481
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
482
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
483
+ # trigger a retry.
484
+ #
485
+ class Rpcs
486
+ ##
487
+ # RPC-specific configuration for `import_taxonomies`
488
+ # @return [::Gapic::Config::Method]
489
+ #
490
+ attr_reader :import_taxonomies
491
+ ##
492
+ # RPC-specific configuration for `export_taxonomies`
493
+ # @return [::Gapic::Config::Method]
494
+ #
495
+ attr_reader :export_taxonomies
496
+
497
+ # @private
498
+ def initialize parent_rpcs = nil
499
+ import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies
500
+ @import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config
501
+ export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies
502
+ @export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config
503
+
504
+ yield self if block_given?
505
+ end
506
+ end
507
+ end
508
+ end
509
+ end
510
+ end
511
+ end
512
+ end
513
+ end
@@ -0,0 +1,47 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DataCatalog
24
+ module V1beta1
25
+ module PolicyTagManagerSerialization
26
+ # Credentials for the PolicyTagManagerSerialization API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end