google-cloud-metastore-v1 0.5.0 → 0.7.0

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