google-cloud-metastore-v1 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1685 @@
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/metastore/v1/metastore_pb"
21
+ require "google/cloud/metastore/v1/dataproc_metastore/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module Metastore
28
+ module V1
29
+ module DataprocMetastore
30
+ module Rest
31
+ ##
32
+ # REST client for the DataprocMetastore service.
33
+ #
34
+ # Configures and manages metastore services.
35
+ # Metastore services are fully managed, highly available, autoscaled,
36
+ # autohealing, OSS-native deployments of technical metadata management
37
+ # software. Each metastore service exposes a network endpoint through which
38
+ # metadata queries are served. Metadata queries can originate from a variety
39
+ # of sources, including Apache Hive, Apache Presto, and Apache Spark.
40
+ #
41
+ # The Dataproc Metastore API defines the following resource model:
42
+ #
43
+ # * The service works with a collection of Google Cloud projects, named:
44
+ # `/projects/*`
45
+ # * Each project has a collection of available locations, named: `/locations/*`
46
+ # (a location must refer to a Google Cloud `region`)
47
+ # * Each location has a collection of services, named: `/services/*`
48
+ # * Dataproc Metastore services are resources with names of the form:
49
+ #
50
+ # `/projects/{project_number}/locations/{location_id}/services/{service_id}`.
51
+ #
52
+ class Client
53
+ include Paths
54
+
55
+ # @private
56
+ attr_reader :dataproc_metastore_stub
57
+
58
+ ##
59
+ # Configure the DataprocMetastore Client class.
60
+ #
61
+ # See {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client::Configuration}
62
+ # for a description of the configuration fields.
63
+ #
64
+ # @example
65
+ #
66
+ # # Modify the configuration for all DataprocMetastore clients
67
+ # ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client.configure do |config|
68
+ # config.timeout = 10.0
69
+ # end
70
+ #
71
+ # @yield [config] Configure the Client client.
72
+ # @yieldparam config [Client::Configuration]
73
+ #
74
+ # @return [Client::Configuration]
75
+ #
76
+ def self.configure
77
+ @configure ||= begin
78
+ namespace = ["Google", "Cloud", "Metastore", "V1"]
79
+ parent_config = while namespace.any?
80
+ parent_name = namespace.join "::"
81
+ parent_const = const_get parent_name
82
+ break parent_const.configure if parent_const.respond_to? :configure
83
+ namespace.pop
84
+ end
85
+ default_config = Client::Configuration.new parent_config
86
+
87
+ default_config.timeout = 60.0
88
+ default_config.retry_policy = {
89
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
90
+ }
91
+
92
+ default_config.rpcs.create_service.timeout = 60.0
93
+
94
+ default_config.rpcs.update_service.timeout = 60.0
95
+
96
+ default_config.rpcs.delete_service.timeout = 60.0
97
+
98
+ default_config.rpcs.create_metadata_import.timeout = 60.0
99
+
100
+ default_config.rpcs.update_metadata_import.timeout = 60.0
101
+
102
+ default_config.rpcs.export_metadata.timeout = 60.0
103
+
104
+ default_config.rpcs.restore_service.timeout = 60.0
105
+
106
+ default_config.rpcs.create_backup.timeout = 60.0
107
+
108
+ default_config.rpcs.delete_backup.timeout = 60.0
109
+
110
+ default_config
111
+ end
112
+ yield @configure if block_given?
113
+ @configure
114
+ end
115
+
116
+ ##
117
+ # Configure the DataprocMetastore Client instance.
118
+ #
119
+ # The configuration is set to the derived mode, meaning that values can be changed,
120
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
121
+ # should be made on {Client.configure}.
122
+ #
123
+ # See {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client::Configuration}
124
+ # for a description of the configuration fields.
125
+ #
126
+ # @yield [config] Configure the Client client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ # @return [Client::Configuration]
130
+ #
131
+ def configure
132
+ yield @config if block_given?
133
+ @config
134
+ end
135
+
136
+ ##
137
+ # Create a new DataprocMetastore REST client object.
138
+ #
139
+ # @example
140
+ #
141
+ # # Create a client using the default configuration
142
+ # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client.new
143
+ #
144
+ # # Create a client using a custom configuration
145
+ # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client.new do |config|
146
+ # config.timeout = 10.0
147
+ # end
148
+ #
149
+ # @yield [config] Configure the DataprocMetastore client.
150
+ # @yieldparam config [Client::Configuration]
151
+ #
152
+ def initialize
153
+ # Create the configuration object
154
+ @config = Configuration.new Client.configure
155
+
156
+ # Yield the configuration if needed
157
+ yield @config if block_given?
158
+
159
+ # Create credentials
160
+ credentials = @config.credentials
161
+ # Use self-signed JWT if the endpoint is unchanged from default,
162
+ # but only if the default endpoint does not have a region prefix.
163
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
164
+ !@config.endpoint.split(".").first.include?("-")
165
+ credentials ||= Credentials.default scope: @config.scope,
166
+ enable_self_signed_jwt: enable_self_signed_jwt
167
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
168
+ credentials = Credentials.new credentials, scope: @config.scope
169
+ end
170
+
171
+ @quota_project_id = @config.quota_project
172
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
173
+
174
+ @operations_client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Operations.new do |config|
175
+ config.credentials = credentials
176
+ config.quota_project = @quota_project_id
177
+ config.endpoint = @config.endpoint
178
+ end
179
+
180
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
181
+ config.credentials = credentials
182
+ config.quota_project = @quota_project_id
183
+ config.endpoint = @config.endpoint
184
+ config.bindings_override = @config.bindings_override
185
+ end
186
+
187
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
188
+ config.credentials = credentials
189
+ config.quota_project = @quota_project_id
190
+ config.endpoint = @config.endpoint
191
+ config.bindings_override = @config.bindings_override
192
+ end
193
+
194
+ @dataproc_metastore_stub = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
195
+ end
196
+
197
+ ##
198
+ # Get the associated client for long-running operations.
199
+ #
200
+ # @return [::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Operations]
201
+ #
202
+ attr_reader :operations_client
203
+
204
+ ##
205
+ # Get the associated client for mix-in of the Locations.
206
+ #
207
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
208
+ #
209
+ attr_reader :location_client
210
+
211
+ ##
212
+ # Get the associated client for mix-in of the IAMPolicy.
213
+ #
214
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
215
+ #
216
+ attr_reader :iam_policy_client
217
+
218
+ # Service calls
219
+
220
+ ##
221
+ # Lists services in a project and location.
222
+ #
223
+ # @overload list_services(request, options = nil)
224
+ # Pass arguments to `list_services` via a request object, either of type
225
+ # {::Google::Cloud::Metastore::V1::ListServicesRequest} or an equivalent Hash.
226
+ #
227
+ # @param request [::Google::Cloud::Metastore::V1::ListServicesRequest, ::Hash]
228
+ # A request object representing the call parameters. Required. To specify no
229
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
230
+ # @param options [::Gapic::CallOptions, ::Hash]
231
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
232
+ #
233
+ # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
234
+ # Pass arguments to `list_services` via keyword arguments. Note that at
235
+ # least one keyword argument is required. To specify no parameters, or to keep all
236
+ # the default parameter values, pass an empty Hash as a request object (see above).
237
+ #
238
+ # @param parent [::String]
239
+ # Required. The relative resource name of the location of metastore services to
240
+ # list, in the following form:
241
+ #
242
+ # `projects/{project_number}/locations/{location_id}`.
243
+ # @param page_size [::Integer]
244
+ # Optional. The maximum number of services to return. The response may contain less
245
+ # than the maximum number. If unspecified, no more than 500 services are
246
+ # returned. The maximum value is 1000; values above 1000 are changed to 1000.
247
+ # @param page_token [::String]
248
+ # Optional. A page token, received from a previous {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client#list_services DataprocMetastore.ListServices}
249
+ # call. Provide this token to retrieve the subsequent page.
250
+ #
251
+ # To retrieve the first page, supply an empty page token.
252
+ #
253
+ # When paginating, other parameters provided to
254
+ # {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client#list_services DataprocMetastore.ListServices} must match the call that provided the
255
+ # page token.
256
+ # @param filter [::String]
257
+ # Optional. The filter to apply to list results.
258
+ # @param order_by [::String]
259
+ # Optional. Specify the ordering of results as described in [Sorting
260
+ # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
261
+ # If not specified, the results will be sorted in the default order.
262
+ # @yield [result, operation] Access the result along with the TransportOperation object
263
+ # @yieldparam result [::Google::Cloud::Metastore::V1::ListServicesResponse]
264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
265
+ #
266
+ # @return [::Google::Cloud::Metastore::V1::ListServicesResponse]
267
+ #
268
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
269
+ def list_services request, options = nil
270
+ raise ::ArgumentError, "request must be provided" if request.nil?
271
+
272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListServicesRequest
273
+
274
+ # Converts hash and nil to an options object
275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
276
+
277
+ # Customize the options with defaults
278
+ call_metadata = @config.rpcs.list_services.metadata.to_h
279
+
280
+ # Set x-goog-api-client and x-goog-user-project headers
281
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
283
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
284
+ transports_version_send: [:rest]
285
+
286
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
288
+ options.apply_defaults timeout: @config.rpcs.list_services.timeout,
289
+ metadata: call_metadata,
290
+ retry_policy: @config.rpcs.list_services.retry_policy
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
294
+ retry_policy: @config.retry_policy
295
+
296
+ @dataproc_metastore_stub.list_services request, options do |result, operation|
297
+ yield result, operation if block_given?
298
+ return result
299
+ end
300
+ rescue ::Gapic::Rest::Error => e
301
+ raise ::Google::Cloud::Error.from_error(e)
302
+ end
303
+
304
+ ##
305
+ # Gets the details of a single service.
306
+ #
307
+ # @overload get_service(request, options = nil)
308
+ # Pass arguments to `get_service` via a request object, either of type
309
+ # {::Google::Cloud::Metastore::V1::GetServiceRequest} or an equivalent Hash.
310
+ #
311
+ # @param request [::Google::Cloud::Metastore::V1::GetServiceRequest, ::Hash]
312
+ # A request object representing the call parameters. Required. To specify no
313
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
314
+ # @param options [::Gapic::CallOptions, ::Hash]
315
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
316
+ #
317
+ # @overload get_service(name: nil)
318
+ # Pass arguments to `get_service` via keyword arguments. Note that at
319
+ # least one keyword argument is required. To specify no parameters, or to keep all
320
+ # the default parameter values, pass an empty Hash as a request object (see above).
321
+ #
322
+ # @param name [::String]
323
+ # Required. The relative resource name of the metastore service to retrieve, in the
324
+ # following form:
325
+ #
326
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}`.
327
+ # @yield [result, operation] Access the result along with the TransportOperation object
328
+ # @yieldparam result [::Google::Cloud::Metastore::V1::Service]
329
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
330
+ #
331
+ # @return [::Google::Cloud::Metastore::V1::Service]
332
+ #
333
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
334
+ def get_service request, options = nil
335
+ raise ::ArgumentError, "request must be provided" if request.nil?
336
+
337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetServiceRequest
338
+
339
+ # Converts hash and nil to an options object
340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
341
+
342
+ # Customize the options with defaults
343
+ call_metadata = @config.rpcs.get_service.metadata.to_h
344
+
345
+ # Set x-goog-api-client and x-goog-user-project headers
346
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
347
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
348
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
349
+ transports_version_send: [:rest]
350
+
351
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
+
353
+ options.apply_defaults timeout: @config.rpcs.get_service.timeout,
354
+ metadata: call_metadata,
355
+ retry_policy: @config.rpcs.get_service.retry_policy
356
+
357
+ options.apply_defaults timeout: @config.timeout,
358
+ metadata: @config.metadata,
359
+ retry_policy: @config.retry_policy
360
+
361
+ @dataproc_metastore_stub.get_service request, options do |result, operation|
362
+ yield result, operation if block_given?
363
+ return result
364
+ end
365
+ rescue ::Gapic::Rest::Error => e
366
+ raise ::Google::Cloud::Error.from_error(e)
367
+ end
368
+
369
+ ##
370
+ # Creates a metastore service in a project and location.
371
+ #
372
+ # @overload create_service(request, options = nil)
373
+ # Pass arguments to `create_service` via a request object, either of type
374
+ # {::Google::Cloud::Metastore::V1::CreateServiceRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::Metastore::V1::CreateServiceRequest, ::Hash]
377
+ # A request object representing the call parameters. Required. To specify no
378
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
379
+ # @param options [::Gapic::CallOptions, ::Hash]
380
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
381
+ #
382
+ # @overload create_service(parent: nil, service_id: nil, service: nil, request_id: nil)
383
+ # Pass arguments to `create_service` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param parent [::String]
388
+ # Required. The relative resource name of the location in which to create a metastore
389
+ # service, in the following form:
390
+ #
391
+ # `projects/{project_number}/locations/{location_id}`.
392
+ # @param service_id [::String]
393
+ # Required. The ID of the metastore service, which is used as the final
394
+ # component of the metastore service's name.
395
+ #
396
+ # This value must be between 2 and 63 characters long inclusive, begin with a
397
+ # letter, end with a letter or number, and consist of alpha-numeric
398
+ # ASCII characters or hyphens.
399
+ # @param service [::Google::Cloud::Metastore::V1::Service, ::Hash]
400
+ # Required. The Metastore service to create. The `name` field is
401
+ # ignored. The ID of the created metastore service must be provided in
402
+ # the request's `service_id` field.
403
+ # @param request_id [::String]
404
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
405
+ # request if it has completed. The server will ignore subsequent requests
406
+ # that provide a duplicate request ID for at least 60 minutes after the first
407
+ # request.
408
+ #
409
+ # For example, if an initial request times out, followed by another request
410
+ # with the same request ID, the server ignores the second request to prevent
411
+ # the creation of duplicate commitments.
412
+ #
413
+ # The request ID must be a valid
414
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
415
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
416
+ # @yield [result, operation] Access the result along with the TransportOperation object
417
+ # @yieldparam result [::Gapic::Operation]
418
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
419
+ #
420
+ # @return [::Gapic::Operation]
421
+ #
422
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
423
+ def create_service request, options = nil
424
+ raise ::ArgumentError, "request must be provided" if request.nil?
425
+
426
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateServiceRequest
427
+
428
+ # Converts hash and nil to an options object
429
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
430
+
431
+ # Customize the options with defaults
432
+ call_metadata = @config.rpcs.create_service.metadata.to_h
433
+
434
+ # Set x-goog-api-client and x-goog-user-project headers
435
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
436
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
437
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
438
+ transports_version_send: [:rest]
439
+
440
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
441
+
442
+ options.apply_defaults timeout: @config.rpcs.create_service.timeout,
443
+ metadata: call_metadata,
444
+ retry_policy: @config.rpcs.create_service.retry_policy
445
+
446
+ options.apply_defaults timeout: @config.timeout,
447
+ metadata: @config.metadata,
448
+ retry_policy: @config.retry_policy
449
+
450
+ @dataproc_metastore_stub.create_service request, options do |result, operation|
451
+ result = ::Gapic::Operation.new result, @operations_client, options: options
452
+ yield result, operation if block_given?
453
+ return result
454
+ end
455
+ rescue ::Gapic::Rest::Error => e
456
+ raise ::Google::Cloud::Error.from_error(e)
457
+ end
458
+
459
+ ##
460
+ # Updates the parameters of a single service.
461
+ #
462
+ # @overload update_service(request, options = nil)
463
+ # Pass arguments to `update_service` via a request object, either of type
464
+ # {::Google::Cloud::Metastore::V1::UpdateServiceRequest} or an equivalent Hash.
465
+ #
466
+ # @param request [::Google::Cloud::Metastore::V1::UpdateServiceRequest, ::Hash]
467
+ # A request object representing the call parameters. Required. To specify no
468
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
469
+ # @param options [::Gapic::CallOptions, ::Hash]
470
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
471
+ #
472
+ # @overload update_service(update_mask: nil, service: nil, request_id: nil)
473
+ # Pass arguments to `update_service` via keyword arguments. Note that at
474
+ # least one keyword argument is required. To specify no parameters, or to keep all
475
+ # the default parameter values, pass an empty Hash as a request object (see above).
476
+ #
477
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
478
+ # Required. A field mask used to specify the fields to be overwritten in the
479
+ # metastore service resource by the update.
480
+ # Fields specified in the `update_mask` are relative to the resource (not
481
+ # to the full request). A field is overwritten if it is in the mask.
482
+ # @param service [::Google::Cloud::Metastore::V1::Service, ::Hash]
483
+ # Required. The metastore service to update. The server only merges fields
484
+ # in the service if they are specified in `update_mask`.
485
+ #
486
+ # The metastore service's `name` field is used to identify the metastore
487
+ # service to be updated.
488
+ # @param request_id [::String]
489
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
490
+ # request if it has completed. The server will ignore subsequent requests
491
+ # that provide a duplicate request ID for at least 60 minutes after the first
492
+ # request.
493
+ #
494
+ # For example, if an initial request times out, followed by another request
495
+ # with the same request ID, the server ignores the second request to prevent
496
+ # the creation of duplicate commitments.
497
+ #
498
+ # The request ID must be a valid
499
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
500
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
501
+ # @yield [result, operation] Access the result along with the TransportOperation object
502
+ # @yieldparam result [::Gapic::Operation]
503
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
504
+ #
505
+ # @return [::Gapic::Operation]
506
+ #
507
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
508
+ def update_service request, options = nil
509
+ raise ::ArgumentError, "request must be provided" if request.nil?
510
+
511
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::UpdateServiceRequest
512
+
513
+ # Converts hash and nil to an options object
514
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
515
+
516
+ # Customize the options with defaults
517
+ call_metadata = @config.rpcs.update_service.metadata.to_h
518
+
519
+ # Set x-goog-api-client and x-goog-user-project headers
520
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
521
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
522
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
523
+ transports_version_send: [:rest]
524
+
525
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
526
+
527
+ options.apply_defaults timeout: @config.rpcs.update_service.timeout,
528
+ metadata: call_metadata,
529
+ retry_policy: @config.rpcs.update_service.retry_policy
530
+
531
+ options.apply_defaults timeout: @config.timeout,
532
+ metadata: @config.metadata,
533
+ retry_policy: @config.retry_policy
534
+
535
+ @dataproc_metastore_stub.update_service request, options do |result, operation|
536
+ result = ::Gapic::Operation.new result, @operations_client, options: options
537
+ yield result, operation if block_given?
538
+ return result
539
+ end
540
+ rescue ::Gapic::Rest::Error => e
541
+ raise ::Google::Cloud::Error.from_error(e)
542
+ end
543
+
544
+ ##
545
+ # Deletes a single service.
546
+ #
547
+ # @overload delete_service(request, options = nil)
548
+ # Pass arguments to `delete_service` via a request object, either of type
549
+ # {::Google::Cloud::Metastore::V1::DeleteServiceRequest} or an equivalent Hash.
550
+ #
551
+ # @param request [::Google::Cloud::Metastore::V1::DeleteServiceRequest, ::Hash]
552
+ # A request object representing the call parameters. Required. To specify no
553
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
554
+ # @param options [::Gapic::CallOptions, ::Hash]
555
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
556
+ #
557
+ # @overload delete_service(name: nil, request_id: nil)
558
+ # Pass arguments to `delete_service` via keyword arguments. Note that at
559
+ # least one keyword argument is required. To specify no parameters, or to keep all
560
+ # the default parameter values, pass an empty Hash as a request object (see above).
561
+ #
562
+ # @param name [::String]
563
+ # Required. The relative resource name of the metastore service to delete, in the
564
+ # following form:
565
+ #
566
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}`.
567
+ # @param request_id [::String]
568
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
569
+ # request if it has completed. The server will ignore subsequent requests
570
+ # that provide a duplicate request ID for at least 60 minutes after the first
571
+ # request.
572
+ #
573
+ # For example, if an initial request times out, followed by another request
574
+ # with the same request ID, the server ignores the second request to prevent
575
+ # the creation of duplicate commitments.
576
+ #
577
+ # The request ID must be a valid
578
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
579
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
580
+ # @yield [result, operation] Access the result along with the TransportOperation object
581
+ # @yieldparam result [::Gapic::Operation]
582
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
583
+ #
584
+ # @return [::Gapic::Operation]
585
+ #
586
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
587
+ def delete_service request, options = nil
588
+ raise ::ArgumentError, "request must be provided" if request.nil?
589
+
590
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::DeleteServiceRequest
591
+
592
+ # Converts hash and nil to an options object
593
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
594
+
595
+ # Customize the options with defaults
596
+ call_metadata = @config.rpcs.delete_service.metadata.to_h
597
+
598
+ # Set x-goog-api-client and x-goog-user-project headers
599
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
600
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
601
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
602
+ transports_version_send: [:rest]
603
+
604
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
605
+
606
+ options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
607
+ metadata: call_metadata,
608
+ retry_policy: @config.rpcs.delete_service.retry_policy
609
+
610
+ options.apply_defaults timeout: @config.timeout,
611
+ metadata: @config.metadata,
612
+ retry_policy: @config.retry_policy
613
+
614
+ @dataproc_metastore_stub.delete_service request, options do |result, operation|
615
+ result = ::Gapic::Operation.new result, @operations_client, options: options
616
+ yield result, operation if block_given?
617
+ return result
618
+ end
619
+ rescue ::Gapic::Rest::Error => e
620
+ raise ::Google::Cloud::Error.from_error(e)
621
+ end
622
+
623
+ ##
624
+ # Lists imports in a service.
625
+ #
626
+ # @overload list_metadata_imports(request, options = nil)
627
+ # Pass arguments to `list_metadata_imports` via a request object, either of type
628
+ # {::Google::Cloud::Metastore::V1::ListMetadataImportsRequest} or an equivalent Hash.
629
+ #
630
+ # @param request [::Google::Cloud::Metastore::V1::ListMetadataImportsRequest, ::Hash]
631
+ # A request object representing the call parameters. Required. To specify no
632
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
633
+ # @param options [::Gapic::CallOptions, ::Hash]
634
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
635
+ #
636
+ # @overload list_metadata_imports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
637
+ # Pass arguments to `list_metadata_imports` via keyword arguments. Note that at
638
+ # least one keyword argument is required. To specify no parameters, or to keep all
639
+ # the default parameter values, pass an empty Hash as a request object (see above).
640
+ #
641
+ # @param parent [::String]
642
+ # Required. The relative resource name of the service whose metadata imports to
643
+ # list, in the following form:
644
+ #
645
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`.
646
+ # @param page_size [::Integer]
647
+ # Optional. The maximum number of imports to return. The response may contain less
648
+ # than the maximum number. If unspecified, no more than 500 imports are
649
+ # returned. The maximum value is 1000; values above 1000 are changed to 1000.
650
+ # @param page_token [::String]
651
+ # Optional. A page token, received from a previous {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client#list_services DataprocMetastore.ListServices}
652
+ # call. Provide this token to retrieve the subsequent page.
653
+ #
654
+ # To retrieve the first page, supply an empty page token.
655
+ #
656
+ # When paginating, other parameters provided to
657
+ # {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client#list_services DataprocMetastore.ListServices} must match the call that provided the
658
+ # page token.
659
+ # @param filter [::String]
660
+ # Optional. The filter to apply to list results.
661
+ # @param order_by [::String]
662
+ # Optional. Specify the ordering of results as described in [Sorting
663
+ # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
664
+ # If not specified, the results will be sorted in the default order.
665
+ # @yield [result, operation] Access the result along with the TransportOperation object
666
+ # @yieldparam result [::Google::Cloud::Metastore::V1::ListMetadataImportsResponse]
667
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
668
+ #
669
+ # @return [::Google::Cloud::Metastore::V1::ListMetadataImportsResponse]
670
+ #
671
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
672
+ def list_metadata_imports request, options = nil
673
+ raise ::ArgumentError, "request must be provided" if request.nil?
674
+
675
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListMetadataImportsRequest
676
+
677
+ # Converts hash and nil to an options object
678
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
679
+
680
+ # Customize the options with defaults
681
+ call_metadata = @config.rpcs.list_metadata_imports.metadata.to_h
682
+
683
+ # Set x-goog-api-client and x-goog-user-project headers
684
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
685
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
686
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
687
+ transports_version_send: [:rest]
688
+
689
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
690
+
691
+ options.apply_defaults timeout: @config.rpcs.list_metadata_imports.timeout,
692
+ metadata: call_metadata,
693
+ retry_policy: @config.rpcs.list_metadata_imports.retry_policy
694
+
695
+ options.apply_defaults timeout: @config.timeout,
696
+ metadata: @config.metadata,
697
+ retry_policy: @config.retry_policy
698
+
699
+ @dataproc_metastore_stub.list_metadata_imports request, options do |result, operation|
700
+ yield result, operation if block_given?
701
+ return result
702
+ end
703
+ rescue ::Gapic::Rest::Error => e
704
+ raise ::Google::Cloud::Error.from_error(e)
705
+ end
706
+
707
+ ##
708
+ # Gets details of a single import.
709
+ #
710
+ # @overload get_metadata_import(request, options = nil)
711
+ # Pass arguments to `get_metadata_import` via a request object, either of type
712
+ # {::Google::Cloud::Metastore::V1::GetMetadataImportRequest} or an equivalent Hash.
713
+ #
714
+ # @param request [::Google::Cloud::Metastore::V1::GetMetadataImportRequest, ::Hash]
715
+ # A request object representing the call parameters. Required. To specify no
716
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
717
+ # @param options [::Gapic::CallOptions, ::Hash]
718
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
719
+ #
720
+ # @overload get_metadata_import(name: nil)
721
+ # Pass arguments to `get_metadata_import` via keyword arguments. Note that at
722
+ # least one keyword argument is required. To specify no parameters, or to keep all
723
+ # the default parameter values, pass an empty Hash as a request object (see above).
724
+ #
725
+ # @param name [::String]
726
+ # Required. The relative resource name of the metadata import to retrieve, in the
727
+ # following form:
728
+ #
729
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`.
730
+ # @yield [result, operation] Access the result along with the TransportOperation object
731
+ # @yieldparam result [::Google::Cloud::Metastore::V1::MetadataImport]
732
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
733
+ #
734
+ # @return [::Google::Cloud::Metastore::V1::MetadataImport]
735
+ #
736
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
737
+ def get_metadata_import request, options = nil
738
+ raise ::ArgumentError, "request must be provided" if request.nil?
739
+
740
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetMetadataImportRequest
741
+
742
+ # Converts hash and nil to an options object
743
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
744
+
745
+ # Customize the options with defaults
746
+ call_metadata = @config.rpcs.get_metadata_import.metadata.to_h
747
+
748
+ # Set x-goog-api-client and x-goog-user-project headers
749
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
750
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
751
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
752
+ transports_version_send: [:rest]
753
+
754
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
755
+
756
+ options.apply_defaults timeout: @config.rpcs.get_metadata_import.timeout,
757
+ metadata: call_metadata,
758
+ retry_policy: @config.rpcs.get_metadata_import.retry_policy
759
+
760
+ options.apply_defaults timeout: @config.timeout,
761
+ metadata: @config.metadata,
762
+ retry_policy: @config.retry_policy
763
+
764
+ @dataproc_metastore_stub.get_metadata_import request, options do |result, operation|
765
+ yield result, operation if block_given?
766
+ return result
767
+ end
768
+ rescue ::Gapic::Rest::Error => e
769
+ raise ::Google::Cloud::Error.from_error(e)
770
+ end
771
+
772
+ ##
773
+ # Creates a new MetadataImport in a given project and location.
774
+ #
775
+ # @overload create_metadata_import(request, options = nil)
776
+ # Pass arguments to `create_metadata_import` via a request object, either of type
777
+ # {::Google::Cloud::Metastore::V1::CreateMetadataImportRequest} or an equivalent Hash.
778
+ #
779
+ # @param request [::Google::Cloud::Metastore::V1::CreateMetadataImportRequest, ::Hash]
780
+ # A request object representing the call parameters. Required. To specify no
781
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
782
+ # @param options [::Gapic::CallOptions, ::Hash]
783
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
784
+ #
785
+ # @overload create_metadata_import(parent: nil, metadata_import_id: nil, metadata_import: nil, request_id: nil)
786
+ # Pass arguments to `create_metadata_import` via keyword arguments. Note that at
787
+ # least one keyword argument is required. To specify no parameters, or to keep all
788
+ # the default parameter values, pass an empty Hash as a request object (see above).
789
+ #
790
+ # @param parent [::String]
791
+ # Required. The relative resource name of the service in which to create a metastore
792
+ # import, in the following form:
793
+ #
794
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}`.
795
+ # @param metadata_import_id [::String]
796
+ # Required. The ID of the metadata import, which is used as the final component of the
797
+ # metadata import's name.
798
+ #
799
+ # This value must be between 1 and 64 characters long, begin with a letter,
800
+ # end with a letter or number, and consist of alpha-numeric ASCII characters
801
+ # or hyphens.
802
+ # @param metadata_import [::Google::Cloud::Metastore::V1::MetadataImport, ::Hash]
803
+ # Required. The metadata import to create. The `name` field is ignored. The ID of the
804
+ # created metadata import must be provided in the request's
805
+ # `metadata_import_id` field.
806
+ # @param request_id [::String]
807
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
808
+ # request if it has completed. The server will ignore subsequent requests
809
+ # that provide a duplicate request ID for at least 60 minutes after the first
810
+ # request.
811
+ #
812
+ # For example, if an initial request times out, followed by another request
813
+ # with the same request ID, the server ignores the second request to prevent
814
+ # the creation of duplicate commitments.
815
+ #
816
+ # The request ID must be a valid
817
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
818
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
819
+ # @yield [result, operation] Access the result along with the TransportOperation object
820
+ # @yieldparam result [::Gapic::Operation]
821
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
822
+ #
823
+ # @return [::Gapic::Operation]
824
+ #
825
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
826
+ def create_metadata_import request, options = nil
827
+ raise ::ArgumentError, "request must be provided" if request.nil?
828
+
829
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateMetadataImportRequest
830
+
831
+ # Converts hash and nil to an options object
832
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
833
+
834
+ # Customize the options with defaults
835
+ call_metadata = @config.rpcs.create_metadata_import.metadata.to_h
836
+
837
+ # Set x-goog-api-client and x-goog-user-project headers
838
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
839
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
840
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
841
+ transports_version_send: [:rest]
842
+
843
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
844
+
845
+ options.apply_defaults timeout: @config.rpcs.create_metadata_import.timeout,
846
+ metadata: call_metadata,
847
+ retry_policy: @config.rpcs.create_metadata_import.retry_policy
848
+
849
+ options.apply_defaults timeout: @config.timeout,
850
+ metadata: @config.metadata,
851
+ retry_policy: @config.retry_policy
852
+
853
+ @dataproc_metastore_stub.create_metadata_import request, options do |result, operation|
854
+ result = ::Gapic::Operation.new result, @operations_client, options: options
855
+ yield result, operation if block_given?
856
+ return result
857
+ end
858
+ rescue ::Gapic::Rest::Error => e
859
+ raise ::Google::Cloud::Error.from_error(e)
860
+ end
861
+
862
+ ##
863
+ # Updates a single import.
864
+ # Only the description field of MetadataImport is supported to be updated.
865
+ #
866
+ # @overload update_metadata_import(request, options = nil)
867
+ # Pass arguments to `update_metadata_import` via a request object, either of type
868
+ # {::Google::Cloud::Metastore::V1::UpdateMetadataImportRequest} or an equivalent Hash.
869
+ #
870
+ # @param request [::Google::Cloud::Metastore::V1::UpdateMetadataImportRequest, ::Hash]
871
+ # A request object representing the call parameters. Required. To specify no
872
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
873
+ # @param options [::Gapic::CallOptions, ::Hash]
874
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
875
+ #
876
+ # @overload update_metadata_import(update_mask: nil, metadata_import: nil, request_id: nil)
877
+ # Pass arguments to `update_metadata_import` via keyword arguments. Note that at
878
+ # least one keyword argument is required. To specify no parameters, or to keep all
879
+ # the default parameter values, pass an empty Hash as a request object (see above).
880
+ #
881
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
882
+ # Required. A field mask used to specify the fields to be overwritten in the
883
+ # metadata import resource by the update.
884
+ # Fields specified in the `update_mask` are relative to the resource (not
885
+ # to the full request). A field is overwritten if it is in the mask.
886
+ # @param metadata_import [::Google::Cloud::Metastore::V1::MetadataImport, ::Hash]
887
+ # Required. The metadata import to update. The server only merges fields
888
+ # in the import if they are specified in `update_mask`.
889
+ #
890
+ # The metadata import's `name` field is used to identify the metastore
891
+ # import to be updated.
892
+ # @param request_id [::String]
893
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
894
+ # request if it has completed. The server will ignore subsequent requests
895
+ # that provide a duplicate request ID for at least 60 minutes after the first
896
+ # request.
897
+ #
898
+ # For example, if an initial request times out, followed by another request
899
+ # with the same request ID, the server ignores the second request to prevent
900
+ # the creation of duplicate commitments.
901
+ #
902
+ # The request ID must be a valid
903
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
904
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
905
+ # @yield [result, operation] Access the result along with the TransportOperation object
906
+ # @yieldparam result [::Gapic::Operation]
907
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
908
+ #
909
+ # @return [::Gapic::Operation]
910
+ #
911
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
912
+ def update_metadata_import request, options = nil
913
+ raise ::ArgumentError, "request must be provided" if request.nil?
914
+
915
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::UpdateMetadataImportRequest
916
+
917
+ # Converts hash and nil to an options object
918
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
919
+
920
+ # Customize the options with defaults
921
+ call_metadata = @config.rpcs.update_metadata_import.metadata.to_h
922
+
923
+ # Set x-goog-api-client and x-goog-user-project headers
924
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
925
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
926
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
927
+ transports_version_send: [:rest]
928
+
929
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
930
+
931
+ options.apply_defaults timeout: @config.rpcs.update_metadata_import.timeout,
932
+ metadata: call_metadata,
933
+ retry_policy: @config.rpcs.update_metadata_import.retry_policy
934
+
935
+ options.apply_defaults timeout: @config.timeout,
936
+ metadata: @config.metadata,
937
+ retry_policy: @config.retry_policy
938
+
939
+ @dataproc_metastore_stub.update_metadata_import request, options do |result, operation|
940
+ result = ::Gapic::Operation.new result, @operations_client, options: options
941
+ yield result, operation if block_given?
942
+ return result
943
+ end
944
+ rescue ::Gapic::Rest::Error => e
945
+ raise ::Google::Cloud::Error.from_error(e)
946
+ end
947
+
948
+ ##
949
+ # Exports metadata from a service.
950
+ #
951
+ # @overload export_metadata(request, options = nil)
952
+ # Pass arguments to `export_metadata` via a request object, either of type
953
+ # {::Google::Cloud::Metastore::V1::ExportMetadataRequest} or an equivalent Hash.
954
+ #
955
+ # @param request [::Google::Cloud::Metastore::V1::ExportMetadataRequest, ::Hash]
956
+ # A request object representing the call parameters. Required. To specify no
957
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
958
+ # @param options [::Gapic::CallOptions, ::Hash]
959
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
960
+ #
961
+ # @overload export_metadata(destination_gcs_folder: nil, service: nil, request_id: nil, database_dump_type: nil)
962
+ # Pass arguments to `export_metadata` via keyword arguments. Note that at
963
+ # least one keyword argument is required. To specify no parameters, or to keep all
964
+ # the default parameter values, pass an empty Hash as a request object (see above).
965
+ #
966
+ # @param destination_gcs_folder [::String]
967
+ # A Cloud Storage URI of a folder, in the format
968
+ # `gs://<bucket_name>/<path_inside_bucket>`. A sub-folder
969
+ # `<export_folder>` containing exported files will be created below it.
970
+ # @param service [::String]
971
+ # Required. The relative resource name of the metastore service to run export, in the
972
+ # following form:
973
+ #
974
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}`.
975
+ # @param request_id [::String]
976
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
977
+ # request if it has completed. The server will ignore subsequent requests
978
+ # that provide a duplicate request ID for at least 60 minutes after the first
979
+ # request.
980
+ #
981
+ # For example, if an initial request times out, followed by another request
982
+ # with the same request ID, the server ignores the second request to prevent
983
+ # the creation of duplicate commitments.
984
+ #
985
+ # The request ID must be a valid
986
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
987
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
988
+ # @param database_dump_type [::Google::Cloud::Metastore::V1::DatabaseDumpSpec::Type]
989
+ # Optional. The type of the database dump. If unspecified, defaults to `MYSQL`.
990
+ # @yield [result, operation] Access the result along with the TransportOperation object
991
+ # @yieldparam result [::Gapic::Operation]
992
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
993
+ #
994
+ # @return [::Gapic::Operation]
995
+ #
996
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
997
+ def export_metadata request, options = nil
998
+ raise ::ArgumentError, "request must be provided" if request.nil?
999
+
1000
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ExportMetadataRequest
1001
+
1002
+ # Converts hash and nil to an options object
1003
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1004
+
1005
+ # Customize the options with defaults
1006
+ call_metadata = @config.rpcs.export_metadata.metadata.to_h
1007
+
1008
+ # Set x-goog-api-client and x-goog-user-project headers
1009
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1010
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1011
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
1012
+ transports_version_send: [:rest]
1013
+
1014
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1015
+
1016
+ options.apply_defaults timeout: @config.rpcs.export_metadata.timeout,
1017
+ metadata: call_metadata,
1018
+ retry_policy: @config.rpcs.export_metadata.retry_policy
1019
+
1020
+ options.apply_defaults timeout: @config.timeout,
1021
+ metadata: @config.metadata,
1022
+ retry_policy: @config.retry_policy
1023
+
1024
+ @dataproc_metastore_stub.export_metadata request, options do |result, operation|
1025
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1026
+ yield result, operation if block_given?
1027
+ return result
1028
+ end
1029
+ rescue ::Gapic::Rest::Error => e
1030
+ raise ::Google::Cloud::Error.from_error(e)
1031
+ end
1032
+
1033
+ ##
1034
+ # Restores a service from a backup.
1035
+ #
1036
+ # @overload restore_service(request, options = nil)
1037
+ # Pass arguments to `restore_service` via a request object, either of type
1038
+ # {::Google::Cloud::Metastore::V1::RestoreServiceRequest} or an equivalent Hash.
1039
+ #
1040
+ # @param request [::Google::Cloud::Metastore::V1::RestoreServiceRequest, ::Hash]
1041
+ # A request object representing the call parameters. Required. To specify no
1042
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1043
+ # @param options [::Gapic::CallOptions, ::Hash]
1044
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1045
+ #
1046
+ # @overload restore_service(service: nil, backup: nil, restore_type: nil, request_id: nil)
1047
+ # Pass arguments to `restore_service` via keyword arguments. Note that at
1048
+ # least one keyword argument is required. To specify no parameters, or to keep all
1049
+ # the default parameter values, pass an empty Hash as a request object (see above).
1050
+ #
1051
+ # @param service [::String]
1052
+ # Required. The relative resource name of the metastore service to run restore, in the
1053
+ # following form:
1054
+ #
1055
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1056
+ # @param backup [::String]
1057
+ # Required. The relative resource name of the metastore service backup to restore
1058
+ # from, in the following form:
1059
+ #
1060
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1061
+ # @param restore_type [::Google::Cloud::Metastore::V1::Restore::RestoreType]
1062
+ # Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`.
1063
+ # @param request_id [::String]
1064
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
1065
+ # request if it has completed. The server will ignore subsequent requests
1066
+ # that provide a duplicate request ID for at least 60 minutes after the first
1067
+ # request.
1068
+ #
1069
+ # For example, if an initial request times out, followed by another request
1070
+ # with the same request ID, the server ignores the second request to prevent
1071
+ # the creation of duplicate commitments.
1072
+ #
1073
+ # The request ID must be a valid
1074
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
1075
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1076
+ # @yield [result, operation] Access the result along with the TransportOperation object
1077
+ # @yieldparam result [::Gapic::Operation]
1078
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1079
+ #
1080
+ # @return [::Gapic::Operation]
1081
+ #
1082
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1083
+ def restore_service request, options = nil
1084
+ raise ::ArgumentError, "request must be provided" if request.nil?
1085
+
1086
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::RestoreServiceRequest
1087
+
1088
+ # Converts hash and nil to an options object
1089
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1090
+
1091
+ # Customize the options with defaults
1092
+ call_metadata = @config.rpcs.restore_service.metadata.to_h
1093
+
1094
+ # Set x-goog-api-client and x-goog-user-project headers
1095
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1096
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1097
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
1098
+ transports_version_send: [:rest]
1099
+
1100
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1101
+
1102
+ options.apply_defaults timeout: @config.rpcs.restore_service.timeout,
1103
+ metadata: call_metadata,
1104
+ retry_policy: @config.rpcs.restore_service.retry_policy
1105
+
1106
+ options.apply_defaults timeout: @config.timeout,
1107
+ metadata: @config.metadata,
1108
+ retry_policy: @config.retry_policy
1109
+
1110
+ @dataproc_metastore_stub.restore_service request, options do |result, operation|
1111
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1112
+ yield result, operation if block_given?
1113
+ return result
1114
+ end
1115
+ rescue ::Gapic::Rest::Error => e
1116
+ raise ::Google::Cloud::Error.from_error(e)
1117
+ end
1118
+
1119
+ ##
1120
+ # Lists backups in a service.
1121
+ #
1122
+ # @overload list_backups(request, options = nil)
1123
+ # Pass arguments to `list_backups` via a request object, either of type
1124
+ # {::Google::Cloud::Metastore::V1::ListBackupsRequest} or an equivalent Hash.
1125
+ #
1126
+ # @param request [::Google::Cloud::Metastore::V1::ListBackupsRequest, ::Hash]
1127
+ # A request object representing the call parameters. Required. To specify no
1128
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1129
+ # @param options [::Gapic::CallOptions, ::Hash]
1130
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1131
+ #
1132
+ # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1133
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
1134
+ # least one keyword argument is required. To specify no parameters, or to keep all
1135
+ # the default parameter values, pass an empty Hash as a request object (see above).
1136
+ #
1137
+ # @param parent [::String]
1138
+ # Required. The relative resource name of the service whose backups to
1139
+ # list, in the following form:
1140
+ #
1141
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
1142
+ # @param page_size [::Integer]
1143
+ # Optional. The maximum number of backups to return. The response may contain less
1144
+ # than the maximum number. If unspecified, no more than 500 backups are
1145
+ # returned. The maximum value is 1000; values above 1000 are changed to 1000.
1146
+ # @param page_token [::String]
1147
+ # Optional. A page token, received from a previous {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client#list_backups DataprocMetastore.ListBackups}
1148
+ # call. Provide this token to retrieve the subsequent page.
1149
+ #
1150
+ # To retrieve the first page, supply an empty page token.
1151
+ #
1152
+ # When paginating, other parameters provided to
1153
+ # {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client#list_backups DataprocMetastore.ListBackups} must match the call that provided the
1154
+ # page token.
1155
+ # @param filter [::String]
1156
+ # Optional. The filter to apply to list results.
1157
+ # @param order_by [::String]
1158
+ # Optional. Specify the ordering of results as described in [Sorting
1159
+ # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
1160
+ # If not specified, the results will be sorted in the default order.
1161
+ # @yield [result, operation] Access the result along with the TransportOperation object
1162
+ # @yieldparam result [::Google::Cloud::Metastore::V1::ListBackupsResponse]
1163
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1164
+ #
1165
+ # @return [::Google::Cloud::Metastore::V1::ListBackupsResponse]
1166
+ #
1167
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1168
+ def list_backups request, options = nil
1169
+ raise ::ArgumentError, "request must be provided" if request.nil?
1170
+
1171
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListBackupsRequest
1172
+
1173
+ # Converts hash and nil to an options object
1174
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1175
+
1176
+ # Customize the options with defaults
1177
+ call_metadata = @config.rpcs.list_backups.metadata.to_h
1178
+
1179
+ # Set x-goog-api-client and x-goog-user-project headers
1180
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1181
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1182
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
1183
+ transports_version_send: [:rest]
1184
+
1185
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1186
+
1187
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
1188
+ metadata: call_metadata,
1189
+ retry_policy: @config.rpcs.list_backups.retry_policy
1190
+
1191
+ options.apply_defaults timeout: @config.timeout,
1192
+ metadata: @config.metadata,
1193
+ retry_policy: @config.retry_policy
1194
+
1195
+ @dataproc_metastore_stub.list_backups request, options do |result, operation|
1196
+ yield result, operation if block_given?
1197
+ return result
1198
+ end
1199
+ rescue ::Gapic::Rest::Error => e
1200
+ raise ::Google::Cloud::Error.from_error(e)
1201
+ end
1202
+
1203
+ ##
1204
+ # Gets details of a single backup.
1205
+ #
1206
+ # @overload get_backup(request, options = nil)
1207
+ # Pass arguments to `get_backup` via a request object, either of type
1208
+ # {::Google::Cloud::Metastore::V1::GetBackupRequest} or an equivalent Hash.
1209
+ #
1210
+ # @param request [::Google::Cloud::Metastore::V1::GetBackupRequest, ::Hash]
1211
+ # A request object representing the call parameters. Required. To specify no
1212
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1213
+ # @param options [::Gapic::CallOptions, ::Hash]
1214
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1215
+ #
1216
+ # @overload get_backup(name: nil)
1217
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
1218
+ # least one keyword argument is required. To specify no parameters, or to keep all
1219
+ # the default parameter values, pass an empty Hash as a request object (see above).
1220
+ #
1221
+ # @param name [::String]
1222
+ # Required. The relative resource name of the backup to retrieve, in the
1223
+ # following form:
1224
+ #
1225
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1226
+ # @yield [result, operation] Access the result along with the TransportOperation object
1227
+ # @yieldparam result [::Google::Cloud::Metastore::V1::Backup]
1228
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1229
+ #
1230
+ # @return [::Google::Cloud::Metastore::V1::Backup]
1231
+ #
1232
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1233
+ def get_backup request, options = nil
1234
+ raise ::ArgumentError, "request must be provided" if request.nil?
1235
+
1236
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetBackupRequest
1237
+
1238
+ # Converts hash and nil to an options object
1239
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1240
+
1241
+ # Customize the options with defaults
1242
+ call_metadata = @config.rpcs.get_backup.metadata.to_h
1243
+
1244
+ # Set x-goog-api-client and x-goog-user-project headers
1245
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1246
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1247
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
1248
+ transports_version_send: [:rest]
1249
+
1250
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1251
+
1252
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
1253
+ metadata: call_metadata,
1254
+ retry_policy: @config.rpcs.get_backup.retry_policy
1255
+
1256
+ options.apply_defaults timeout: @config.timeout,
1257
+ metadata: @config.metadata,
1258
+ retry_policy: @config.retry_policy
1259
+
1260
+ @dataproc_metastore_stub.get_backup request, options do |result, operation|
1261
+ yield result, operation if block_given?
1262
+ return result
1263
+ end
1264
+ rescue ::Gapic::Rest::Error => e
1265
+ raise ::Google::Cloud::Error.from_error(e)
1266
+ end
1267
+
1268
+ ##
1269
+ # Creates a new backup in a given project and location.
1270
+ #
1271
+ # @overload create_backup(request, options = nil)
1272
+ # Pass arguments to `create_backup` via a request object, either of type
1273
+ # {::Google::Cloud::Metastore::V1::CreateBackupRequest} or an equivalent Hash.
1274
+ #
1275
+ # @param request [::Google::Cloud::Metastore::V1::CreateBackupRequest, ::Hash]
1276
+ # A request object representing the call parameters. Required. To specify no
1277
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1278
+ # @param options [::Gapic::CallOptions, ::Hash]
1279
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1280
+ #
1281
+ # @overload create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil)
1282
+ # Pass arguments to `create_backup` via keyword arguments. Note that at
1283
+ # least one keyword argument is required. To specify no parameters, or to keep all
1284
+ # the default parameter values, pass an empty Hash as a request object (see above).
1285
+ #
1286
+ # @param parent [::String]
1287
+ # Required. The relative resource name of the service in which to create a backup
1288
+ # of the following form:
1289
+ #
1290
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}`.
1291
+ # @param backup_id [::String]
1292
+ # Required. The ID of the backup, which is used as the final component of the
1293
+ # backup's name.
1294
+ #
1295
+ # This value must be between 1 and 64 characters long, begin with a letter,
1296
+ # end with a letter or number, and consist of alpha-numeric ASCII characters
1297
+ # or hyphens.
1298
+ # @param backup [::Google::Cloud::Metastore::V1::Backup, ::Hash]
1299
+ # Required. The backup to create. The `name` field is ignored. The ID of the created
1300
+ # backup must be provided in the request's `backup_id` field.
1301
+ # @param request_id [::String]
1302
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
1303
+ # request if it has completed. The server will ignore subsequent requests
1304
+ # that provide a duplicate request ID for at least 60 minutes after the first
1305
+ # request.
1306
+ #
1307
+ # For example, if an initial request times out, followed by another request
1308
+ # with the same request ID, the server ignores the second request to prevent
1309
+ # the creation of duplicate commitments.
1310
+ #
1311
+ # The request ID must be a valid
1312
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1313
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1314
+ # @yield [result, operation] Access the result along with the TransportOperation object
1315
+ # @yieldparam result [::Gapic::Operation]
1316
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1317
+ #
1318
+ # @return [::Gapic::Operation]
1319
+ #
1320
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1321
+ def create_backup request, options = nil
1322
+ raise ::ArgumentError, "request must be provided" if request.nil?
1323
+
1324
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateBackupRequest
1325
+
1326
+ # Converts hash and nil to an options object
1327
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1328
+
1329
+ # Customize the options with defaults
1330
+ call_metadata = @config.rpcs.create_backup.metadata.to_h
1331
+
1332
+ # Set x-goog-api-client and x-goog-user-project headers
1333
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1334
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1335
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
1336
+ transports_version_send: [:rest]
1337
+
1338
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1339
+
1340
+ options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
1341
+ metadata: call_metadata,
1342
+ retry_policy: @config.rpcs.create_backup.retry_policy
1343
+
1344
+ options.apply_defaults timeout: @config.timeout,
1345
+ metadata: @config.metadata,
1346
+ retry_policy: @config.retry_policy
1347
+
1348
+ @dataproc_metastore_stub.create_backup request, options do |result, operation|
1349
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1350
+ yield result, operation if block_given?
1351
+ return result
1352
+ end
1353
+ rescue ::Gapic::Rest::Error => e
1354
+ raise ::Google::Cloud::Error.from_error(e)
1355
+ end
1356
+
1357
+ ##
1358
+ # Deletes a single backup.
1359
+ #
1360
+ # @overload delete_backup(request, options = nil)
1361
+ # Pass arguments to `delete_backup` via a request object, either of type
1362
+ # {::Google::Cloud::Metastore::V1::DeleteBackupRequest} or an equivalent Hash.
1363
+ #
1364
+ # @param request [::Google::Cloud::Metastore::V1::DeleteBackupRequest, ::Hash]
1365
+ # A request object representing the call parameters. Required. To specify no
1366
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1367
+ # @param options [::Gapic::CallOptions, ::Hash]
1368
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1369
+ #
1370
+ # @overload delete_backup(name: nil, request_id: nil)
1371
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
1372
+ # least one keyword argument is required. To specify no parameters, or to keep all
1373
+ # the default parameter values, pass an empty Hash as a request object (see above).
1374
+ #
1375
+ # @param name [::String]
1376
+ # Required. The relative resource name of the backup to delete, in the
1377
+ # following form:
1378
+ #
1379
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1380
+ # @param request_id [::String]
1381
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
1382
+ # request if it has completed. The server will ignore subsequent requests
1383
+ # that provide a duplicate request ID for at least 60 minutes after the first
1384
+ # request.
1385
+ #
1386
+ # For example, if an initial request times out, followed by another request
1387
+ # with the same request ID, the server ignores the second request to prevent
1388
+ # the creation of duplicate commitments.
1389
+ #
1390
+ # The request ID must be a valid
1391
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1392
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1393
+ # @yield [result, operation] Access the result along with the TransportOperation object
1394
+ # @yieldparam result [::Gapic::Operation]
1395
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1396
+ #
1397
+ # @return [::Gapic::Operation]
1398
+ #
1399
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1400
+ def delete_backup request, options = nil
1401
+ raise ::ArgumentError, "request must be provided" if request.nil?
1402
+
1403
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::DeleteBackupRequest
1404
+
1405
+ # Converts hash and nil to an options object
1406
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1407
+
1408
+ # Customize the options with defaults
1409
+ call_metadata = @config.rpcs.delete_backup.metadata.to_h
1410
+
1411
+ # Set x-goog-api-client and x-goog-user-project headers
1412
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1413
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1414
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION,
1415
+ transports_version_send: [:rest]
1416
+
1417
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1418
+
1419
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
1420
+ metadata: call_metadata,
1421
+ retry_policy: @config.rpcs.delete_backup.retry_policy
1422
+
1423
+ options.apply_defaults timeout: @config.timeout,
1424
+ metadata: @config.metadata,
1425
+ retry_policy: @config.retry_policy
1426
+
1427
+ @dataproc_metastore_stub.delete_backup request, options do |result, operation|
1428
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1429
+ yield result, operation if block_given?
1430
+ return result
1431
+ end
1432
+ rescue ::Gapic::Rest::Error => e
1433
+ raise ::Google::Cloud::Error.from_error(e)
1434
+ end
1435
+
1436
+ ##
1437
+ # Configuration class for the DataprocMetastore REST API.
1438
+ #
1439
+ # This class represents the configuration for DataprocMetastore REST,
1440
+ # providing control over timeouts, retry behavior, logging, transport
1441
+ # parameters, and other low-level controls. Certain parameters can also be
1442
+ # applied individually to specific RPCs. See
1443
+ # {::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client::Configuration::Rpcs}
1444
+ # for a list of RPCs that can be configured independently.
1445
+ #
1446
+ # Configuration can be applied globally to all clients, or to a single client
1447
+ # on construction.
1448
+ #
1449
+ # @example
1450
+ #
1451
+ # # Modify the global config, setting the timeout for
1452
+ # # list_services to 20 seconds,
1453
+ # # and all remaining timeouts to 10 seconds.
1454
+ # ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client.configure do |config|
1455
+ # config.timeout = 10.0
1456
+ # config.rpcs.list_services.timeout = 20.0
1457
+ # end
1458
+ #
1459
+ # # Apply the above configuration only to a new client.
1460
+ # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client.new do |config|
1461
+ # config.timeout = 10.0
1462
+ # config.rpcs.list_services.timeout = 20.0
1463
+ # end
1464
+ #
1465
+ # @!attribute [rw] endpoint
1466
+ # The hostname or hostname:port of the service endpoint.
1467
+ # Defaults to `"metastore.googleapis.com"`.
1468
+ # @return [::String]
1469
+ # @!attribute [rw] credentials
1470
+ # Credentials to send with calls. You may provide any of the following types:
1471
+ # * (`String`) The path to a service account key file in JSON format
1472
+ # * (`Hash`) A service account key as a Hash
1473
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1474
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1475
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1476
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1477
+ # * (`nil`) indicating no credentials
1478
+ # @return [::Object]
1479
+ # @!attribute [rw] scope
1480
+ # The OAuth scopes
1481
+ # @return [::Array<::String>]
1482
+ # @!attribute [rw] lib_name
1483
+ # The library name as recorded in instrumentation and logging
1484
+ # @return [::String]
1485
+ # @!attribute [rw] lib_version
1486
+ # The library version as recorded in instrumentation and logging
1487
+ # @return [::String]
1488
+ # @!attribute [rw] timeout
1489
+ # The call timeout in seconds.
1490
+ # @return [::Numeric]
1491
+ # @!attribute [rw] metadata
1492
+ # Additional headers to be sent with the call.
1493
+ # @return [::Hash{::Symbol=>::String}]
1494
+ # @!attribute [rw] retry_policy
1495
+ # The retry policy. The value is a hash with the following keys:
1496
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1497
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1498
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1499
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1500
+ # trigger a retry.
1501
+ # @return [::Hash]
1502
+ # @!attribute [rw] quota_project
1503
+ # A separate project against which to charge quota.
1504
+ # @return [::String]
1505
+ #
1506
+ class Configuration
1507
+ extend ::Gapic::Config
1508
+
1509
+ config_attr :endpoint, "metastore.googleapis.com", ::String
1510
+ config_attr :credentials, nil do |value|
1511
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1512
+ allowed.any? { |klass| klass === value }
1513
+ end
1514
+ config_attr :scope, nil, ::String, ::Array, nil
1515
+ config_attr :lib_name, nil, ::String, nil
1516
+ config_attr :lib_version, nil, ::String, nil
1517
+ config_attr :timeout, nil, ::Numeric, nil
1518
+ config_attr :metadata, nil, ::Hash, nil
1519
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1520
+ config_attr :quota_project, nil, ::String, nil
1521
+
1522
+ # @private
1523
+ # Overrides for http bindings for the RPCs of this service
1524
+ # are only used when this service is used as mixin, and only
1525
+ # by the host service.
1526
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1527
+ config_attr :bindings_override, {}, ::Hash, nil
1528
+
1529
+ # @private
1530
+ def initialize parent_config = nil
1531
+ @parent_config = parent_config unless parent_config.nil?
1532
+
1533
+ yield self if block_given?
1534
+ end
1535
+
1536
+ ##
1537
+ # Configurations for individual RPCs
1538
+ # @return [Rpcs]
1539
+ #
1540
+ def rpcs
1541
+ @rpcs ||= begin
1542
+ parent_rpcs = nil
1543
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1544
+ Rpcs.new parent_rpcs
1545
+ end
1546
+ end
1547
+
1548
+ ##
1549
+ # Configuration RPC class for the DataprocMetastore API.
1550
+ #
1551
+ # Includes fields providing the configuration for each RPC in this service.
1552
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1553
+ # the following configuration fields:
1554
+ #
1555
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1556
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1557
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1558
+ # include the following keys:
1559
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1560
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1561
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1562
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1563
+ # trigger a retry.
1564
+ #
1565
+ class Rpcs
1566
+ ##
1567
+ # RPC-specific configuration for `list_services`
1568
+ # @return [::Gapic::Config::Method]
1569
+ #
1570
+ attr_reader :list_services
1571
+ ##
1572
+ # RPC-specific configuration for `get_service`
1573
+ # @return [::Gapic::Config::Method]
1574
+ #
1575
+ attr_reader :get_service
1576
+ ##
1577
+ # RPC-specific configuration for `create_service`
1578
+ # @return [::Gapic::Config::Method]
1579
+ #
1580
+ attr_reader :create_service
1581
+ ##
1582
+ # RPC-specific configuration for `update_service`
1583
+ # @return [::Gapic::Config::Method]
1584
+ #
1585
+ attr_reader :update_service
1586
+ ##
1587
+ # RPC-specific configuration for `delete_service`
1588
+ # @return [::Gapic::Config::Method]
1589
+ #
1590
+ attr_reader :delete_service
1591
+ ##
1592
+ # RPC-specific configuration for `list_metadata_imports`
1593
+ # @return [::Gapic::Config::Method]
1594
+ #
1595
+ attr_reader :list_metadata_imports
1596
+ ##
1597
+ # RPC-specific configuration for `get_metadata_import`
1598
+ # @return [::Gapic::Config::Method]
1599
+ #
1600
+ attr_reader :get_metadata_import
1601
+ ##
1602
+ # RPC-specific configuration for `create_metadata_import`
1603
+ # @return [::Gapic::Config::Method]
1604
+ #
1605
+ attr_reader :create_metadata_import
1606
+ ##
1607
+ # RPC-specific configuration for `update_metadata_import`
1608
+ # @return [::Gapic::Config::Method]
1609
+ #
1610
+ attr_reader :update_metadata_import
1611
+ ##
1612
+ # RPC-specific configuration for `export_metadata`
1613
+ # @return [::Gapic::Config::Method]
1614
+ #
1615
+ attr_reader :export_metadata
1616
+ ##
1617
+ # RPC-specific configuration for `restore_service`
1618
+ # @return [::Gapic::Config::Method]
1619
+ #
1620
+ attr_reader :restore_service
1621
+ ##
1622
+ # RPC-specific configuration for `list_backups`
1623
+ # @return [::Gapic::Config::Method]
1624
+ #
1625
+ attr_reader :list_backups
1626
+ ##
1627
+ # RPC-specific configuration for `get_backup`
1628
+ # @return [::Gapic::Config::Method]
1629
+ #
1630
+ attr_reader :get_backup
1631
+ ##
1632
+ # RPC-specific configuration for `create_backup`
1633
+ # @return [::Gapic::Config::Method]
1634
+ #
1635
+ attr_reader :create_backup
1636
+ ##
1637
+ # RPC-specific configuration for `delete_backup`
1638
+ # @return [::Gapic::Config::Method]
1639
+ #
1640
+ attr_reader :delete_backup
1641
+
1642
+ # @private
1643
+ def initialize parent_rpcs = nil
1644
+ list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services
1645
+ @list_services = ::Gapic::Config::Method.new list_services_config
1646
+ get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service
1647
+ @get_service = ::Gapic::Config::Method.new get_service_config
1648
+ create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service
1649
+ @create_service = ::Gapic::Config::Method.new create_service_config
1650
+ update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service
1651
+ @update_service = ::Gapic::Config::Method.new update_service_config
1652
+ delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service
1653
+ @delete_service = ::Gapic::Config::Method.new delete_service_config
1654
+ list_metadata_imports_config = parent_rpcs.list_metadata_imports if parent_rpcs.respond_to? :list_metadata_imports
1655
+ @list_metadata_imports = ::Gapic::Config::Method.new list_metadata_imports_config
1656
+ get_metadata_import_config = parent_rpcs.get_metadata_import if parent_rpcs.respond_to? :get_metadata_import
1657
+ @get_metadata_import = ::Gapic::Config::Method.new get_metadata_import_config
1658
+ create_metadata_import_config = parent_rpcs.create_metadata_import if parent_rpcs.respond_to? :create_metadata_import
1659
+ @create_metadata_import = ::Gapic::Config::Method.new create_metadata_import_config
1660
+ update_metadata_import_config = parent_rpcs.update_metadata_import if parent_rpcs.respond_to? :update_metadata_import
1661
+ @update_metadata_import = ::Gapic::Config::Method.new update_metadata_import_config
1662
+ export_metadata_config = parent_rpcs.export_metadata if parent_rpcs.respond_to? :export_metadata
1663
+ @export_metadata = ::Gapic::Config::Method.new export_metadata_config
1664
+ restore_service_config = parent_rpcs.restore_service if parent_rpcs.respond_to? :restore_service
1665
+ @restore_service = ::Gapic::Config::Method.new restore_service_config
1666
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
1667
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
1668
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
1669
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
1670
+ create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
1671
+ @create_backup = ::Gapic::Config::Method.new create_backup_config
1672
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
1673
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
1674
+
1675
+ yield self if block_given?
1676
+ end
1677
+ end
1678
+ end
1679
+ end
1680
+ end
1681
+ end
1682
+ end
1683
+ end
1684
+ end
1685
+ end