google-cloud-metastore-v1beta 0.1.0

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