google-cloud-gke_backup-v1 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2285 @@
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/gkebackup/v1/gkebackup_pb"
21
+ require "google/cloud/gke_backup/v1/backup_for_gke/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module GkeBackup
26
+ module V1
27
+ module BackupForGKE
28
+ module Rest
29
+ ##
30
+ # REST client for the BackupForGKE service.
31
+ #
32
+ # BackupForGKE allows Kubernetes administrators to configure, execute, and
33
+ # manage backup and restore operations for their GKE clusters.
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :backup_for_gke_stub
40
+
41
+ ##
42
+ # Configure the BackupForGKE Client class.
43
+ #
44
+ # See {::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all BackupForGKE clients
50
+ # ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "GkeBackup", "V1"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.rpcs.create_backup_plan.timeout = 300.0
71
+
72
+ default_config.rpcs.list_backup_plans.timeout = 60.0
73
+ default_config.rpcs.list_backup_plans.retry_policy = {
74
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
75
+ }
76
+
77
+ default_config.rpcs.get_backup_plan.timeout = 60.0
78
+ default_config.rpcs.get_backup_plan.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.update_backup_plan.timeout = 60.0
83
+
84
+ default_config.rpcs.delete_backup_plan.timeout = 60.0
85
+
86
+ default_config.rpcs.create_backup.timeout = 120.0
87
+
88
+ default_config.rpcs.list_backups.timeout = 60.0
89
+ default_config.rpcs.list_backups.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config.rpcs.get_backup.timeout = 60.0
94
+ default_config.rpcs.get_backup.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.update_backup.timeout = 60.0
99
+
100
+ default_config.rpcs.delete_backup.timeout = 300.0
101
+
102
+ default_config.rpcs.list_volume_backups.timeout = 60.0
103
+ default_config.rpcs.list_volume_backups.retry_policy = {
104
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
105
+ }
106
+
107
+ default_config.rpcs.get_volume_backup.timeout = 60.0
108
+ default_config.rpcs.get_volume_backup.retry_policy = {
109
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
110
+ }
111
+
112
+ default_config.rpcs.create_restore_plan.timeout = 120.0
113
+
114
+ default_config.rpcs.list_restore_plans.timeout = 60.0
115
+ default_config.rpcs.list_restore_plans.retry_policy = {
116
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
117
+ }
118
+
119
+ default_config.rpcs.get_restore_plan.timeout = 60.0
120
+ default_config.rpcs.get_restore_plan.retry_policy = {
121
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
122
+ }
123
+
124
+ default_config.rpcs.update_restore_plan.timeout = 60.0
125
+
126
+ default_config.rpcs.delete_restore_plan.timeout = 60.0
127
+
128
+ default_config.rpcs.create_restore.timeout = 120.0
129
+
130
+ default_config.rpcs.list_restores.timeout = 60.0
131
+ default_config.rpcs.list_restores.retry_policy = {
132
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
133
+ }
134
+
135
+ default_config.rpcs.get_restore.timeout = 60.0
136
+ default_config.rpcs.get_restore.retry_policy = {
137
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
138
+ }
139
+
140
+ default_config.rpcs.update_restore.timeout = 60.0
141
+
142
+ default_config.rpcs.delete_restore.timeout = 60.0
143
+
144
+ default_config.rpcs.list_volume_restores.timeout = 60.0
145
+ default_config.rpcs.list_volume_restores.retry_policy = {
146
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
147
+ }
148
+
149
+ default_config.rpcs.get_volume_restore.timeout = 60.0
150
+ default_config.rpcs.get_volume_restore.retry_policy = {
151
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
152
+ }
153
+
154
+ default_config
155
+ end
156
+ yield @configure if block_given?
157
+ @configure
158
+ end
159
+
160
+ ##
161
+ # Configure the BackupForGKE Client instance.
162
+ #
163
+ # The configuration is set to the derived mode, meaning that values can be changed,
164
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
165
+ # should be made on {Client.configure}.
166
+ #
167
+ # See {::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client::Configuration}
168
+ # for a description of the configuration fields.
169
+ #
170
+ # @yield [config] Configure the Client client.
171
+ # @yieldparam config [Client::Configuration]
172
+ #
173
+ # @return [Client::Configuration]
174
+ #
175
+ def configure
176
+ yield @config if block_given?
177
+ @config
178
+ end
179
+
180
+ ##
181
+ # Create a new BackupForGKE REST client object.
182
+ #
183
+ # @example
184
+ #
185
+ # # Create a client using the default configuration
186
+ # client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.new
187
+ #
188
+ # # Create a client using a custom configuration
189
+ # client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.new do |config|
190
+ # config.timeout = 10.0
191
+ # end
192
+ #
193
+ # @yield [config] Configure the BackupForGKE client.
194
+ # @yieldparam config [Client::Configuration]
195
+ #
196
+ def initialize
197
+ # Create the configuration object
198
+ @config = Configuration.new Client.configure
199
+
200
+ # Yield the configuration if needed
201
+ yield @config if block_given?
202
+
203
+ # Create credentials
204
+ credentials = @config.credentials
205
+ # Use self-signed JWT if the endpoint is unchanged from default,
206
+ # but only if the default endpoint does not have a region prefix.
207
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
208
+ !@config.endpoint.split(".").first.include?("-")
209
+ credentials ||= Credentials.default scope: @config.scope,
210
+ enable_self_signed_jwt: enable_self_signed_jwt
211
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
212
+ credentials = Credentials.new credentials, scope: @config.scope
213
+ end
214
+
215
+ @quota_project_id = @config.quota_project
216
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
217
+
218
+ @operations_client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Operations.new do |config|
219
+ config.credentials = credentials
220
+ config.quota_project = @quota_project_id
221
+ config.endpoint = @config.endpoint
222
+ end
223
+
224
+ @backup_for_gke_stub = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
225
+ end
226
+
227
+ ##
228
+ # Get the associated client for long-running operations.
229
+ #
230
+ # @return [::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Operations]
231
+ #
232
+ attr_reader :operations_client
233
+
234
+ # Service calls
235
+
236
+ ##
237
+ # Creates a new BackupPlan in a given location.
238
+ #
239
+ # @overload create_backup_plan(request, options = nil)
240
+ # Pass arguments to `create_backup_plan` via a request object, either of type
241
+ # {::Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest} or an equivalent Hash.
242
+ #
243
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest, ::Hash]
244
+ # A request object representing the call parameters. Required. To specify no
245
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
246
+ # @param options [::Gapic::CallOptions, ::Hash]
247
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
248
+ #
249
+ # @overload create_backup_plan(parent: nil, backup_plan: nil, backup_plan_id: nil)
250
+ # Pass arguments to `create_backup_plan` via keyword arguments. Note that at
251
+ # least one keyword argument is required. To specify no parameters, or to keep all
252
+ # the default parameter values, pass an empty Hash as a request object (see above).
253
+ #
254
+ # @param parent [::String]
255
+ # Required. The location within which to create the BackupPlan.
256
+ # Format: projects/*/locations/*
257
+ # @param backup_plan [::Google::Cloud::GkeBackup::V1::BackupPlan, ::Hash]
258
+ # Required. The BackupPlan resource object to create.
259
+ # @param backup_plan_id [::String]
260
+ # Required. The client-provided short name for the BackupPlan resource.
261
+ # This name must:
262
+ #
263
+ # - be between 1 and 63 characters long (inclusive)
264
+ # - consist of only lower-case ASCII letters, numbers, and dashes
265
+ # - start with a lower-case letter
266
+ # - end with a lower-case letter or number
267
+ # - be unique within the set of BackupPlans in this location
268
+ # @yield [result, operation] Access the result along with the TransportOperation object
269
+ # @yieldparam result [::Gapic::Operation]
270
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
271
+ #
272
+ # @return [::Gapic::Operation]
273
+ #
274
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
275
+ def create_backup_plan request, options = nil
276
+ raise ::ArgumentError, "request must be provided" if request.nil?
277
+
278
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest
279
+
280
+ # Converts hash and nil to an options object
281
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
282
+
283
+ # Customize the options with defaults
284
+ call_metadata = @config.rpcs.create_backup_plan.metadata.to_h
285
+
286
+ # Set x-goog-api-client and x-goog-user-project headers
287
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
288
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
289
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
290
+ transports_version_send: [:rest]
291
+
292
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
293
+
294
+ options.apply_defaults timeout: @config.rpcs.create_backup_plan.timeout,
295
+ metadata: call_metadata,
296
+ retry_policy: @config.rpcs.create_backup_plan.retry_policy
297
+
298
+ options.apply_defaults timeout: @config.timeout,
299
+ metadata: @config.metadata,
300
+ retry_policy: @config.retry_policy
301
+
302
+ @backup_for_gke_stub.create_backup_plan request, options do |result, operation|
303
+ result = ::Gapic::Operation.new result, @operations_client, options: options
304
+ yield result, operation if block_given?
305
+ return result
306
+ end
307
+ rescue ::Gapic::Rest::Error => e
308
+ raise ::Google::Cloud::Error.from_error(e)
309
+ end
310
+
311
+ ##
312
+ # Lists BackupPlans in a given location.
313
+ #
314
+ # @overload list_backup_plans(request, options = nil)
315
+ # Pass arguments to `list_backup_plans` via a request object, either of type
316
+ # {::Google::Cloud::GkeBackup::V1::ListBackupPlansRequest} or an equivalent Hash.
317
+ #
318
+ # @param request [::Google::Cloud::GkeBackup::V1::ListBackupPlansRequest, ::Hash]
319
+ # A request object representing the call parameters. Required. To specify no
320
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
321
+ # @param options [::Gapic::CallOptions, ::Hash]
322
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
323
+ #
324
+ # @overload list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
325
+ # Pass arguments to `list_backup_plans` via keyword arguments. Note that at
326
+ # least one keyword argument is required. To specify no parameters, or to keep all
327
+ # the default parameter values, pass an empty Hash as a request object (see above).
328
+ #
329
+ # @param parent [::String]
330
+ # Required. The location that contains the BackupPlans to list.
331
+ # Format: projects/*/locations/*
332
+ # @param page_size [::Integer]
333
+ # The target number of results to return in a single response.
334
+ # If not specified, a default value will be chosen by the service.
335
+ # Note that the response may inclue a partial list and a caller should
336
+ # only rely on the response's
337
+ # {::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse#next_page_token next_page_token}
338
+ # to determine if there are more instances left to be queried.
339
+ # @param page_token [::String]
340
+ # The value of
341
+ # {::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse#next_page_token next_page_token}
342
+ # received from a previous `ListBackupPlans` call.
343
+ # Provide this to retrieve the subsequent page in a multi-page list of
344
+ # results. When paginating, all other parameters provided to
345
+ # `ListBackupPlans` must match the call that provided the page token.
346
+ # @param filter [::String]
347
+ # Field match expression used to filter the results.
348
+ # @param order_by [::String]
349
+ # Field by which to sort the results.
350
+ # @yield [result, operation] Access the result along with the TransportOperation object
351
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse]
352
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
353
+ #
354
+ # @return [::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse]
355
+ #
356
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
357
+ def list_backup_plans request, options = nil
358
+ raise ::ArgumentError, "request must be provided" if request.nil?
359
+
360
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListBackupPlansRequest
361
+
362
+ # Converts hash and nil to an options object
363
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
364
+
365
+ # Customize the options with defaults
366
+ call_metadata = @config.rpcs.list_backup_plans.metadata.to_h
367
+
368
+ # Set x-goog-api-client and x-goog-user-project headers
369
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
370
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
371
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
372
+ transports_version_send: [:rest]
373
+
374
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
375
+
376
+ options.apply_defaults timeout: @config.rpcs.list_backup_plans.timeout,
377
+ metadata: call_metadata,
378
+ retry_policy: @config.rpcs.list_backup_plans.retry_policy
379
+
380
+ options.apply_defaults timeout: @config.timeout,
381
+ metadata: @config.metadata,
382
+ retry_policy: @config.retry_policy
383
+
384
+ @backup_for_gke_stub.list_backup_plans request, options do |result, operation|
385
+ yield result, operation if block_given?
386
+ return result
387
+ end
388
+ rescue ::Gapic::Rest::Error => e
389
+ raise ::Google::Cloud::Error.from_error(e)
390
+ end
391
+
392
+ ##
393
+ # Retrieve the details of a single BackupPlan.
394
+ #
395
+ # @overload get_backup_plan(request, options = nil)
396
+ # Pass arguments to `get_backup_plan` via a request object, either of type
397
+ # {::Google::Cloud::GkeBackup::V1::GetBackupPlanRequest} or an equivalent Hash.
398
+ #
399
+ # @param request [::Google::Cloud::GkeBackup::V1::GetBackupPlanRequest, ::Hash]
400
+ # A request object representing the call parameters. Required. To specify no
401
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
402
+ # @param options [::Gapic::CallOptions, ::Hash]
403
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
404
+ #
405
+ # @overload get_backup_plan(name: nil)
406
+ # Pass arguments to `get_backup_plan` via keyword arguments. Note that at
407
+ # least one keyword argument is required. To specify no parameters, or to keep all
408
+ # the default parameter values, pass an empty Hash as a request object (see above).
409
+ #
410
+ # @param name [::String]
411
+ # Required. Fully qualified BackupPlan name.
412
+ # Format: projects/*/locations/*/backupPlans/*
413
+ # @yield [result, operation] Access the result along with the TransportOperation object
414
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::BackupPlan]
415
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
416
+ #
417
+ # @return [::Google::Cloud::GkeBackup::V1::BackupPlan]
418
+ #
419
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
420
+ def get_backup_plan request, options = nil
421
+ raise ::ArgumentError, "request must be provided" if request.nil?
422
+
423
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetBackupPlanRequest
424
+
425
+ # Converts hash and nil to an options object
426
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
427
+
428
+ # Customize the options with defaults
429
+ call_metadata = @config.rpcs.get_backup_plan.metadata.to_h
430
+
431
+ # Set x-goog-api-client and x-goog-user-project headers
432
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
434
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
435
+ transports_version_send: [:rest]
436
+
437
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ options.apply_defaults timeout: @config.rpcs.get_backup_plan.timeout,
440
+ metadata: call_metadata,
441
+ retry_policy: @config.rpcs.get_backup_plan.retry_policy
442
+
443
+ options.apply_defaults timeout: @config.timeout,
444
+ metadata: @config.metadata,
445
+ retry_policy: @config.retry_policy
446
+
447
+ @backup_for_gke_stub.get_backup_plan request, options do |result, operation|
448
+ yield result, operation if block_given?
449
+ return result
450
+ end
451
+ rescue ::Gapic::Rest::Error => e
452
+ raise ::Google::Cloud::Error.from_error(e)
453
+ end
454
+
455
+ ##
456
+ # Update a BackupPlan.
457
+ #
458
+ # @overload update_backup_plan(request, options = nil)
459
+ # Pass arguments to `update_backup_plan` via a request object, either of type
460
+ # {::Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest} or an equivalent Hash.
461
+ #
462
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest, ::Hash]
463
+ # A request object representing the call parameters. Required. To specify no
464
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
465
+ # @param options [::Gapic::CallOptions, ::Hash]
466
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
467
+ #
468
+ # @overload update_backup_plan(backup_plan: nil, update_mask: nil)
469
+ # Pass arguments to `update_backup_plan` via keyword arguments. Note that at
470
+ # least one keyword argument is required. To specify no parameters, or to keep all
471
+ # the default parameter values, pass an empty Hash as a request object (see above).
472
+ #
473
+ # @param backup_plan [::Google::Cloud::GkeBackup::V1::BackupPlan, ::Hash]
474
+ # Required. A new version of the BackupPlan resource that contains updated fields.
475
+ # This may be sparsely populated if an `update_mask` is provided.
476
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
477
+ # This is used to specify the fields to be overwritten in the
478
+ # BackupPlan targeted for update. The values for each of these
479
+ # updated fields will be taken from the `backup_plan` provided
480
+ # with this request. Field names are relative to the root of the resource
481
+ # (e.g., `description`, `backup_config.include_volume_data`, etc.)
482
+ # If no `update_mask` is provided, all fields in `backup_plan` will be
483
+ # written to the target BackupPlan resource.
484
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored
485
+ # and are not used to update the target BackupPlan.
486
+ # @yield [result, operation] Access the result along with the TransportOperation object
487
+ # @yieldparam result [::Gapic::Operation]
488
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
489
+ #
490
+ # @return [::Gapic::Operation]
491
+ #
492
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
493
+ def update_backup_plan request, options = nil
494
+ raise ::ArgumentError, "request must be provided" if request.nil?
495
+
496
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest
497
+
498
+ # Converts hash and nil to an options object
499
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
500
+
501
+ # Customize the options with defaults
502
+ call_metadata = @config.rpcs.update_backup_plan.metadata.to_h
503
+
504
+ # Set x-goog-api-client and x-goog-user-project headers
505
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
506
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
507
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
508
+ transports_version_send: [:rest]
509
+
510
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
511
+
512
+ options.apply_defaults timeout: @config.rpcs.update_backup_plan.timeout,
513
+ metadata: call_metadata,
514
+ retry_policy: @config.rpcs.update_backup_plan.retry_policy
515
+
516
+ options.apply_defaults timeout: @config.timeout,
517
+ metadata: @config.metadata,
518
+ retry_policy: @config.retry_policy
519
+
520
+ @backup_for_gke_stub.update_backup_plan request, options do |result, operation|
521
+ result = ::Gapic::Operation.new result, @operations_client, options: options
522
+ yield result, operation if block_given?
523
+ return result
524
+ end
525
+ rescue ::Gapic::Rest::Error => e
526
+ raise ::Google::Cloud::Error.from_error(e)
527
+ end
528
+
529
+ ##
530
+ # Deletes an existing BackupPlan.
531
+ #
532
+ # @overload delete_backup_plan(request, options = nil)
533
+ # Pass arguments to `delete_backup_plan` via a request object, either of type
534
+ # {::Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest} or an equivalent Hash.
535
+ #
536
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest, ::Hash]
537
+ # A request object representing the call parameters. Required. To specify no
538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
539
+ # @param options [::Gapic::CallOptions, ::Hash]
540
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
541
+ #
542
+ # @overload delete_backup_plan(name: nil, etag: nil)
543
+ # Pass arguments to `delete_backup_plan` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param name [::String]
548
+ # Required. Fully qualified BackupPlan name.
549
+ # Format: projects/*/locations/*/backupPlans/*
550
+ # @param etag [::String]
551
+ # If provided, this value must match the current value of the
552
+ # target BackupPlan's {::Google::Cloud::GkeBackup::V1::BackupPlan#etag etag} field or the request is
553
+ # rejected.
554
+ # @yield [result, operation] Access the result along with the TransportOperation object
555
+ # @yieldparam result [::Gapic::Operation]
556
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
557
+ #
558
+ # @return [::Gapic::Operation]
559
+ #
560
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
561
+ def delete_backup_plan request, options = nil
562
+ raise ::ArgumentError, "request must be provided" if request.nil?
563
+
564
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest
565
+
566
+ # Converts hash and nil to an options object
567
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
568
+
569
+ # Customize the options with defaults
570
+ call_metadata = @config.rpcs.delete_backup_plan.metadata.to_h
571
+
572
+ # Set x-goog-api-client and x-goog-user-project headers
573
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
574
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
575
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
576
+ transports_version_send: [:rest]
577
+
578
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
579
+
580
+ options.apply_defaults timeout: @config.rpcs.delete_backup_plan.timeout,
581
+ metadata: call_metadata,
582
+ retry_policy: @config.rpcs.delete_backup_plan.retry_policy
583
+
584
+ options.apply_defaults timeout: @config.timeout,
585
+ metadata: @config.metadata,
586
+ retry_policy: @config.retry_policy
587
+
588
+ @backup_for_gke_stub.delete_backup_plan request, options do |result, operation|
589
+ result = ::Gapic::Operation.new result, @operations_client, options: options
590
+ yield result, operation if block_given?
591
+ return result
592
+ end
593
+ rescue ::Gapic::Rest::Error => e
594
+ raise ::Google::Cloud::Error.from_error(e)
595
+ end
596
+
597
+ ##
598
+ # Creates a Backup for the given BackupPlan.
599
+ #
600
+ # @overload create_backup(request, options = nil)
601
+ # Pass arguments to `create_backup` via a request object, either of type
602
+ # {::Google::Cloud::GkeBackup::V1::CreateBackupRequest} or an equivalent Hash.
603
+ #
604
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateBackupRequest, ::Hash]
605
+ # A request object representing the call parameters. Required. To specify no
606
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
607
+ # @param options [::Gapic::CallOptions, ::Hash]
608
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
609
+ #
610
+ # @overload create_backup(parent: nil, backup: nil, backup_id: nil)
611
+ # Pass arguments to `create_backup` via keyword arguments. Note that at
612
+ # least one keyword argument is required. To specify no parameters, or to keep all
613
+ # the default parameter values, pass an empty Hash as a request object (see above).
614
+ #
615
+ # @param parent [::String]
616
+ # Required. The BackupPlan within which to create the Backup.
617
+ # Format: projects/*/locations/*/backupPlans/*
618
+ # @param backup [::Google::Cloud::GkeBackup::V1::Backup, ::Hash]
619
+ # The Backup resource to create.
620
+ # @param backup_id [::String]
621
+ # The client-provided short name for the Backup resource.
622
+ # This name must:
623
+ #
624
+ # - be between 1 and 63 characters long (inclusive)
625
+ # - consist of only lower-case ASCII letters, numbers, and dashes
626
+ # - start with a lower-case letter
627
+ # - end with a lower-case letter or number
628
+ # - be unique within the set of Backups in this BackupPlan
629
+ # @yield [result, operation] Access the result along with the TransportOperation object
630
+ # @yieldparam result [::Gapic::Operation]
631
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
632
+ #
633
+ # @return [::Gapic::Operation]
634
+ #
635
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
636
+ def create_backup request, options = nil
637
+ raise ::ArgumentError, "request must be provided" if request.nil?
638
+
639
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateBackupRequest
640
+
641
+ # Converts hash and nil to an options object
642
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
643
+
644
+ # Customize the options with defaults
645
+ call_metadata = @config.rpcs.create_backup.metadata.to_h
646
+
647
+ # Set x-goog-api-client and x-goog-user-project headers
648
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
649
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
650
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
651
+ transports_version_send: [:rest]
652
+
653
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
654
+
655
+ options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
656
+ metadata: call_metadata,
657
+ retry_policy: @config.rpcs.create_backup.retry_policy
658
+
659
+ options.apply_defaults timeout: @config.timeout,
660
+ metadata: @config.metadata,
661
+ retry_policy: @config.retry_policy
662
+
663
+ @backup_for_gke_stub.create_backup request, options do |result, operation|
664
+ result = ::Gapic::Operation.new result, @operations_client, options: options
665
+ yield result, operation if block_given?
666
+ return result
667
+ end
668
+ rescue ::Gapic::Rest::Error => e
669
+ raise ::Google::Cloud::Error.from_error(e)
670
+ end
671
+
672
+ ##
673
+ # Lists the Backups for a given BackupPlan.
674
+ #
675
+ # @overload list_backups(request, options = nil)
676
+ # Pass arguments to `list_backups` via a request object, either of type
677
+ # {::Google::Cloud::GkeBackup::V1::ListBackupsRequest} or an equivalent Hash.
678
+ #
679
+ # @param request [::Google::Cloud::GkeBackup::V1::ListBackupsRequest, ::Hash]
680
+ # A request object representing the call parameters. Required. To specify no
681
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
682
+ # @param options [::Gapic::CallOptions, ::Hash]
683
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
684
+ #
685
+ # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
686
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
687
+ # least one keyword argument is required. To specify no parameters, or to keep all
688
+ # the default parameter values, pass an empty Hash as a request object (see above).
689
+ #
690
+ # @param parent [::String]
691
+ # Required. The BackupPlan that contains the Backups to list.
692
+ # Format: projects/*/locations/*/backupPlans/*
693
+ # @param page_size [::Integer]
694
+ # The target number of results to return in a single response.
695
+ # If not specified, a default value will be chosen by the service.
696
+ # Note that the response may inclue a partial list and a caller should
697
+ # only rely on the response's
698
+ # {::Google::Cloud::GkeBackup::V1::ListBackupsResponse#next_page_token next_page_token}
699
+ # to determine if there are more instances left to be queried.
700
+ # @param page_token [::String]
701
+ # The value of
702
+ # {::Google::Cloud::GkeBackup::V1::ListBackupsResponse#next_page_token next_page_token}
703
+ # received from a previous `ListBackups` call.
704
+ # Provide this to retrieve the subsequent page in a multi-page list of
705
+ # results. When paginating, all other parameters provided to
706
+ # `ListBackups` must match the call that provided the page token.
707
+ # @param filter [::String]
708
+ # Field match expression used to filter the results.
709
+ # @param order_by [::String]
710
+ # Field by which to sort the results.
711
+ # @yield [result, operation] Access the result along with the TransportOperation object
712
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>]
713
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
714
+ #
715
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>]
716
+ #
717
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
718
+ def list_backups request, options = nil
719
+ raise ::ArgumentError, "request must be provided" if request.nil?
720
+
721
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListBackupsRequest
722
+
723
+ # Converts hash and nil to an options object
724
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
725
+
726
+ # Customize the options with defaults
727
+ call_metadata = @config.rpcs.list_backups.metadata.to_h
728
+
729
+ # Set x-goog-api-client and x-goog-user-project headers
730
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
731
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
732
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
733
+ transports_version_send: [:rest]
734
+
735
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
736
+
737
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
738
+ metadata: call_metadata,
739
+ retry_policy: @config.rpcs.list_backups.retry_policy
740
+
741
+ options.apply_defaults timeout: @config.timeout,
742
+ metadata: @config.metadata,
743
+ retry_policy: @config.retry_policy
744
+
745
+ @backup_for_gke_stub.list_backups request, options do |result, operation|
746
+ result = ::Gapic::Rest::PagedEnumerable.new @backup_for_gke_stub, :list_backups, "backups", request, result, options
747
+ yield result, operation if block_given?
748
+ return result
749
+ end
750
+ rescue ::Gapic::Rest::Error => e
751
+ raise ::Google::Cloud::Error.from_error(e)
752
+ end
753
+
754
+ ##
755
+ # Retrieve the details of a single Backup.
756
+ #
757
+ # @overload get_backup(request, options = nil)
758
+ # Pass arguments to `get_backup` via a request object, either of type
759
+ # {::Google::Cloud::GkeBackup::V1::GetBackupRequest} or an equivalent Hash.
760
+ #
761
+ # @param request [::Google::Cloud::GkeBackup::V1::GetBackupRequest, ::Hash]
762
+ # A request object representing the call parameters. Required. To specify no
763
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
764
+ # @param options [::Gapic::CallOptions, ::Hash]
765
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
766
+ #
767
+ # @overload get_backup(name: nil)
768
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
769
+ # least one keyword argument is required. To specify no parameters, or to keep all
770
+ # the default parameter values, pass an empty Hash as a request object (see above).
771
+ #
772
+ # @param name [::String]
773
+ # Required. Full name of the Backup resource.
774
+ # Format: projects/*/locations/*/backupPlans/*/backups/*
775
+ # @yield [result, operation] Access the result along with the TransportOperation object
776
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::Backup]
777
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
778
+ #
779
+ # @return [::Google::Cloud::GkeBackup::V1::Backup]
780
+ #
781
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
782
+ def get_backup request, options = nil
783
+ raise ::ArgumentError, "request must be provided" if request.nil?
784
+
785
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetBackupRequest
786
+
787
+ # Converts hash and nil to an options object
788
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
789
+
790
+ # Customize the options with defaults
791
+ call_metadata = @config.rpcs.get_backup.metadata.to_h
792
+
793
+ # Set x-goog-api-client and x-goog-user-project headers
794
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
795
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
796
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
797
+ transports_version_send: [:rest]
798
+
799
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
800
+
801
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
802
+ metadata: call_metadata,
803
+ retry_policy: @config.rpcs.get_backup.retry_policy
804
+
805
+ options.apply_defaults timeout: @config.timeout,
806
+ metadata: @config.metadata,
807
+ retry_policy: @config.retry_policy
808
+
809
+ @backup_for_gke_stub.get_backup request, options do |result, operation|
810
+ yield result, operation if block_given?
811
+ return result
812
+ end
813
+ rescue ::Gapic::Rest::Error => e
814
+ raise ::Google::Cloud::Error.from_error(e)
815
+ end
816
+
817
+ ##
818
+ # Update a Backup.
819
+ #
820
+ # @overload update_backup(request, options = nil)
821
+ # Pass arguments to `update_backup` via a request object, either of type
822
+ # {::Google::Cloud::GkeBackup::V1::UpdateBackupRequest} or an equivalent Hash.
823
+ #
824
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateBackupRequest, ::Hash]
825
+ # A request object representing the call parameters. Required. To specify no
826
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
827
+ # @param options [::Gapic::CallOptions, ::Hash]
828
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
829
+ #
830
+ # @overload update_backup(backup: nil, update_mask: nil)
831
+ # Pass arguments to `update_backup` via keyword arguments. Note that at
832
+ # least one keyword argument is required. To specify no parameters, or to keep all
833
+ # the default parameter values, pass an empty Hash as a request object (see above).
834
+ #
835
+ # @param backup [::Google::Cloud::GkeBackup::V1::Backup, ::Hash]
836
+ # Required. A new version of the Backup resource that contains updated fields.
837
+ # This may be sparsely populated if an `update_mask` is provided.
838
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
839
+ # This is used to specify the fields to be overwritten in the
840
+ # Backup targeted for update. The values for each of these
841
+ # updated fields will be taken from the `backup_plan` provided
842
+ # with this request. Field names are relative to the root of the resource.
843
+ # If no `update_mask` is provided, all fields in `backup` will be
844
+ # written to the target Backup resource.
845
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `backup` are ignored
846
+ # and are not used to update the target Backup.
847
+ # @yield [result, operation] Access the result along with the TransportOperation object
848
+ # @yieldparam result [::Gapic::Operation]
849
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
850
+ #
851
+ # @return [::Gapic::Operation]
852
+ #
853
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
854
+ def update_backup request, options = nil
855
+ raise ::ArgumentError, "request must be provided" if request.nil?
856
+
857
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateBackupRequest
858
+
859
+ # Converts hash and nil to an options object
860
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
861
+
862
+ # Customize the options with defaults
863
+ call_metadata = @config.rpcs.update_backup.metadata.to_h
864
+
865
+ # Set x-goog-api-client and x-goog-user-project headers
866
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
867
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
868
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
869
+ transports_version_send: [:rest]
870
+
871
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
872
+
873
+ options.apply_defaults timeout: @config.rpcs.update_backup.timeout,
874
+ metadata: call_metadata,
875
+ retry_policy: @config.rpcs.update_backup.retry_policy
876
+
877
+ options.apply_defaults timeout: @config.timeout,
878
+ metadata: @config.metadata,
879
+ retry_policy: @config.retry_policy
880
+
881
+ @backup_for_gke_stub.update_backup request, options do |result, operation|
882
+ result = ::Gapic::Operation.new result, @operations_client, options: options
883
+ yield result, operation if block_given?
884
+ return result
885
+ end
886
+ rescue ::Gapic::Rest::Error => e
887
+ raise ::Google::Cloud::Error.from_error(e)
888
+ end
889
+
890
+ ##
891
+ # Deletes an existing Backup.
892
+ #
893
+ # @overload delete_backup(request, options = nil)
894
+ # Pass arguments to `delete_backup` via a request object, either of type
895
+ # {::Google::Cloud::GkeBackup::V1::DeleteBackupRequest} or an equivalent Hash.
896
+ #
897
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteBackupRequest, ::Hash]
898
+ # A request object representing the call parameters. Required. To specify no
899
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
900
+ # @param options [::Gapic::CallOptions, ::Hash]
901
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
902
+ #
903
+ # @overload delete_backup(name: nil, etag: nil, force: nil)
904
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
905
+ # least one keyword argument is required. To specify no parameters, or to keep all
906
+ # the default parameter values, pass an empty Hash as a request object (see above).
907
+ #
908
+ # @param name [::String]
909
+ # Required. Name of the Backup resource.
910
+ # Format: projects/*/locations/*/backupPlans/*/backups/*
911
+ # @param etag [::String]
912
+ # If provided, this value must match the current value of the
913
+ # target Backup's {::Google::Cloud::GkeBackup::V1::Backup#etag etag} field or the request is
914
+ # rejected.
915
+ # @param force [::Boolean]
916
+ # If set to true, any VolumeBackups below this Backup will also be deleted.
917
+ # Otherwise, the request will only succeed if the Backup has no
918
+ # VolumeBackups.
919
+ # @yield [result, operation] Access the result along with the TransportOperation object
920
+ # @yieldparam result [::Gapic::Operation]
921
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
922
+ #
923
+ # @return [::Gapic::Operation]
924
+ #
925
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
926
+ def delete_backup request, options = nil
927
+ raise ::ArgumentError, "request must be provided" if request.nil?
928
+
929
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteBackupRequest
930
+
931
+ # Converts hash and nil to an options object
932
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
933
+
934
+ # Customize the options with defaults
935
+ call_metadata = @config.rpcs.delete_backup.metadata.to_h
936
+
937
+ # Set x-goog-api-client and x-goog-user-project headers
938
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
939
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
940
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
941
+ transports_version_send: [:rest]
942
+
943
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
944
+
945
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
946
+ metadata: call_metadata,
947
+ retry_policy: @config.rpcs.delete_backup.retry_policy
948
+
949
+ options.apply_defaults timeout: @config.timeout,
950
+ metadata: @config.metadata,
951
+ retry_policy: @config.retry_policy
952
+
953
+ @backup_for_gke_stub.delete_backup request, options do |result, operation|
954
+ result = ::Gapic::Operation.new result, @operations_client, options: options
955
+ yield result, operation if block_given?
956
+ return result
957
+ end
958
+ rescue ::Gapic::Rest::Error => e
959
+ raise ::Google::Cloud::Error.from_error(e)
960
+ end
961
+
962
+ ##
963
+ # Lists the VolumeBackups for a given Backup.
964
+ #
965
+ # @overload list_volume_backups(request, options = nil)
966
+ # Pass arguments to `list_volume_backups` via a request object, either of type
967
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest} or an equivalent Hash.
968
+ #
969
+ # @param request [::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest, ::Hash]
970
+ # A request object representing the call parameters. Required. To specify no
971
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
972
+ # @param options [::Gapic::CallOptions, ::Hash]
973
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
974
+ #
975
+ # @overload list_volume_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
976
+ # Pass arguments to `list_volume_backups` via keyword arguments. Note that at
977
+ # least one keyword argument is required. To specify no parameters, or to keep all
978
+ # the default parameter values, pass an empty Hash as a request object (see above).
979
+ #
980
+ # @param parent [::String]
981
+ # Required. The Backup that contains the VolumeBackups to list.
982
+ # Format: projects/*/locations/*/backupPlans/*/backups/*
983
+ # @param page_size [::Integer]
984
+ # The target number of results to return in a single response.
985
+ # If not specified, a default value will be chosen by the service.
986
+ # Note that the response may inclue a partial list and a caller should
987
+ # only rely on the response's
988
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsResponse#next_page_token next_page_token}
989
+ # to determine if there are more instances left to be queried.
990
+ # @param page_token [::String]
991
+ # The value of
992
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsResponse#next_page_token next_page_token}
993
+ # received from a previous `ListVolumeBackups` call.
994
+ # Provide this to retrieve the subsequent page in a multi-page list of
995
+ # results. When paginating, all other parameters provided to
996
+ # `ListVolumeBackups` must match the call that provided the page token.
997
+ # @param filter [::String]
998
+ # Field match expression used to filter the results.
999
+ # @param order_by [::String]
1000
+ # Field by which to sort the results.
1001
+ # @yield [result, operation] Access the result along with the TransportOperation object
1002
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>]
1003
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1004
+ #
1005
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>]
1006
+ #
1007
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1008
+ def list_volume_backups request, options = nil
1009
+ raise ::ArgumentError, "request must be provided" if request.nil?
1010
+
1011
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest
1012
+
1013
+ # Converts hash and nil to an options object
1014
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1015
+
1016
+ # Customize the options with defaults
1017
+ call_metadata = @config.rpcs.list_volume_backups.metadata.to_h
1018
+
1019
+ # Set x-goog-api-client and x-goog-user-project headers
1020
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1021
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1022
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1023
+ transports_version_send: [:rest]
1024
+
1025
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1026
+
1027
+ options.apply_defaults timeout: @config.rpcs.list_volume_backups.timeout,
1028
+ metadata: call_metadata,
1029
+ retry_policy: @config.rpcs.list_volume_backups.retry_policy
1030
+
1031
+ options.apply_defaults timeout: @config.timeout,
1032
+ metadata: @config.metadata,
1033
+ retry_policy: @config.retry_policy
1034
+
1035
+ @backup_for_gke_stub.list_volume_backups request, options do |result, operation|
1036
+ result = ::Gapic::Rest::PagedEnumerable.new @backup_for_gke_stub, :list_volume_backups, "volume_backups", request, result, options
1037
+ yield result, operation if block_given?
1038
+ return result
1039
+ end
1040
+ rescue ::Gapic::Rest::Error => e
1041
+ raise ::Google::Cloud::Error.from_error(e)
1042
+ end
1043
+
1044
+ ##
1045
+ # Retrieve the details of a single VolumeBackup.
1046
+ #
1047
+ # @overload get_volume_backup(request, options = nil)
1048
+ # Pass arguments to `get_volume_backup` via a request object, either of type
1049
+ # {::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest} or an equivalent Hash.
1050
+ #
1051
+ # @param request [::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest, ::Hash]
1052
+ # A request object representing the call parameters. Required. To specify no
1053
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1054
+ # @param options [::Gapic::CallOptions, ::Hash]
1055
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1056
+ #
1057
+ # @overload get_volume_backup(name: nil)
1058
+ # Pass arguments to `get_volume_backup` via keyword arguments. Note that at
1059
+ # least one keyword argument is required. To specify no parameters, or to keep all
1060
+ # the default parameter values, pass an empty Hash as a request object (see above).
1061
+ #
1062
+ # @param name [::String]
1063
+ # Required. Full name of the VolumeBackup resource.
1064
+ # Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*
1065
+ # @yield [result, operation] Access the result along with the TransportOperation object
1066
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::VolumeBackup]
1067
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1068
+ #
1069
+ # @return [::Google::Cloud::GkeBackup::V1::VolumeBackup]
1070
+ #
1071
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1072
+ def get_volume_backup request, options = nil
1073
+ raise ::ArgumentError, "request must be provided" if request.nil?
1074
+
1075
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest
1076
+
1077
+ # Converts hash and nil to an options object
1078
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1079
+
1080
+ # Customize the options with defaults
1081
+ call_metadata = @config.rpcs.get_volume_backup.metadata.to_h
1082
+
1083
+ # Set x-goog-api-client and x-goog-user-project headers
1084
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1085
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1086
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1087
+ transports_version_send: [:rest]
1088
+
1089
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1090
+
1091
+ options.apply_defaults timeout: @config.rpcs.get_volume_backup.timeout,
1092
+ metadata: call_metadata,
1093
+ retry_policy: @config.rpcs.get_volume_backup.retry_policy
1094
+
1095
+ options.apply_defaults timeout: @config.timeout,
1096
+ metadata: @config.metadata,
1097
+ retry_policy: @config.retry_policy
1098
+
1099
+ @backup_for_gke_stub.get_volume_backup request, options do |result, operation|
1100
+ yield result, operation if block_given?
1101
+ return result
1102
+ end
1103
+ rescue ::Gapic::Rest::Error => e
1104
+ raise ::Google::Cloud::Error.from_error(e)
1105
+ end
1106
+
1107
+ ##
1108
+ # Creates a new RestorePlan in a given location.
1109
+ #
1110
+ # @overload create_restore_plan(request, options = nil)
1111
+ # Pass arguments to `create_restore_plan` via a request object, either of type
1112
+ # {::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest} or an equivalent Hash.
1113
+ #
1114
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest, ::Hash]
1115
+ # A request object representing the call parameters. Required. To specify no
1116
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1117
+ # @param options [::Gapic::CallOptions, ::Hash]
1118
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1119
+ #
1120
+ # @overload create_restore_plan(parent: nil, restore_plan: nil, restore_plan_id: nil)
1121
+ # Pass arguments to `create_restore_plan` via keyword arguments. Note that at
1122
+ # least one keyword argument is required. To specify no parameters, or to keep all
1123
+ # the default parameter values, pass an empty Hash as a request object (see above).
1124
+ #
1125
+ # @param parent [::String]
1126
+ # Required. The location within which to create the RestorePlan.
1127
+ # Format: projects/*/locations/*
1128
+ # @param restore_plan [::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash]
1129
+ # Required. The RestorePlan resource object to create.
1130
+ # @param restore_plan_id [::String]
1131
+ # Required. The client-provided short name for the RestorePlan resource.
1132
+ # This name must:
1133
+ #
1134
+ # - be between 1 and 63 characters long (inclusive)
1135
+ # - consist of only lower-case ASCII letters, numbers, and dashes
1136
+ # - start with a lower-case letter
1137
+ # - end with a lower-case letter or number
1138
+ # - be unique within the set of RestorePlans in this location
1139
+ # @yield [result, operation] Access the result along with the TransportOperation object
1140
+ # @yieldparam result [::Gapic::Operation]
1141
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1142
+ #
1143
+ # @return [::Gapic::Operation]
1144
+ #
1145
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1146
+ def create_restore_plan request, options = nil
1147
+ raise ::ArgumentError, "request must be provided" if request.nil?
1148
+
1149
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest
1150
+
1151
+ # Converts hash and nil to an options object
1152
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1153
+
1154
+ # Customize the options with defaults
1155
+ call_metadata = @config.rpcs.create_restore_plan.metadata.to_h
1156
+
1157
+ # Set x-goog-api-client and x-goog-user-project headers
1158
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1159
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1160
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1161
+ transports_version_send: [:rest]
1162
+
1163
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1164
+
1165
+ options.apply_defaults timeout: @config.rpcs.create_restore_plan.timeout,
1166
+ metadata: call_metadata,
1167
+ retry_policy: @config.rpcs.create_restore_plan.retry_policy
1168
+
1169
+ options.apply_defaults timeout: @config.timeout,
1170
+ metadata: @config.metadata,
1171
+ retry_policy: @config.retry_policy
1172
+
1173
+ @backup_for_gke_stub.create_restore_plan request, options do |result, operation|
1174
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1175
+ yield result, operation if block_given?
1176
+ return result
1177
+ end
1178
+ rescue ::Gapic::Rest::Error => e
1179
+ raise ::Google::Cloud::Error.from_error(e)
1180
+ end
1181
+
1182
+ ##
1183
+ # Lists RestorePlans in a given location.
1184
+ #
1185
+ # @overload list_restore_plans(request, options = nil)
1186
+ # Pass arguments to `list_restore_plans` via a request object, either of type
1187
+ # {::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest} or an equivalent Hash.
1188
+ #
1189
+ # @param request [::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest, ::Hash]
1190
+ # A request object representing the call parameters. Required. To specify no
1191
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1192
+ # @param options [::Gapic::CallOptions, ::Hash]
1193
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1194
+ #
1195
+ # @overload list_restore_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1196
+ # Pass arguments to `list_restore_plans` via keyword arguments. Note that at
1197
+ # least one keyword argument is required. To specify no parameters, or to keep all
1198
+ # the default parameter values, pass an empty Hash as a request object (see above).
1199
+ #
1200
+ # @param parent [::String]
1201
+ # Required. The location that contains the RestorePlans to list.
1202
+ # Format: projects/*/locations/*
1203
+ # @param page_size [::Integer]
1204
+ # The target number of results to return in a single response.
1205
+ # If not specified, a default value will be chosen by the service.
1206
+ # Note that the response may inclue a partial list and a caller should
1207
+ # only rely on the response's
1208
+ # {::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse#next_page_token next_page_token}
1209
+ # to determine if there are more instances left to be queried.
1210
+ # @param page_token [::String]
1211
+ # The value of
1212
+ # {::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse#next_page_token next_page_token}
1213
+ # received from a previous `ListRestorePlans` call.
1214
+ # Provide this to retrieve the subsequent page in a multi-page list of
1215
+ # results. When paginating, all other parameters provided to
1216
+ # `ListRestorePlans` must match the call that provided the page token.
1217
+ # @param filter [::String]
1218
+ # Field match expression used to filter the results.
1219
+ # @param order_by [::String]
1220
+ # Field by which to sort the results.
1221
+ # @yield [result, operation] Access the result along with the TransportOperation object
1222
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse]
1223
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1224
+ #
1225
+ # @return [::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse]
1226
+ #
1227
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1228
+ def list_restore_plans request, options = nil
1229
+ raise ::ArgumentError, "request must be provided" if request.nil?
1230
+
1231
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest
1232
+
1233
+ # Converts hash and nil to an options object
1234
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1235
+
1236
+ # Customize the options with defaults
1237
+ call_metadata = @config.rpcs.list_restore_plans.metadata.to_h
1238
+
1239
+ # Set x-goog-api-client and x-goog-user-project headers
1240
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1241
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1242
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1243
+ transports_version_send: [:rest]
1244
+
1245
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1246
+
1247
+ options.apply_defaults timeout: @config.rpcs.list_restore_plans.timeout,
1248
+ metadata: call_metadata,
1249
+ retry_policy: @config.rpcs.list_restore_plans.retry_policy
1250
+
1251
+ options.apply_defaults timeout: @config.timeout,
1252
+ metadata: @config.metadata,
1253
+ retry_policy: @config.retry_policy
1254
+
1255
+ @backup_for_gke_stub.list_restore_plans request, options do |result, operation|
1256
+ yield result, operation if block_given?
1257
+ return result
1258
+ end
1259
+ rescue ::Gapic::Rest::Error => e
1260
+ raise ::Google::Cloud::Error.from_error(e)
1261
+ end
1262
+
1263
+ ##
1264
+ # Retrieve the details of a single RestorePlan.
1265
+ #
1266
+ # @overload get_restore_plan(request, options = nil)
1267
+ # Pass arguments to `get_restore_plan` via a request object, either of type
1268
+ # {::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest} or an equivalent Hash.
1269
+ #
1270
+ # @param request [::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest, ::Hash]
1271
+ # A request object representing the call parameters. Required. To specify no
1272
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1273
+ # @param options [::Gapic::CallOptions, ::Hash]
1274
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1275
+ #
1276
+ # @overload get_restore_plan(name: nil)
1277
+ # Pass arguments to `get_restore_plan` via keyword arguments. Note that at
1278
+ # least one keyword argument is required. To specify no parameters, or to keep all
1279
+ # the default parameter values, pass an empty Hash as a request object (see above).
1280
+ #
1281
+ # @param name [::String]
1282
+ # Required. Fully qualified RestorePlan name.
1283
+ # Format: projects/*/locations/*/restorePlans/*
1284
+ # @yield [result, operation] Access the result along with the TransportOperation object
1285
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::RestorePlan]
1286
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1287
+ #
1288
+ # @return [::Google::Cloud::GkeBackup::V1::RestorePlan]
1289
+ #
1290
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1291
+ def get_restore_plan request, options = nil
1292
+ raise ::ArgumentError, "request must be provided" if request.nil?
1293
+
1294
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest
1295
+
1296
+ # Converts hash and nil to an options object
1297
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1298
+
1299
+ # Customize the options with defaults
1300
+ call_metadata = @config.rpcs.get_restore_plan.metadata.to_h
1301
+
1302
+ # Set x-goog-api-client and x-goog-user-project headers
1303
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1304
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1305
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1306
+ transports_version_send: [:rest]
1307
+
1308
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1309
+
1310
+ options.apply_defaults timeout: @config.rpcs.get_restore_plan.timeout,
1311
+ metadata: call_metadata,
1312
+ retry_policy: @config.rpcs.get_restore_plan.retry_policy
1313
+
1314
+ options.apply_defaults timeout: @config.timeout,
1315
+ metadata: @config.metadata,
1316
+ retry_policy: @config.retry_policy
1317
+
1318
+ @backup_for_gke_stub.get_restore_plan request, options do |result, operation|
1319
+ yield result, operation if block_given?
1320
+ return result
1321
+ end
1322
+ rescue ::Gapic::Rest::Error => e
1323
+ raise ::Google::Cloud::Error.from_error(e)
1324
+ end
1325
+
1326
+ ##
1327
+ # Update a RestorePlan.
1328
+ #
1329
+ # @overload update_restore_plan(request, options = nil)
1330
+ # Pass arguments to `update_restore_plan` via a request object, either of type
1331
+ # {::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest} or an equivalent Hash.
1332
+ #
1333
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest, ::Hash]
1334
+ # A request object representing the call parameters. Required. To specify no
1335
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1336
+ # @param options [::Gapic::CallOptions, ::Hash]
1337
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1338
+ #
1339
+ # @overload update_restore_plan(restore_plan: nil, update_mask: nil)
1340
+ # Pass arguments to `update_restore_plan` via keyword arguments. Note that at
1341
+ # least one keyword argument is required. To specify no parameters, or to keep all
1342
+ # the default parameter values, pass an empty Hash as a request object (see above).
1343
+ #
1344
+ # @param restore_plan [::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash]
1345
+ # Required. A new version of the RestorePlan resource that contains updated fields.
1346
+ # This may be sparsely populated if an `update_mask` is provided.
1347
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1348
+ # This is used to specify the fields to be overwritten in the
1349
+ # RestorePlan targeted for update. The values for each of these
1350
+ # updated fields will be taken from the `restore_plan` provided
1351
+ # with this request. Field names are relative to the root of the resource.
1352
+ # If no `update_mask` is provided, all fields in `restore_plan` will be
1353
+ # written to the target RestorePlan resource.
1354
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `restore_plan` are ignored
1355
+ # and are not used to update the target RestorePlan.
1356
+ # @yield [result, operation] Access the result along with the TransportOperation object
1357
+ # @yieldparam result [::Gapic::Operation]
1358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1359
+ #
1360
+ # @return [::Gapic::Operation]
1361
+ #
1362
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1363
+ def update_restore_plan request, options = nil
1364
+ raise ::ArgumentError, "request must be provided" if request.nil?
1365
+
1366
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest
1367
+
1368
+ # Converts hash and nil to an options object
1369
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1370
+
1371
+ # Customize the options with defaults
1372
+ call_metadata = @config.rpcs.update_restore_plan.metadata.to_h
1373
+
1374
+ # Set x-goog-api-client and x-goog-user-project headers
1375
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1376
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1377
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1378
+ transports_version_send: [:rest]
1379
+
1380
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1381
+
1382
+ options.apply_defaults timeout: @config.rpcs.update_restore_plan.timeout,
1383
+ metadata: call_metadata,
1384
+ retry_policy: @config.rpcs.update_restore_plan.retry_policy
1385
+
1386
+ options.apply_defaults timeout: @config.timeout,
1387
+ metadata: @config.metadata,
1388
+ retry_policy: @config.retry_policy
1389
+
1390
+ @backup_for_gke_stub.update_restore_plan request, options do |result, operation|
1391
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1392
+ yield result, operation if block_given?
1393
+ return result
1394
+ end
1395
+ rescue ::Gapic::Rest::Error => e
1396
+ raise ::Google::Cloud::Error.from_error(e)
1397
+ end
1398
+
1399
+ ##
1400
+ # Deletes an existing RestorePlan.
1401
+ #
1402
+ # @overload delete_restore_plan(request, options = nil)
1403
+ # Pass arguments to `delete_restore_plan` via a request object, either of type
1404
+ # {::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest} or an equivalent Hash.
1405
+ #
1406
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest, ::Hash]
1407
+ # A request object representing the call parameters. Required. To specify no
1408
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1409
+ # @param options [::Gapic::CallOptions, ::Hash]
1410
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1411
+ #
1412
+ # @overload delete_restore_plan(name: nil, etag: nil, force: nil)
1413
+ # Pass arguments to `delete_restore_plan` via keyword arguments. Note that at
1414
+ # least one keyword argument is required. To specify no parameters, or to keep all
1415
+ # the default parameter values, pass an empty Hash as a request object (see above).
1416
+ #
1417
+ # @param name [::String]
1418
+ # Required. Fully qualified RestorePlan name.
1419
+ # Format: projects/*/locations/*/restorePlans/*
1420
+ # @param etag [::String]
1421
+ # If provided, this value must match the current value of the
1422
+ # target RestorePlan's {::Google::Cloud::GkeBackup::V1::RestorePlan#etag etag} field or the request is
1423
+ # rejected.
1424
+ # @param force [::Boolean]
1425
+ # If set to true, any Restores below this RestorePlan will also be deleted.
1426
+ # Otherwise, the request will only succeed if the RestorePlan has no
1427
+ # Restores.
1428
+ # @yield [result, operation] Access the result along with the TransportOperation object
1429
+ # @yieldparam result [::Gapic::Operation]
1430
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1431
+ #
1432
+ # @return [::Gapic::Operation]
1433
+ #
1434
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1435
+ def delete_restore_plan request, options = nil
1436
+ raise ::ArgumentError, "request must be provided" if request.nil?
1437
+
1438
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest
1439
+
1440
+ # Converts hash and nil to an options object
1441
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1442
+
1443
+ # Customize the options with defaults
1444
+ call_metadata = @config.rpcs.delete_restore_plan.metadata.to_h
1445
+
1446
+ # Set x-goog-api-client and x-goog-user-project headers
1447
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1448
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1449
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1450
+ transports_version_send: [:rest]
1451
+
1452
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1453
+
1454
+ options.apply_defaults timeout: @config.rpcs.delete_restore_plan.timeout,
1455
+ metadata: call_metadata,
1456
+ retry_policy: @config.rpcs.delete_restore_plan.retry_policy
1457
+
1458
+ options.apply_defaults timeout: @config.timeout,
1459
+ metadata: @config.metadata,
1460
+ retry_policy: @config.retry_policy
1461
+
1462
+ @backup_for_gke_stub.delete_restore_plan request, options do |result, operation|
1463
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1464
+ yield result, operation if block_given?
1465
+ return result
1466
+ end
1467
+ rescue ::Gapic::Rest::Error => e
1468
+ raise ::Google::Cloud::Error.from_error(e)
1469
+ end
1470
+
1471
+ ##
1472
+ # Creates a new Restore for the given RestorePlan.
1473
+ #
1474
+ # @overload create_restore(request, options = nil)
1475
+ # Pass arguments to `create_restore` via a request object, either of type
1476
+ # {::Google::Cloud::GkeBackup::V1::CreateRestoreRequest} or an equivalent Hash.
1477
+ #
1478
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateRestoreRequest, ::Hash]
1479
+ # A request object representing the call parameters. Required. To specify no
1480
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1481
+ # @param options [::Gapic::CallOptions, ::Hash]
1482
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1483
+ #
1484
+ # @overload create_restore(parent: nil, restore: nil, restore_id: nil)
1485
+ # Pass arguments to `create_restore` via keyword arguments. Note that at
1486
+ # least one keyword argument is required. To specify no parameters, or to keep all
1487
+ # the default parameter values, pass an empty Hash as a request object (see above).
1488
+ #
1489
+ # @param parent [::String]
1490
+ # Required. The RestorePlan within which to create the Restore.
1491
+ # Format: projects/*/locations/*/restorePlans/*
1492
+ # @param restore [::Google::Cloud::GkeBackup::V1::Restore, ::Hash]
1493
+ # Required. The restore resource to create.
1494
+ # @param restore_id [::String]
1495
+ # Required. The client-provided short name for the Restore resource.
1496
+ # This name must:
1497
+ #
1498
+ # - be between 1 and 63 characters long (inclusive)
1499
+ # - consist of only lower-case ASCII letters, numbers, and dashes
1500
+ # - start with a lower-case letter
1501
+ # - end with a lower-case letter or number
1502
+ # - be unique within the set of Restores in this RestorePlan.
1503
+ # @yield [result, operation] Access the result along with the TransportOperation object
1504
+ # @yieldparam result [::Gapic::Operation]
1505
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1506
+ #
1507
+ # @return [::Gapic::Operation]
1508
+ #
1509
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1510
+ def create_restore request, options = nil
1511
+ raise ::ArgumentError, "request must be provided" if request.nil?
1512
+
1513
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateRestoreRequest
1514
+
1515
+ # Converts hash and nil to an options object
1516
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1517
+
1518
+ # Customize the options with defaults
1519
+ call_metadata = @config.rpcs.create_restore.metadata.to_h
1520
+
1521
+ # Set x-goog-api-client and x-goog-user-project headers
1522
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1523
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1524
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1525
+ transports_version_send: [:rest]
1526
+
1527
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1528
+
1529
+ options.apply_defaults timeout: @config.rpcs.create_restore.timeout,
1530
+ metadata: call_metadata,
1531
+ retry_policy: @config.rpcs.create_restore.retry_policy
1532
+
1533
+ options.apply_defaults timeout: @config.timeout,
1534
+ metadata: @config.metadata,
1535
+ retry_policy: @config.retry_policy
1536
+
1537
+ @backup_for_gke_stub.create_restore request, options do |result, operation|
1538
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1539
+ yield result, operation if block_given?
1540
+ return result
1541
+ end
1542
+ rescue ::Gapic::Rest::Error => e
1543
+ raise ::Google::Cloud::Error.from_error(e)
1544
+ end
1545
+
1546
+ ##
1547
+ # Lists the Restores for a given RestorePlan.
1548
+ #
1549
+ # @overload list_restores(request, options = nil)
1550
+ # Pass arguments to `list_restores` via a request object, either of type
1551
+ # {::Google::Cloud::GkeBackup::V1::ListRestoresRequest} or an equivalent Hash.
1552
+ #
1553
+ # @param request [::Google::Cloud::GkeBackup::V1::ListRestoresRequest, ::Hash]
1554
+ # A request object representing the call parameters. Required. To specify no
1555
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1556
+ # @param options [::Gapic::CallOptions, ::Hash]
1557
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1558
+ #
1559
+ # @overload list_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1560
+ # Pass arguments to `list_restores` via keyword arguments. Note that at
1561
+ # least one keyword argument is required. To specify no parameters, or to keep all
1562
+ # the default parameter values, pass an empty Hash as a request object (see above).
1563
+ #
1564
+ # @param parent [::String]
1565
+ # Required. The RestorePlan that contains the Restores to list.
1566
+ # Format: projects/*/locations/*/restorePlans/*
1567
+ # @param page_size [::Integer]
1568
+ # The target number of results to return in a single response.
1569
+ # If not specified, a default value will be chosen by the service.
1570
+ # Note that the response may inclue a partial list and a caller should
1571
+ # only rely on the response's
1572
+ # {::Google::Cloud::GkeBackup::V1::ListRestoresResponse#next_page_token next_page_token}
1573
+ # to determine if there are more instances left to be queried.
1574
+ # @param page_token [::String]
1575
+ # The value of
1576
+ # {::Google::Cloud::GkeBackup::V1::ListRestoresResponse#next_page_token next_page_token}
1577
+ # received from a previous `ListRestores` call.
1578
+ # Provide this to retrieve the subsequent page in a multi-page list of
1579
+ # results. When paginating, all other parameters provided to `ListRestores`
1580
+ # must match the call that provided the page token.
1581
+ # @param filter [::String]
1582
+ # Field match expression used to filter the results.
1583
+ # @param order_by [::String]
1584
+ # Field by which to sort the results.
1585
+ # @yield [result, operation] Access the result along with the TransportOperation object
1586
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::ListRestoresResponse]
1587
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1588
+ #
1589
+ # @return [::Google::Cloud::GkeBackup::V1::ListRestoresResponse]
1590
+ #
1591
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1592
+ def list_restores request, options = nil
1593
+ raise ::ArgumentError, "request must be provided" if request.nil?
1594
+
1595
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListRestoresRequest
1596
+
1597
+ # Converts hash and nil to an options object
1598
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1599
+
1600
+ # Customize the options with defaults
1601
+ call_metadata = @config.rpcs.list_restores.metadata.to_h
1602
+
1603
+ # Set x-goog-api-client and x-goog-user-project headers
1604
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1605
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1606
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1607
+ transports_version_send: [:rest]
1608
+
1609
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1610
+
1611
+ options.apply_defaults timeout: @config.rpcs.list_restores.timeout,
1612
+ metadata: call_metadata,
1613
+ retry_policy: @config.rpcs.list_restores.retry_policy
1614
+
1615
+ options.apply_defaults timeout: @config.timeout,
1616
+ metadata: @config.metadata,
1617
+ retry_policy: @config.retry_policy
1618
+
1619
+ @backup_for_gke_stub.list_restores request, options do |result, operation|
1620
+ yield result, operation if block_given?
1621
+ return result
1622
+ end
1623
+ rescue ::Gapic::Rest::Error => e
1624
+ raise ::Google::Cloud::Error.from_error(e)
1625
+ end
1626
+
1627
+ ##
1628
+ # Retrieves the details of a single Restore.
1629
+ #
1630
+ # @overload get_restore(request, options = nil)
1631
+ # Pass arguments to `get_restore` via a request object, either of type
1632
+ # {::Google::Cloud::GkeBackup::V1::GetRestoreRequest} or an equivalent Hash.
1633
+ #
1634
+ # @param request [::Google::Cloud::GkeBackup::V1::GetRestoreRequest, ::Hash]
1635
+ # A request object representing the call parameters. Required. To specify no
1636
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1637
+ # @param options [::Gapic::CallOptions, ::Hash]
1638
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1639
+ #
1640
+ # @overload get_restore(name: nil)
1641
+ # Pass arguments to `get_restore` via keyword arguments. Note that at
1642
+ # least one keyword argument is required. To specify no parameters, or to keep all
1643
+ # the default parameter values, pass an empty Hash as a request object (see above).
1644
+ #
1645
+ # @param name [::String]
1646
+ # Required. Name of the restore resource.
1647
+ # Format: projects/*/locations/*/restorePlans/*/restores/*
1648
+ # @yield [result, operation] Access the result along with the TransportOperation object
1649
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::Restore]
1650
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1651
+ #
1652
+ # @return [::Google::Cloud::GkeBackup::V1::Restore]
1653
+ #
1654
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1655
+ def get_restore request, options = nil
1656
+ raise ::ArgumentError, "request must be provided" if request.nil?
1657
+
1658
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetRestoreRequest
1659
+
1660
+ # Converts hash and nil to an options object
1661
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1662
+
1663
+ # Customize the options with defaults
1664
+ call_metadata = @config.rpcs.get_restore.metadata.to_h
1665
+
1666
+ # Set x-goog-api-client and x-goog-user-project headers
1667
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1668
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1669
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1670
+ transports_version_send: [:rest]
1671
+
1672
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1673
+
1674
+ options.apply_defaults timeout: @config.rpcs.get_restore.timeout,
1675
+ metadata: call_metadata,
1676
+ retry_policy: @config.rpcs.get_restore.retry_policy
1677
+
1678
+ options.apply_defaults timeout: @config.timeout,
1679
+ metadata: @config.metadata,
1680
+ retry_policy: @config.retry_policy
1681
+
1682
+ @backup_for_gke_stub.get_restore request, options do |result, operation|
1683
+ yield result, operation if block_given?
1684
+ return result
1685
+ end
1686
+ rescue ::Gapic::Rest::Error => e
1687
+ raise ::Google::Cloud::Error.from_error(e)
1688
+ end
1689
+
1690
+ ##
1691
+ # Update a Restore.
1692
+ #
1693
+ # @overload update_restore(request, options = nil)
1694
+ # Pass arguments to `update_restore` via a request object, either of type
1695
+ # {::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest} or an equivalent Hash.
1696
+ #
1697
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest, ::Hash]
1698
+ # A request object representing the call parameters. Required. To specify no
1699
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1700
+ # @param options [::Gapic::CallOptions, ::Hash]
1701
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1702
+ #
1703
+ # @overload update_restore(restore: nil, update_mask: nil)
1704
+ # Pass arguments to `update_restore` via keyword arguments. Note that at
1705
+ # least one keyword argument is required. To specify no parameters, or to keep all
1706
+ # the default parameter values, pass an empty Hash as a request object (see above).
1707
+ #
1708
+ # @param restore [::Google::Cloud::GkeBackup::V1::Restore, ::Hash]
1709
+ # Required. A new version of the Restore resource that contains updated fields.
1710
+ # This may be sparsely populated if an `update_mask` is provided.
1711
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1712
+ # This is used to specify the fields to be overwritten in the
1713
+ # Restore targeted for update. The values for each of these
1714
+ # updated fields will be taken from the `restore` provided
1715
+ # with this request. Field names are relative to the root of the resource.
1716
+ # If no `update_mask` is provided, all fields in `restore` will be
1717
+ # written to the target Restore resource.
1718
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `restore` are ignored
1719
+ # and are not used to update the target Restore.
1720
+ # @yield [result, operation] Access the result along with the TransportOperation object
1721
+ # @yieldparam result [::Gapic::Operation]
1722
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1723
+ #
1724
+ # @return [::Gapic::Operation]
1725
+ #
1726
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1727
+ def update_restore request, options = nil
1728
+ raise ::ArgumentError, "request must be provided" if request.nil?
1729
+
1730
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest
1731
+
1732
+ # Converts hash and nil to an options object
1733
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1734
+
1735
+ # Customize the options with defaults
1736
+ call_metadata = @config.rpcs.update_restore.metadata.to_h
1737
+
1738
+ # Set x-goog-api-client and x-goog-user-project headers
1739
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1740
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1741
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1742
+ transports_version_send: [:rest]
1743
+
1744
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1745
+
1746
+ options.apply_defaults timeout: @config.rpcs.update_restore.timeout,
1747
+ metadata: call_metadata,
1748
+ retry_policy: @config.rpcs.update_restore.retry_policy
1749
+
1750
+ options.apply_defaults timeout: @config.timeout,
1751
+ metadata: @config.metadata,
1752
+ retry_policy: @config.retry_policy
1753
+
1754
+ @backup_for_gke_stub.update_restore request, options do |result, operation|
1755
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1756
+ yield result, operation if block_given?
1757
+ return result
1758
+ end
1759
+ rescue ::Gapic::Rest::Error => e
1760
+ raise ::Google::Cloud::Error.from_error(e)
1761
+ end
1762
+
1763
+ ##
1764
+ # Deletes an existing Restore.
1765
+ #
1766
+ # @overload delete_restore(request, options = nil)
1767
+ # Pass arguments to `delete_restore` via a request object, either of type
1768
+ # {::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest} or an equivalent Hash.
1769
+ #
1770
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest, ::Hash]
1771
+ # A request object representing the call parameters. Required. To specify no
1772
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1773
+ # @param options [::Gapic::CallOptions, ::Hash]
1774
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1775
+ #
1776
+ # @overload delete_restore(name: nil, etag: nil, force: nil)
1777
+ # Pass arguments to `delete_restore` via keyword arguments. Note that at
1778
+ # least one keyword argument is required. To specify no parameters, or to keep all
1779
+ # the default parameter values, pass an empty Hash as a request object (see above).
1780
+ #
1781
+ # @param name [::String]
1782
+ # Required. Full name of the Restore
1783
+ # Format: projects/*/locations/*/restorePlans/*/restores/*
1784
+ # @param etag [::String]
1785
+ # If provided, this value must match the current value of the
1786
+ # target Restore's {::Google::Cloud::GkeBackup::V1::Restore#etag etag} field or the request is
1787
+ # rejected.
1788
+ # @param force [::Boolean]
1789
+ # If set to true, any VolumeRestores below this restore will also be deleted.
1790
+ # Otherwise, the request will only succeed if the restore has no
1791
+ # VolumeRestores.
1792
+ # @yield [result, operation] Access the result along with the TransportOperation object
1793
+ # @yieldparam result [::Gapic::Operation]
1794
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1795
+ #
1796
+ # @return [::Gapic::Operation]
1797
+ #
1798
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1799
+ def delete_restore request, options = nil
1800
+ raise ::ArgumentError, "request must be provided" if request.nil?
1801
+
1802
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest
1803
+
1804
+ # Converts hash and nil to an options object
1805
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1806
+
1807
+ # Customize the options with defaults
1808
+ call_metadata = @config.rpcs.delete_restore.metadata.to_h
1809
+
1810
+ # Set x-goog-api-client and x-goog-user-project headers
1811
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1812
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1813
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1814
+ transports_version_send: [:rest]
1815
+
1816
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1817
+
1818
+ options.apply_defaults timeout: @config.rpcs.delete_restore.timeout,
1819
+ metadata: call_metadata,
1820
+ retry_policy: @config.rpcs.delete_restore.retry_policy
1821
+
1822
+ options.apply_defaults timeout: @config.timeout,
1823
+ metadata: @config.metadata,
1824
+ retry_policy: @config.retry_policy
1825
+
1826
+ @backup_for_gke_stub.delete_restore request, options do |result, operation|
1827
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1828
+ yield result, operation if block_given?
1829
+ return result
1830
+ end
1831
+ rescue ::Gapic::Rest::Error => e
1832
+ raise ::Google::Cloud::Error.from_error(e)
1833
+ end
1834
+
1835
+ ##
1836
+ # Lists the VolumeRestores for a given Restore.
1837
+ #
1838
+ # @overload list_volume_restores(request, options = nil)
1839
+ # Pass arguments to `list_volume_restores` via a request object, either of type
1840
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest} or an equivalent Hash.
1841
+ #
1842
+ # @param request [::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest, ::Hash]
1843
+ # A request object representing the call parameters. Required. To specify no
1844
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1845
+ # @param options [::Gapic::CallOptions, ::Hash]
1846
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1847
+ #
1848
+ # @overload list_volume_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1849
+ # Pass arguments to `list_volume_restores` via keyword arguments. Note that at
1850
+ # least one keyword argument is required. To specify no parameters, or to keep all
1851
+ # the default parameter values, pass an empty Hash as a request object (see above).
1852
+ #
1853
+ # @param parent [::String]
1854
+ # Required. The Restore that contains the VolumeRestores to list.
1855
+ # Format: projects/*/locations/*/restorePlans/*/restores/*
1856
+ # @param page_size [::Integer]
1857
+ # The target number of results to return in a single response.
1858
+ # If not specified, a default value will be chosen by the service.
1859
+ # Note that the response may inclue a partial list and a caller should
1860
+ # only rely on the response's
1861
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresResponse#next_page_token next_page_token}
1862
+ # to determine if there are more instances left to be queried.
1863
+ # @param page_token [::String]
1864
+ # The value of
1865
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresResponse#next_page_token next_page_token}
1866
+ # received from a previous `ListVolumeRestores` call.
1867
+ # Provide this to retrieve the subsequent page in a multi-page list of
1868
+ # results. When paginating, all other parameters provided to
1869
+ # `ListVolumeRestores` must match the call that provided the page token.
1870
+ # @param filter [::String]
1871
+ # Field match expression used to filter the results.
1872
+ # @param order_by [::String]
1873
+ # Field by which to sort the results.
1874
+ # @yield [result, operation] Access the result along with the TransportOperation object
1875
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>]
1876
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1877
+ #
1878
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>]
1879
+ #
1880
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1881
+ def list_volume_restores request, options = nil
1882
+ raise ::ArgumentError, "request must be provided" if request.nil?
1883
+
1884
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest
1885
+
1886
+ # Converts hash and nil to an options object
1887
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1888
+
1889
+ # Customize the options with defaults
1890
+ call_metadata = @config.rpcs.list_volume_restores.metadata.to_h
1891
+
1892
+ # Set x-goog-api-client and x-goog-user-project headers
1893
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1894
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1895
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1896
+ transports_version_send: [:rest]
1897
+
1898
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1899
+
1900
+ options.apply_defaults timeout: @config.rpcs.list_volume_restores.timeout,
1901
+ metadata: call_metadata,
1902
+ retry_policy: @config.rpcs.list_volume_restores.retry_policy
1903
+
1904
+ options.apply_defaults timeout: @config.timeout,
1905
+ metadata: @config.metadata,
1906
+ retry_policy: @config.retry_policy
1907
+
1908
+ @backup_for_gke_stub.list_volume_restores request, options do |result, operation|
1909
+ result = ::Gapic::Rest::PagedEnumerable.new @backup_for_gke_stub, :list_volume_restores, "volume_restores", request, result, options
1910
+ yield result, operation if block_given?
1911
+ return result
1912
+ end
1913
+ rescue ::Gapic::Rest::Error => e
1914
+ raise ::Google::Cloud::Error.from_error(e)
1915
+ end
1916
+
1917
+ ##
1918
+ # Retrieve the details of a single VolumeRestore.
1919
+ #
1920
+ # @overload get_volume_restore(request, options = nil)
1921
+ # Pass arguments to `get_volume_restore` via a request object, either of type
1922
+ # {::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest} or an equivalent Hash.
1923
+ #
1924
+ # @param request [::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest, ::Hash]
1925
+ # A request object representing the call parameters. Required. To specify no
1926
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1927
+ # @param options [::Gapic::CallOptions, ::Hash]
1928
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1929
+ #
1930
+ # @overload get_volume_restore(name: nil)
1931
+ # Pass arguments to `get_volume_restore` via keyword arguments. Note that at
1932
+ # least one keyword argument is required. To specify no parameters, or to keep all
1933
+ # the default parameter values, pass an empty Hash as a request object (see above).
1934
+ #
1935
+ # @param name [::String]
1936
+ # Required. Full name of the VolumeRestore resource.
1937
+ # Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*
1938
+ # @yield [result, operation] Access the result along with the TransportOperation object
1939
+ # @yieldparam result [::Google::Cloud::GkeBackup::V1::VolumeRestore]
1940
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1941
+ #
1942
+ # @return [::Google::Cloud::GkeBackup::V1::VolumeRestore]
1943
+ #
1944
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1945
+ def get_volume_restore request, options = nil
1946
+ raise ::ArgumentError, "request must be provided" if request.nil?
1947
+
1948
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest
1949
+
1950
+ # Converts hash and nil to an options object
1951
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1952
+
1953
+ # Customize the options with defaults
1954
+ call_metadata = @config.rpcs.get_volume_restore.metadata.to_h
1955
+
1956
+ # Set x-goog-api-client and x-goog-user-project headers
1957
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1958
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1959
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION,
1960
+ transports_version_send: [:rest]
1961
+
1962
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1963
+
1964
+ options.apply_defaults timeout: @config.rpcs.get_volume_restore.timeout,
1965
+ metadata: call_metadata,
1966
+ retry_policy: @config.rpcs.get_volume_restore.retry_policy
1967
+
1968
+ options.apply_defaults timeout: @config.timeout,
1969
+ metadata: @config.metadata,
1970
+ retry_policy: @config.retry_policy
1971
+
1972
+ @backup_for_gke_stub.get_volume_restore request, options do |result, operation|
1973
+ yield result, operation if block_given?
1974
+ return result
1975
+ end
1976
+ rescue ::Gapic::Rest::Error => e
1977
+ raise ::Google::Cloud::Error.from_error(e)
1978
+ end
1979
+
1980
+ ##
1981
+ # Configuration class for the BackupForGKE REST API.
1982
+ #
1983
+ # This class represents the configuration for BackupForGKE REST,
1984
+ # providing control over timeouts, retry behavior, logging, transport
1985
+ # parameters, and other low-level controls. Certain parameters can also be
1986
+ # applied individually to specific RPCs. See
1987
+ # {::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client::Configuration::Rpcs}
1988
+ # for a list of RPCs that can be configured independently.
1989
+ #
1990
+ # Configuration can be applied globally to all clients, or to a single client
1991
+ # on construction.
1992
+ #
1993
+ # @example
1994
+ #
1995
+ # # Modify the global config, setting the timeout for
1996
+ # # create_backup_plan to 20 seconds,
1997
+ # # and all remaining timeouts to 10 seconds.
1998
+ # ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.configure do |config|
1999
+ # config.timeout = 10.0
2000
+ # config.rpcs.create_backup_plan.timeout = 20.0
2001
+ # end
2002
+ #
2003
+ # # Apply the above configuration only to a new client.
2004
+ # client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.new do |config|
2005
+ # config.timeout = 10.0
2006
+ # config.rpcs.create_backup_plan.timeout = 20.0
2007
+ # end
2008
+ #
2009
+ # @!attribute [rw] endpoint
2010
+ # The hostname or hostname:port of the service endpoint.
2011
+ # Defaults to `"gkebackup.googleapis.com"`.
2012
+ # @return [::String]
2013
+ # @!attribute [rw] credentials
2014
+ # Credentials to send with calls. You may provide any of the following types:
2015
+ # * (`String`) The path to a service account key file in JSON format
2016
+ # * (`Hash`) A service account key as a Hash
2017
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2018
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2019
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2020
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2021
+ # * (`nil`) indicating no credentials
2022
+ # @return [::Object]
2023
+ # @!attribute [rw] scope
2024
+ # The OAuth scopes
2025
+ # @return [::Array<::String>]
2026
+ # @!attribute [rw] lib_name
2027
+ # The library name as recorded in instrumentation and logging
2028
+ # @return [::String]
2029
+ # @!attribute [rw] lib_version
2030
+ # The library version as recorded in instrumentation and logging
2031
+ # @return [::String]
2032
+ # @!attribute [rw] timeout
2033
+ # The call timeout in seconds.
2034
+ # @return [::Numeric]
2035
+ # @!attribute [rw] metadata
2036
+ # Additional headers to be sent with the call.
2037
+ # @return [::Hash{::Symbol=>::String}]
2038
+ # @!attribute [rw] retry_policy
2039
+ # The retry policy. The value is a hash with the following keys:
2040
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2041
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2042
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2043
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2044
+ # trigger a retry.
2045
+ # @return [::Hash]
2046
+ # @!attribute [rw] quota_project
2047
+ # A separate project against which to charge quota.
2048
+ # @return [::String]
2049
+ #
2050
+ class Configuration
2051
+ extend ::Gapic::Config
2052
+
2053
+ config_attr :endpoint, "gkebackup.googleapis.com", ::String
2054
+ config_attr :credentials, nil do |value|
2055
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2056
+ allowed.any? { |klass| klass === value }
2057
+ end
2058
+ config_attr :scope, nil, ::String, ::Array, nil
2059
+ config_attr :lib_name, nil, ::String, nil
2060
+ config_attr :lib_version, nil, ::String, nil
2061
+ config_attr :timeout, nil, ::Numeric, nil
2062
+ config_attr :metadata, nil, ::Hash, nil
2063
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2064
+ config_attr :quota_project, nil, ::String, nil
2065
+
2066
+ # @private
2067
+ def initialize parent_config = nil
2068
+ @parent_config = parent_config unless parent_config.nil?
2069
+
2070
+ yield self if block_given?
2071
+ end
2072
+
2073
+ ##
2074
+ # Configurations for individual RPCs
2075
+ # @return [Rpcs]
2076
+ #
2077
+ def rpcs
2078
+ @rpcs ||= begin
2079
+ parent_rpcs = nil
2080
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2081
+ Rpcs.new parent_rpcs
2082
+ end
2083
+ end
2084
+
2085
+ ##
2086
+ # Configuration RPC class for the BackupForGKE API.
2087
+ #
2088
+ # Includes fields providing the configuration for each RPC in this service.
2089
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2090
+ # the following configuration fields:
2091
+ #
2092
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2093
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2094
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2095
+ # include the following keys:
2096
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2097
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2098
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2099
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2100
+ # trigger a retry.
2101
+ #
2102
+ class Rpcs
2103
+ ##
2104
+ # RPC-specific configuration for `create_backup_plan`
2105
+ # @return [::Gapic::Config::Method]
2106
+ #
2107
+ attr_reader :create_backup_plan
2108
+ ##
2109
+ # RPC-specific configuration for `list_backup_plans`
2110
+ # @return [::Gapic::Config::Method]
2111
+ #
2112
+ attr_reader :list_backup_plans
2113
+ ##
2114
+ # RPC-specific configuration for `get_backup_plan`
2115
+ # @return [::Gapic::Config::Method]
2116
+ #
2117
+ attr_reader :get_backup_plan
2118
+ ##
2119
+ # RPC-specific configuration for `update_backup_plan`
2120
+ # @return [::Gapic::Config::Method]
2121
+ #
2122
+ attr_reader :update_backup_plan
2123
+ ##
2124
+ # RPC-specific configuration for `delete_backup_plan`
2125
+ # @return [::Gapic::Config::Method]
2126
+ #
2127
+ attr_reader :delete_backup_plan
2128
+ ##
2129
+ # RPC-specific configuration for `create_backup`
2130
+ # @return [::Gapic::Config::Method]
2131
+ #
2132
+ attr_reader :create_backup
2133
+ ##
2134
+ # RPC-specific configuration for `list_backups`
2135
+ # @return [::Gapic::Config::Method]
2136
+ #
2137
+ attr_reader :list_backups
2138
+ ##
2139
+ # RPC-specific configuration for `get_backup`
2140
+ # @return [::Gapic::Config::Method]
2141
+ #
2142
+ attr_reader :get_backup
2143
+ ##
2144
+ # RPC-specific configuration for `update_backup`
2145
+ # @return [::Gapic::Config::Method]
2146
+ #
2147
+ attr_reader :update_backup
2148
+ ##
2149
+ # RPC-specific configuration for `delete_backup`
2150
+ # @return [::Gapic::Config::Method]
2151
+ #
2152
+ attr_reader :delete_backup
2153
+ ##
2154
+ # RPC-specific configuration for `list_volume_backups`
2155
+ # @return [::Gapic::Config::Method]
2156
+ #
2157
+ attr_reader :list_volume_backups
2158
+ ##
2159
+ # RPC-specific configuration for `get_volume_backup`
2160
+ # @return [::Gapic::Config::Method]
2161
+ #
2162
+ attr_reader :get_volume_backup
2163
+ ##
2164
+ # RPC-specific configuration for `create_restore_plan`
2165
+ # @return [::Gapic::Config::Method]
2166
+ #
2167
+ attr_reader :create_restore_plan
2168
+ ##
2169
+ # RPC-specific configuration for `list_restore_plans`
2170
+ # @return [::Gapic::Config::Method]
2171
+ #
2172
+ attr_reader :list_restore_plans
2173
+ ##
2174
+ # RPC-specific configuration for `get_restore_plan`
2175
+ # @return [::Gapic::Config::Method]
2176
+ #
2177
+ attr_reader :get_restore_plan
2178
+ ##
2179
+ # RPC-specific configuration for `update_restore_plan`
2180
+ # @return [::Gapic::Config::Method]
2181
+ #
2182
+ attr_reader :update_restore_plan
2183
+ ##
2184
+ # RPC-specific configuration for `delete_restore_plan`
2185
+ # @return [::Gapic::Config::Method]
2186
+ #
2187
+ attr_reader :delete_restore_plan
2188
+ ##
2189
+ # RPC-specific configuration for `create_restore`
2190
+ # @return [::Gapic::Config::Method]
2191
+ #
2192
+ attr_reader :create_restore
2193
+ ##
2194
+ # RPC-specific configuration for `list_restores`
2195
+ # @return [::Gapic::Config::Method]
2196
+ #
2197
+ attr_reader :list_restores
2198
+ ##
2199
+ # RPC-specific configuration for `get_restore`
2200
+ # @return [::Gapic::Config::Method]
2201
+ #
2202
+ attr_reader :get_restore
2203
+ ##
2204
+ # RPC-specific configuration for `update_restore`
2205
+ # @return [::Gapic::Config::Method]
2206
+ #
2207
+ attr_reader :update_restore
2208
+ ##
2209
+ # RPC-specific configuration for `delete_restore`
2210
+ # @return [::Gapic::Config::Method]
2211
+ #
2212
+ attr_reader :delete_restore
2213
+ ##
2214
+ # RPC-specific configuration for `list_volume_restores`
2215
+ # @return [::Gapic::Config::Method]
2216
+ #
2217
+ attr_reader :list_volume_restores
2218
+ ##
2219
+ # RPC-specific configuration for `get_volume_restore`
2220
+ # @return [::Gapic::Config::Method]
2221
+ #
2222
+ attr_reader :get_volume_restore
2223
+
2224
+ # @private
2225
+ def initialize parent_rpcs = nil
2226
+ create_backup_plan_config = parent_rpcs.create_backup_plan if parent_rpcs.respond_to? :create_backup_plan
2227
+ @create_backup_plan = ::Gapic::Config::Method.new create_backup_plan_config
2228
+ list_backup_plans_config = parent_rpcs.list_backup_plans if parent_rpcs.respond_to? :list_backup_plans
2229
+ @list_backup_plans = ::Gapic::Config::Method.new list_backup_plans_config
2230
+ get_backup_plan_config = parent_rpcs.get_backup_plan if parent_rpcs.respond_to? :get_backup_plan
2231
+ @get_backup_plan = ::Gapic::Config::Method.new get_backup_plan_config
2232
+ update_backup_plan_config = parent_rpcs.update_backup_plan if parent_rpcs.respond_to? :update_backup_plan
2233
+ @update_backup_plan = ::Gapic::Config::Method.new update_backup_plan_config
2234
+ delete_backup_plan_config = parent_rpcs.delete_backup_plan if parent_rpcs.respond_to? :delete_backup_plan
2235
+ @delete_backup_plan = ::Gapic::Config::Method.new delete_backup_plan_config
2236
+ create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
2237
+ @create_backup = ::Gapic::Config::Method.new create_backup_config
2238
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
2239
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
2240
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2241
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
2242
+ update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
2243
+ @update_backup = ::Gapic::Config::Method.new update_backup_config
2244
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
2245
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
2246
+ list_volume_backups_config = parent_rpcs.list_volume_backups if parent_rpcs.respond_to? :list_volume_backups
2247
+ @list_volume_backups = ::Gapic::Config::Method.new list_volume_backups_config
2248
+ get_volume_backup_config = parent_rpcs.get_volume_backup if parent_rpcs.respond_to? :get_volume_backup
2249
+ @get_volume_backup = ::Gapic::Config::Method.new get_volume_backup_config
2250
+ create_restore_plan_config = parent_rpcs.create_restore_plan if parent_rpcs.respond_to? :create_restore_plan
2251
+ @create_restore_plan = ::Gapic::Config::Method.new create_restore_plan_config
2252
+ list_restore_plans_config = parent_rpcs.list_restore_plans if parent_rpcs.respond_to? :list_restore_plans
2253
+ @list_restore_plans = ::Gapic::Config::Method.new list_restore_plans_config
2254
+ get_restore_plan_config = parent_rpcs.get_restore_plan if parent_rpcs.respond_to? :get_restore_plan
2255
+ @get_restore_plan = ::Gapic::Config::Method.new get_restore_plan_config
2256
+ update_restore_plan_config = parent_rpcs.update_restore_plan if parent_rpcs.respond_to? :update_restore_plan
2257
+ @update_restore_plan = ::Gapic::Config::Method.new update_restore_plan_config
2258
+ delete_restore_plan_config = parent_rpcs.delete_restore_plan if parent_rpcs.respond_to? :delete_restore_plan
2259
+ @delete_restore_plan = ::Gapic::Config::Method.new delete_restore_plan_config
2260
+ create_restore_config = parent_rpcs.create_restore if parent_rpcs.respond_to? :create_restore
2261
+ @create_restore = ::Gapic::Config::Method.new create_restore_config
2262
+ list_restores_config = parent_rpcs.list_restores if parent_rpcs.respond_to? :list_restores
2263
+ @list_restores = ::Gapic::Config::Method.new list_restores_config
2264
+ get_restore_config = parent_rpcs.get_restore if parent_rpcs.respond_to? :get_restore
2265
+ @get_restore = ::Gapic::Config::Method.new get_restore_config
2266
+ update_restore_config = parent_rpcs.update_restore if parent_rpcs.respond_to? :update_restore
2267
+ @update_restore = ::Gapic::Config::Method.new update_restore_config
2268
+ delete_restore_config = parent_rpcs.delete_restore if parent_rpcs.respond_to? :delete_restore
2269
+ @delete_restore = ::Gapic::Config::Method.new delete_restore_config
2270
+ list_volume_restores_config = parent_rpcs.list_volume_restores if parent_rpcs.respond_to? :list_volume_restores
2271
+ @list_volume_restores = ::Gapic::Config::Method.new list_volume_restores_config
2272
+ get_volume_restore_config = parent_rpcs.get_volume_restore if parent_rpcs.respond_to? :get_volume_restore
2273
+ @get_volume_restore = ::Gapic::Config::Method.new get_volume_restore_config
2274
+
2275
+ yield self if block_given?
2276
+ end
2277
+ end
2278
+ end
2279
+ end
2280
+ end
2281
+ end
2282
+ end
2283
+ end
2284
+ end
2285
+ end