google-cloud-gke_backup-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb +2980 -0
  6. data/lib/google/cloud/gke_backup/v1/backup_for_gke/credentials.rb +47 -0
  7. data/lib/google/cloud/gke_backup/v1/backup_for_gke/operations.rb +767 -0
  8. data/lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb +216 -0
  9. data/lib/google/cloud/gke_backup/v1/backup_for_gke.rb +51 -0
  10. data/lib/google/cloud/gke_backup/v1/version.rb +8 -3
  11. data/lib/google/cloud/gke_backup/v1.rb +40 -0
  12. data/lib/google/cloud/gkebackup/v1/backup_pb.rb +74 -0
  13. data/lib/google/cloud/gkebackup/v1/backup_plan_pb.rb +61 -0
  14. data/lib/google/cloud/gkebackup/v1/common_pb.rb +37 -0
  15. data/lib/google/cloud/gkebackup/v1/gkebackup_pb.rb +213 -0
  16. data/lib/google/cloud/gkebackup/v1/gkebackup_services_pb.rb +92 -0
  17. data/lib/google/cloud/gkebackup/v1/restore_pb.rb +101 -0
  18. data/lib/google/cloud/gkebackup/v1/restore_plan_pb.rb +36 -0
  19. data/lib/google/cloud/gkebackup/v1/volume_pb.rb +83 -0
  20. data/lib/google-cloud-gke_backup-v1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/field_behavior.rb +71 -0
  23. data/proto_docs/google/api/resource.rb +222 -0
  24. data/proto_docs/google/cloud/gkebackup/v1/backup.rb +226 -0
  25. data/proto_docs/google/cloud/gkebackup/v1/backup_plan.rb +196 -0
  26. data/proto_docs/google/cloud/gkebackup/v1/common.rb +67 -0
  27. data/proto_docs/google/cloud/gkebackup/v1/gkebackup.rb +658 -0
  28. data/proto_docs/google/cloud/gkebackup/v1/restore.rb +325 -0
  29. data/proto_docs/google/cloud/gkebackup/v1/restore_plan.rb +92 -0
  30. data/proto_docs/google/cloud/gkebackup/v1/volume.rb +214 -0
  31. data/proto_docs/google/longrunning/operations.rb +164 -0
  32. data/proto_docs/google/protobuf/any.rb +141 -0
  33. data/proto_docs/google/protobuf/duration.rb +98 -0
  34. data/proto_docs/google/protobuf/empty.rb +36 -0
  35. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  36. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  37. data/proto_docs/google/rpc/status.rb +46 -0
  38. metadata +193 -13
@@ -0,0 +1,2980 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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
+
22
+ module Google
23
+ module Cloud
24
+ module GkeBackup
25
+ module V1
26
+ module BackupForGKE
27
+ ##
28
+ # Client for the BackupForGKE service.
29
+ #
30
+ # BackupForGKE allows Kubernetes administrators to configure, execute, and
31
+ # manage backup and restore operations for their GKE clusters.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :backup_for_gke_stub
38
+
39
+ ##
40
+ # Configure the BackupForGKE Client class.
41
+ #
42
+ # See {::Google::Cloud::GkeBackup::V1::BackupForGKE::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all BackupForGKE clients
48
+ # ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "GkeBackup", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.create_backup_plan.timeout = 300.0
69
+
70
+ default_config.rpcs.list_backup_plans.timeout = 60.0
71
+ default_config.rpcs.list_backup_plans.retry_policy = {
72
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
73
+ }
74
+
75
+ default_config.rpcs.get_backup_plan.timeout = 60.0
76
+ default_config.rpcs.get_backup_plan.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.update_backup_plan.timeout = 60.0
81
+
82
+ default_config.rpcs.delete_backup_plan.timeout = 60.0
83
+
84
+ default_config.rpcs.create_backup.timeout = 120.0
85
+
86
+ default_config.rpcs.list_backups.timeout = 60.0
87
+ default_config.rpcs.list_backups.retry_policy = {
88
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
89
+ }
90
+
91
+ default_config.rpcs.get_backup.timeout = 60.0
92
+ default_config.rpcs.get_backup.retry_policy = {
93
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.update_backup.timeout = 60.0
97
+
98
+ default_config.rpcs.delete_backup.timeout = 300.0
99
+
100
+ default_config.rpcs.list_volume_backups.timeout = 60.0
101
+ default_config.rpcs.list_volume_backups.retry_policy = {
102
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
103
+ }
104
+
105
+ default_config.rpcs.get_volume_backup.timeout = 60.0
106
+ default_config.rpcs.get_volume_backup.retry_policy = {
107
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
108
+ }
109
+
110
+ default_config.rpcs.create_restore_plan.timeout = 120.0
111
+
112
+ default_config.rpcs.list_restore_plans.timeout = 60.0
113
+ default_config.rpcs.list_restore_plans.retry_policy = {
114
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
115
+ }
116
+
117
+ default_config.rpcs.get_restore_plan.timeout = 60.0
118
+ default_config.rpcs.get_restore_plan.retry_policy = {
119
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
120
+ }
121
+
122
+ default_config.rpcs.update_restore_plan.timeout = 60.0
123
+
124
+ default_config.rpcs.delete_restore_plan.timeout = 60.0
125
+
126
+ default_config.rpcs.create_restore.timeout = 120.0
127
+
128
+ default_config.rpcs.list_restores.timeout = 60.0
129
+ default_config.rpcs.list_restores.retry_policy = {
130
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
131
+ }
132
+
133
+ default_config.rpcs.get_restore.timeout = 60.0
134
+ default_config.rpcs.get_restore.retry_policy = {
135
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
136
+ }
137
+
138
+ default_config.rpcs.update_restore.timeout = 60.0
139
+
140
+ default_config.rpcs.delete_restore.timeout = 60.0
141
+
142
+ default_config.rpcs.list_volume_restores.timeout = 60.0
143
+ default_config.rpcs.list_volume_restores.retry_policy = {
144
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
145
+ }
146
+
147
+ default_config.rpcs.get_volume_restore.timeout = 60.0
148
+ default_config.rpcs.get_volume_restore.retry_policy = {
149
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
150
+ }
151
+
152
+ default_config
153
+ end
154
+ yield @configure if block_given?
155
+ @configure
156
+ end
157
+
158
+ ##
159
+ # Configure the BackupForGKE Client instance.
160
+ #
161
+ # The configuration is set to the derived mode, meaning that values can be changed,
162
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
163
+ # should be made on {Client.configure}.
164
+ #
165
+ # See {::Google::Cloud::GkeBackup::V1::BackupForGKE::Client::Configuration}
166
+ # for a description of the configuration fields.
167
+ #
168
+ # @yield [config] Configure the Client client.
169
+ # @yieldparam config [Client::Configuration]
170
+ #
171
+ # @return [Client::Configuration]
172
+ #
173
+ def configure
174
+ yield @config if block_given?
175
+ @config
176
+ end
177
+
178
+ ##
179
+ # Create a new BackupForGKE client object.
180
+ #
181
+ # @example
182
+ #
183
+ # # Create a client using the default configuration
184
+ # client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
185
+ #
186
+ # # Create a client using a custom configuration
187
+ # client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config|
188
+ # config.timeout = 10.0
189
+ # end
190
+ #
191
+ # @yield [config] Configure the BackupForGKE client.
192
+ # @yieldparam config [Client::Configuration]
193
+ #
194
+ def initialize
195
+ # These require statements are intentionally placed here to initialize
196
+ # the gRPC module only when it's required.
197
+ # See https://github.com/googleapis/toolkit/issues/446
198
+ require "gapic/grpc"
199
+ require "google/cloud/gkebackup/v1/gkebackup_services_pb"
200
+
201
+ # Create the configuration object
202
+ @config = Configuration.new Client.configure
203
+
204
+ # Yield the configuration if needed
205
+ yield @config if block_given?
206
+
207
+ # Create credentials
208
+ credentials = @config.credentials
209
+ # Use self-signed JWT if the endpoint is unchanged from default,
210
+ # but only if the default endpoint does not have a region prefix.
211
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
212
+ !@config.endpoint.split(".").first.include?("-")
213
+ credentials ||= Credentials.default scope: @config.scope,
214
+ enable_self_signed_jwt: enable_self_signed_jwt
215
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
216
+ credentials = Credentials.new credentials, scope: @config.scope
217
+ end
218
+ @quota_project_id = @config.quota_project
219
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
220
+
221
+ @operations_client = Operations.new do |config|
222
+ config.credentials = credentials
223
+ config.quota_project = @quota_project_id
224
+ config.endpoint = @config.endpoint
225
+ end
226
+
227
+ @backup_for_gke_stub = ::Gapic::ServiceStub.new(
228
+ ::Google::Cloud::GkeBackup::V1::BackupForGKE::Stub,
229
+ credentials: credentials,
230
+ endpoint: @config.endpoint,
231
+ channel_args: @config.channel_args,
232
+ interceptors: @config.interceptors
233
+ )
234
+ end
235
+
236
+ ##
237
+ # Get the associated client for long-running operations.
238
+ #
239
+ # @return [::Google::Cloud::GkeBackup::V1::BackupForGKE::Operations]
240
+ #
241
+ attr_reader :operations_client
242
+
243
+ # Service calls
244
+
245
+ ##
246
+ # Creates a new BackupPlan in a given location.
247
+ #
248
+ # @overload create_backup_plan(request, options = nil)
249
+ # Pass arguments to `create_backup_plan` via a request object, either of type
250
+ # {::Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest} or an equivalent Hash.
251
+ #
252
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest, ::Hash]
253
+ # A request object representing the call parameters. Required. To specify no
254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
255
+ # @param options [::Gapic::CallOptions, ::Hash]
256
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
257
+ #
258
+ # @overload create_backup_plan(parent: nil, backup_plan: nil, backup_plan_id: nil)
259
+ # Pass arguments to `create_backup_plan` via keyword arguments. Note that at
260
+ # least one keyword argument is required. To specify no parameters, or to keep all
261
+ # the default parameter values, pass an empty Hash as a request object (see above).
262
+ #
263
+ # @param parent [::String]
264
+ # Required. The location within which to create the BackupPlan.
265
+ # Format: projects/*/locations/*
266
+ # @param backup_plan [::Google::Cloud::GkeBackup::V1::BackupPlan, ::Hash]
267
+ # Required. The BackupPlan resource object to create.
268
+ # @param backup_plan_id [::String]
269
+ # Required. The client-provided short name for the BackupPlan resource.
270
+ # This name must:
271
+ #
272
+ # - be between 1 and 63 characters long (inclusive)
273
+ # - consist of only lower-case ASCII letters, numbers, and dashes
274
+ # - start with a lower-case letter
275
+ # - end with a lower-case letter or number
276
+ # - be unique within the set of BackupPlans in this location
277
+ #
278
+ # @yield [response, operation] Access the result along with the RPC operation
279
+ # @yieldparam response [::Gapic::Operation]
280
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
281
+ #
282
+ # @return [::Gapic::Operation]
283
+ #
284
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
285
+ #
286
+ # @example Basic example
287
+ # require "google/cloud/gke_backup/v1"
288
+ #
289
+ # # Create a client object. The client can be reused for multiple calls.
290
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
291
+ #
292
+ # # Create a request. To set request fields, pass in keyword arguments.
293
+ # request = Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest.new
294
+ #
295
+ # # Call the create_backup_plan method.
296
+ # result = client.create_backup_plan request
297
+ #
298
+ # # The returned object is of type Gapic::Operation. You can use this
299
+ # # object to check the status of an operation, cancel it, or wait
300
+ # # for results. Here is how to block until completion:
301
+ # result.wait_until_done! timeout: 60
302
+ # if result.response?
303
+ # p result.response
304
+ # else
305
+ # puts "Error!"
306
+ # end
307
+ #
308
+ def create_backup_plan request, options = nil
309
+ raise ::ArgumentError, "request must be provided" if request.nil?
310
+
311
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest
312
+
313
+ # Converts hash and nil to an options object
314
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
315
+
316
+ # Customize the options with defaults
317
+ metadata = @config.rpcs.create_backup_plan.metadata.to_h
318
+
319
+ # Set x-goog-api-client and x-goog-user-project headers
320
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
321
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
322
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
323
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
324
+
325
+ header_params = {}
326
+ if request.parent
327
+ header_params["parent"] = request.parent
328
+ end
329
+
330
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
331
+ metadata[:"x-goog-request-params"] ||= request_params_header
332
+
333
+ options.apply_defaults timeout: @config.rpcs.create_backup_plan.timeout,
334
+ metadata: metadata,
335
+ retry_policy: @config.rpcs.create_backup_plan.retry_policy
336
+
337
+ options.apply_defaults timeout: @config.timeout,
338
+ metadata: @config.metadata,
339
+ retry_policy: @config.retry_policy
340
+
341
+ @backup_for_gke_stub.call_rpc :create_backup_plan, request, options: options do |response, operation|
342
+ response = ::Gapic::Operation.new response, @operations_client, options: options
343
+ yield response, operation if block_given?
344
+ return response
345
+ end
346
+ rescue ::GRPC::BadStatus => e
347
+ raise ::Google::Cloud::Error.from_error(e)
348
+ end
349
+
350
+ ##
351
+ # Lists BackupPlans in a given location.
352
+ #
353
+ # @overload list_backup_plans(request, options = nil)
354
+ # Pass arguments to `list_backup_plans` via a request object, either of type
355
+ # {::Google::Cloud::GkeBackup::V1::ListBackupPlansRequest} or an equivalent Hash.
356
+ #
357
+ # @param request [::Google::Cloud::GkeBackup::V1::ListBackupPlansRequest, ::Hash]
358
+ # A request object representing the call parameters. Required. To specify no
359
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
360
+ # @param options [::Gapic::CallOptions, ::Hash]
361
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
362
+ #
363
+ # @overload list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
364
+ # Pass arguments to `list_backup_plans` via keyword arguments. Note that at
365
+ # least one keyword argument is required. To specify no parameters, or to keep all
366
+ # the default parameter values, pass an empty Hash as a request object (see above).
367
+ #
368
+ # @param parent [::String]
369
+ # Required. The location that contains the BackupPlans to list.
370
+ # Format: projects/*/locations/*
371
+ # @param page_size [::Integer]
372
+ # The target number of results to return in a single response.
373
+ # If not specified, a default value will be chosen by the service.
374
+ # Note that the response may inclue a partial list and a caller should
375
+ # only rely on the response's
376
+ # {::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse#next_page_token next_page_token}
377
+ # to determine if there are more instances left to be queried.
378
+ # @param page_token [::String]
379
+ # The value of
380
+ # {::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse#next_page_token next_page_token}
381
+ # received from a previous `ListBackupPlans` call.
382
+ # Provide this to retrieve the subsequent page in a multi-page list of
383
+ # results. When paginating, all other parameters provided to
384
+ # `ListBackupPlans` must match the call that provided the page token.
385
+ # @param filter [::String]
386
+ # Field match expression used to filter the results.
387
+ # @param order_by [::String]
388
+ # Field by which to sort the results.
389
+ #
390
+ # @yield [response, operation] Access the result along with the RPC operation
391
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::BackupPlan>]
392
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
393
+ #
394
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::BackupPlan>]
395
+ #
396
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
397
+ #
398
+ # @example Basic example
399
+ # require "google/cloud/gke_backup/v1"
400
+ #
401
+ # # Create a client object. The client can be reused for multiple calls.
402
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
403
+ #
404
+ # # Create a request. To set request fields, pass in keyword arguments.
405
+ # request = Google::Cloud::GkeBackup::V1::ListBackupPlansRequest.new
406
+ #
407
+ # # Call the list_backup_plans method.
408
+ # result = client.list_backup_plans request
409
+ #
410
+ # # The returned object is of type Gapic::PagedEnumerable. You can
411
+ # # iterate over all elements by calling #each, and the enumerable
412
+ # # will lazily make API calls to fetch subsequent pages. Other
413
+ # # methods are also available for managing paging directly.
414
+ # result.each do |response|
415
+ # # Each element is of type ::Google::Cloud::GkeBackup::V1::BackupPlan.
416
+ # p response
417
+ # end
418
+ #
419
+ def list_backup_plans request, options = nil
420
+ raise ::ArgumentError, "request must be provided" if request.nil?
421
+
422
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListBackupPlansRequest
423
+
424
+ # Converts hash and nil to an options object
425
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
426
+
427
+ # Customize the options with defaults
428
+ metadata = @config.rpcs.list_backup_plans.metadata.to_h
429
+
430
+ # Set x-goog-api-client and x-goog-user-project headers
431
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
432
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
433
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
434
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
435
+
436
+ header_params = {}
437
+ if request.parent
438
+ header_params["parent"] = request.parent
439
+ end
440
+
441
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
442
+ metadata[:"x-goog-request-params"] ||= request_params_header
443
+
444
+ options.apply_defaults timeout: @config.rpcs.list_backup_plans.timeout,
445
+ metadata: metadata,
446
+ retry_policy: @config.rpcs.list_backup_plans.retry_policy
447
+
448
+ options.apply_defaults timeout: @config.timeout,
449
+ metadata: @config.metadata,
450
+ retry_policy: @config.retry_policy
451
+
452
+ @backup_for_gke_stub.call_rpc :list_backup_plans, request, options: options do |response, operation|
453
+ response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_backup_plans, request, response, operation, options
454
+ yield response, operation if block_given?
455
+ return response
456
+ end
457
+ rescue ::GRPC::BadStatus => e
458
+ raise ::Google::Cloud::Error.from_error(e)
459
+ end
460
+
461
+ ##
462
+ # Retrieve the details of a single BackupPlan.
463
+ #
464
+ # @overload get_backup_plan(request, options = nil)
465
+ # Pass arguments to `get_backup_plan` via a request object, either of type
466
+ # {::Google::Cloud::GkeBackup::V1::GetBackupPlanRequest} or an equivalent Hash.
467
+ #
468
+ # @param request [::Google::Cloud::GkeBackup::V1::GetBackupPlanRequest, ::Hash]
469
+ # A request object representing the call parameters. Required. To specify no
470
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
471
+ # @param options [::Gapic::CallOptions, ::Hash]
472
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
473
+ #
474
+ # @overload get_backup_plan(name: nil)
475
+ # Pass arguments to `get_backup_plan` via keyword arguments. Note that at
476
+ # least one keyword argument is required. To specify no parameters, or to keep all
477
+ # the default parameter values, pass an empty Hash as a request object (see above).
478
+ #
479
+ # @param name [::String]
480
+ # Required. Fully qualified BackupPlan name.
481
+ # Format: projects/*/locations/*/backupPlans/*
482
+ #
483
+ # @yield [response, operation] Access the result along with the RPC operation
484
+ # @yieldparam response [::Google::Cloud::GkeBackup::V1::BackupPlan]
485
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
486
+ #
487
+ # @return [::Google::Cloud::GkeBackup::V1::BackupPlan]
488
+ #
489
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
490
+ #
491
+ # @example Basic example
492
+ # require "google/cloud/gke_backup/v1"
493
+ #
494
+ # # Create a client object. The client can be reused for multiple calls.
495
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
496
+ #
497
+ # # Create a request. To set request fields, pass in keyword arguments.
498
+ # request = Google::Cloud::GkeBackup::V1::GetBackupPlanRequest.new
499
+ #
500
+ # # Call the get_backup_plan method.
501
+ # result = client.get_backup_plan request
502
+ #
503
+ # # The returned object is of type Google::Cloud::GkeBackup::V1::BackupPlan.
504
+ # p result
505
+ #
506
+ def get_backup_plan request, options = nil
507
+ raise ::ArgumentError, "request must be provided" if request.nil?
508
+
509
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetBackupPlanRequest
510
+
511
+ # Converts hash and nil to an options object
512
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
513
+
514
+ # Customize the options with defaults
515
+ metadata = @config.rpcs.get_backup_plan.metadata.to_h
516
+
517
+ # Set x-goog-api-client and x-goog-user-project headers
518
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
519
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
520
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
521
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
522
+
523
+ header_params = {}
524
+ if request.name
525
+ header_params["name"] = request.name
526
+ end
527
+
528
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
529
+ metadata[:"x-goog-request-params"] ||= request_params_header
530
+
531
+ options.apply_defaults timeout: @config.rpcs.get_backup_plan.timeout,
532
+ metadata: metadata,
533
+ retry_policy: @config.rpcs.get_backup_plan.retry_policy
534
+
535
+ options.apply_defaults timeout: @config.timeout,
536
+ metadata: @config.metadata,
537
+ retry_policy: @config.retry_policy
538
+
539
+ @backup_for_gke_stub.call_rpc :get_backup_plan, request, options: options do |response, operation|
540
+ yield response, operation if block_given?
541
+ return response
542
+ end
543
+ rescue ::GRPC::BadStatus => e
544
+ raise ::Google::Cloud::Error.from_error(e)
545
+ end
546
+
547
+ ##
548
+ # Update a BackupPlan.
549
+ #
550
+ # @overload update_backup_plan(request, options = nil)
551
+ # Pass arguments to `update_backup_plan` via a request object, either of type
552
+ # {::Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest} or an equivalent Hash.
553
+ #
554
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest, ::Hash]
555
+ # A request object representing the call parameters. Required. To specify no
556
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
557
+ # @param options [::Gapic::CallOptions, ::Hash]
558
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
559
+ #
560
+ # @overload update_backup_plan(backup_plan: nil, update_mask: nil)
561
+ # Pass arguments to `update_backup_plan` via keyword arguments. Note that at
562
+ # least one keyword argument is required. To specify no parameters, or to keep all
563
+ # the default parameter values, pass an empty Hash as a request object (see above).
564
+ #
565
+ # @param backup_plan [::Google::Cloud::GkeBackup::V1::BackupPlan, ::Hash]
566
+ # Required. A new version of the BackupPlan resource that contains updated fields.
567
+ # This may be sparsely populated if an `update_mask` is provided.
568
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
569
+ # This is used to specify the fields to be overwritten in the
570
+ # BackupPlan targeted for update. The values for each of these
571
+ # updated fields will be taken from the `backup_plan` provided
572
+ # with this request. Field names are relative to the root of the resource
573
+ # (e.g., `description`, `backup_config.include_volume_data`, etc.)
574
+ # If no `update_mask` is provided, all fields in `backup_plan` will be
575
+ # written to the target BackupPlan resource.
576
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored
577
+ # and are not used to update the target BackupPlan.
578
+ #
579
+ # @yield [response, operation] Access the result along with the RPC operation
580
+ # @yieldparam response [::Gapic::Operation]
581
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
582
+ #
583
+ # @return [::Gapic::Operation]
584
+ #
585
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
586
+ #
587
+ # @example Basic example
588
+ # require "google/cloud/gke_backup/v1"
589
+ #
590
+ # # Create a client object. The client can be reused for multiple calls.
591
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
592
+ #
593
+ # # Create a request. To set request fields, pass in keyword arguments.
594
+ # request = Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest.new
595
+ #
596
+ # # Call the update_backup_plan method.
597
+ # result = client.update_backup_plan request
598
+ #
599
+ # # The returned object is of type Gapic::Operation. You can use this
600
+ # # object to check the status of an operation, cancel it, or wait
601
+ # # for results. Here is how to block until completion:
602
+ # result.wait_until_done! timeout: 60
603
+ # if result.response?
604
+ # p result.response
605
+ # else
606
+ # puts "Error!"
607
+ # end
608
+ #
609
+ def update_backup_plan request, options = nil
610
+ raise ::ArgumentError, "request must be provided" if request.nil?
611
+
612
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest
613
+
614
+ # Converts hash and nil to an options object
615
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
616
+
617
+ # Customize the options with defaults
618
+ metadata = @config.rpcs.update_backup_plan.metadata.to_h
619
+
620
+ # Set x-goog-api-client and x-goog-user-project headers
621
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
622
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
623
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
624
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
625
+
626
+ header_params = {}
627
+ if request.backup_plan&.name
628
+ header_params["backup_plan.name"] = request.backup_plan.name
629
+ end
630
+
631
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
632
+ metadata[:"x-goog-request-params"] ||= request_params_header
633
+
634
+ options.apply_defaults timeout: @config.rpcs.update_backup_plan.timeout,
635
+ metadata: metadata,
636
+ retry_policy: @config.rpcs.update_backup_plan.retry_policy
637
+
638
+ options.apply_defaults timeout: @config.timeout,
639
+ metadata: @config.metadata,
640
+ retry_policy: @config.retry_policy
641
+
642
+ @backup_for_gke_stub.call_rpc :update_backup_plan, request, options: options do |response, operation|
643
+ response = ::Gapic::Operation.new response, @operations_client, options: options
644
+ yield response, operation if block_given?
645
+ return response
646
+ end
647
+ rescue ::GRPC::BadStatus => e
648
+ raise ::Google::Cloud::Error.from_error(e)
649
+ end
650
+
651
+ ##
652
+ # Deletes an existing BackupPlan.
653
+ #
654
+ # @overload delete_backup_plan(request, options = nil)
655
+ # Pass arguments to `delete_backup_plan` via a request object, either of type
656
+ # {::Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest} or an equivalent Hash.
657
+ #
658
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest, ::Hash]
659
+ # A request object representing the call parameters. Required. To specify no
660
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
661
+ # @param options [::Gapic::CallOptions, ::Hash]
662
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
663
+ #
664
+ # @overload delete_backup_plan(name: nil, etag: nil)
665
+ # Pass arguments to `delete_backup_plan` via keyword arguments. Note that at
666
+ # least one keyword argument is required. To specify no parameters, or to keep all
667
+ # the default parameter values, pass an empty Hash as a request object (see above).
668
+ #
669
+ # @param name [::String]
670
+ # Required. Fully qualified BackupPlan name.
671
+ # Format: projects/*/locations/*/backupPlans/*
672
+ # @param etag [::String]
673
+ # If provided, this value must match the current value of the
674
+ # target BackupPlan's {::Google::Cloud::GkeBackup::V1::BackupPlan#etag etag} field or the request is
675
+ # rejected.
676
+ #
677
+ # @yield [response, operation] Access the result along with the RPC operation
678
+ # @yieldparam response [::Gapic::Operation]
679
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
680
+ #
681
+ # @return [::Gapic::Operation]
682
+ #
683
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
684
+ #
685
+ # @example Basic example
686
+ # require "google/cloud/gke_backup/v1"
687
+ #
688
+ # # Create a client object. The client can be reused for multiple calls.
689
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
690
+ #
691
+ # # Create a request. To set request fields, pass in keyword arguments.
692
+ # request = Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest.new
693
+ #
694
+ # # Call the delete_backup_plan method.
695
+ # result = client.delete_backup_plan request
696
+ #
697
+ # # The returned object is of type Gapic::Operation. You can use this
698
+ # # object to check the status of an operation, cancel it, or wait
699
+ # # for results. Here is how to block until completion:
700
+ # result.wait_until_done! timeout: 60
701
+ # if result.response?
702
+ # p result.response
703
+ # else
704
+ # puts "Error!"
705
+ # end
706
+ #
707
+ def delete_backup_plan request, options = nil
708
+ raise ::ArgumentError, "request must be provided" if request.nil?
709
+
710
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest
711
+
712
+ # Converts hash and nil to an options object
713
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
714
+
715
+ # Customize the options with defaults
716
+ metadata = @config.rpcs.delete_backup_plan.metadata.to_h
717
+
718
+ # Set x-goog-api-client and x-goog-user-project headers
719
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
720
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
721
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
722
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
723
+
724
+ header_params = {}
725
+ if request.name
726
+ header_params["name"] = request.name
727
+ end
728
+
729
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
730
+ metadata[:"x-goog-request-params"] ||= request_params_header
731
+
732
+ options.apply_defaults timeout: @config.rpcs.delete_backup_plan.timeout,
733
+ metadata: metadata,
734
+ retry_policy: @config.rpcs.delete_backup_plan.retry_policy
735
+
736
+ options.apply_defaults timeout: @config.timeout,
737
+ metadata: @config.metadata,
738
+ retry_policy: @config.retry_policy
739
+
740
+ @backup_for_gke_stub.call_rpc :delete_backup_plan, request, options: options do |response, operation|
741
+ response = ::Gapic::Operation.new response, @operations_client, options: options
742
+ yield response, operation if block_given?
743
+ return response
744
+ end
745
+ rescue ::GRPC::BadStatus => e
746
+ raise ::Google::Cloud::Error.from_error(e)
747
+ end
748
+
749
+ ##
750
+ # Creates a Backup for the given BackupPlan.
751
+ #
752
+ # @overload create_backup(request, options = nil)
753
+ # Pass arguments to `create_backup` via a request object, either of type
754
+ # {::Google::Cloud::GkeBackup::V1::CreateBackupRequest} or an equivalent Hash.
755
+ #
756
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateBackupRequest, ::Hash]
757
+ # A request object representing the call parameters. Required. To specify no
758
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
759
+ # @param options [::Gapic::CallOptions, ::Hash]
760
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
761
+ #
762
+ # @overload create_backup(parent: nil, backup: nil, backup_id: nil)
763
+ # Pass arguments to `create_backup` via keyword arguments. Note that at
764
+ # least one keyword argument is required. To specify no parameters, or to keep all
765
+ # the default parameter values, pass an empty Hash as a request object (see above).
766
+ #
767
+ # @param parent [::String]
768
+ # Required. The BackupPlan within which to create the Backup.
769
+ # Format: projects/*/locations/*/backupPlans/*
770
+ # @param backup [::Google::Cloud::GkeBackup::V1::Backup, ::Hash]
771
+ # The Backup resource to create.
772
+ # @param backup_id [::String]
773
+ # The client-provided short name for the Backup resource.
774
+ # This name must:
775
+ #
776
+ # - be between 1 and 63 characters long (inclusive)
777
+ # - consist of only lower-case ASCII letters, numbers, and dashes
778
+ # - start with a lower-case letter
779
+ # - end with a lower-case letter or number
780
+ # - be unique within the set of Backups in this BackupPlan
781
+ #
782
+ # @yield [response, operation] Access the result along with the RPC operation
783
+ # @yieldparam response [::Gapic::Operation]
784
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
785
+ #
786
+ # @return [::Gapic::Operation]
787
+ #
788
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
789
+ #
790
+ # @example Basic example
791
+ # require "google/cloud/gke_backup/v1"
792
+ #
793
+ # # Create a client object. The client can be reused for multiple calls.
794
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
795
+ #
796
+ # # Create a request. To set request fields, pass in keyword arguments.
797
+ # request = Google::Cloud::GkeBackup::V1::CreateBackupRequest.new
798
+ #
799
+ # # Call the create_backup method.
800
+ # result = client.create_backup request
801
+ #
802
+ # # The returned object is of type Gapic::Operation. You can use this
803
+ # # object to check the status of an operation, cancel it, or wait
804
+ # # for results. Here is how to block until completion:
805
+ # result.wait_until_done! timeout: 60
806
+ # if result.response?
807
+ # p result.response
808
+ # else
809
+ # puts "Error!"
810
+ # end
811
+ #
812
+ def create_backup request, options = nil
813
+ raise ::ArgumentError, "request must be provided" if request.nil?
814
+
815
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateBackupRequest
816
+
817
+ # Converts hash and nil to an options object
818
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
819
+
820
+ # Customize the options with defaults
821
+ metadata = @config.rpcs.create_backup.metadata.to_h
822
+
823
+ # Set x-goog-api-client and x-goog-user-project headers
824
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
825
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
826
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
827
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
828
+
829
+ header_params = {}
830
+ if request.parent
831
+ header_params["parent"] = request.parent
832
+ end
833
+
834
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
835
+ metadata[:"x-goog-request-params"] ||= request_params_header
836
+
837
+ options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
838
+ metadata: metadata,
839
+ retry_policy: @config.rpcs.create_backup.retry_policy
840
+
841
+ options.apply_defaults timeout: @config.timeout,
842
+ metadata: @config.metadata,
843
+ retry_policy: @config.retry_policy
844
+
845
+ @backup_for_gke_stub.call_rpc :create_backup, request, options: options do |response, operation|
846
+ response = ::Gapic::Operation.new response, @operations_client, options: options
847
+ yield response, operation if block_given?
848
+ return response
849
+ end
850
+ rescue ::GRPC::BadStatus => e
851
+ raise ::Google::Cloud::Error.from_error(e)
852
+ end
853
+
854
+ ##
855
+ # Lists the Backups for a given BackupPlan.
856
+ #
857
+ # @overload list_backups(request, options = nil)
858
+ # Pass arguments to `list_backups` via a request object, either of type
859
+ # {::Google::Cloud::GkeBackup::V1::ListBackupsRequest} or an equivalent Hash.
860
+ #
861
+ # @param request [::Google::Cloud::GkeBackup::V1::ListBackupsRequest, ::Hash]
862
+ # A request object representing the call parameters. Required. To specify no
863
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
864
+ # @param options [::Gapic::CallOptions, ::Hash]
865
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
866
+ #
867
+ # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
868
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
869
+ # least one keyword argument is required. To specify no parameters, or to keep all
870
+ # the default parameter values, pass an empty Hash as a request object (see above).
871
+ #
872
+ # @param parent [::String]
873
+ # Required. The BackupPlan that contains the Backups to list.
874
+ # Format: projects/*/locations/*/backupPlans/*
875
+ # @param page_size [::Integer]
876
+ # The target number of results to return in a single response.
877
+ # If not specified, a default value will be chosen by the service.
878
+ # Note that the response may inclue a partial list and a caller should
879
+ # only rely on the response's
880
+ # {::Google::Cloud::GkeBackup::V1::ListBackupsResponse#next_page_token next_page_token}
881
+ # to determine if there are more instances left to be queried.
882
+ # @param page_token [::String]
883
+ # The value of
884
+ # {::Google::Cloud::GkeBackup::V1::ListBackupsResponse#next_page_token next_page_token}
885
+ # received from a previous `ListBackups` call.
886
+ # Provide this to retrieve the subsequent page in a multi-page list of
887
+ # results. When paginating, all other parameters provided to
888
+ # `ListBackups` must match the call that provided the page token.
889
+ # @param filter [::String]
890
+ # Field match expression used to filter the results.
891
+ # @param order_by [::String]
892
+ # Field by which to sort the results.
893
+ #
894
+ # @yield [response, operation] Access the result along with the RPC operation
895
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>]
896
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
897
+ #
898
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>]
899
+ #
900
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
901
+ #
902
+ # @example Basic example
903
+ # require "google/cloud/gke_backup/v1"
904
+ #
905
+ # # Create a client object. The client can be reused for multiple calls.
906
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
907
+ #
908
+ # # Create a request. To set request fields, pass in keyword arguments.
909
+ # request = Google::Cloud::GkeBackup::V1::ListBackupsRequest.new
910
+ #
911
+ # # Call the list_backups method.
912
+ # result = client.list_backups request
913
+ #
914
+ # # The returned object is of type Gapic::PagedEnumerable. You can
915
+ # # iterate over all elements by calling #each, and the enumerable
916
+ # # will lazily make API calls to fetch subsequent pages. Other
917
+ # # methods are also available for managing paging directly.
918
+ # result.each do |response|
919
+ # # Each element is of type ::Google::Cloud::GkeBackup::V1::Backup.
920
+ # p response
921
+ # end
922
+ #
923
+ def list_backups request, options = nil
924
+ raise ::ArgumentError, "request must be provided" if request.nil?
925
+
926
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListBackupsRequest
927
+
928
+ # Converts hash and nil to an options object
929
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
930
+
931
+ # Customize the options with defaults
932
+ metadata = @config.rpcs.list_backups.metadata.to_h
933
+
934
+ # Set x-goog-api-client and x-goog-user-project headers
935
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
936
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
937
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
938
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
939
+
940
+ header_params = {}
941
+ if request.parent
942
+ header_params["parent"] = request.parent
943
+ end
944
+
945
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
946
+ metadata[:"x-goog-request-params"] ||= request_params_header
947
+
948
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
949
+ metadata: metadata,
950
+ retry_policy: @config.rpcs.list_backups.retry_policy
951
+
952
+ options.apply_defaults timeout: @config.timeout,
953
+ metadata: @config.metadata,
954
+ retry_policy: @config.retry_policy
955
+
956
+ @backup_for_gke_stub.call_rpc :list_backups, request, options: options do |response, operation|
957
+ response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_backups, request, response, operation, options
958
+ yield response, operation if block_given?
959
+ return response
960
+ end
961
+ rescue ::GRPC::BadStatus => e
962
+ raise ::Google::Cloud::Error.from_error(e)
963
+ end
964
+
965
+ ##
966
+ # Retrieve the details of a single Backup.
967
+ #
968
+ # @overload get_backup(request, options = nil)
969
+ # Pass arguments to `get_backup` via a request object, either of type
970
+ # {::Google::Cloud::GkeBackup::V1::GetBackupRequest} or an equivalent Hash.
971
+ #
972
+ # @param request [::Google::Cloud::GkeBackup::V1::GetBackupRequest, ::Hash]
973
+ # A request object representing the call parameters. Required. To specify no
974
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
975
+ # @param options [::Gapic::CallOptions, ::Hash]
976
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
977
+ #
978
+ # @overload get_backup(name: nil)
979
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
980
+ # least one keyword argument is required. To specify no parameters, or to keep all
981
+ # the default parameter values, pass an empty Hash as a request object (see above).
982
+ #
983
+ # @param name [::String]
984
+ # Required. Full name of the Backup resource.
985
+ # Format: projects/*/locations/*/backupPlans/*/backups/*
986
+ #
987
+ # @yield [response, operation] Access the result along with the RPC operation
988
+ # @yieldparam response [::Google::Cloud::GkeBackup::V1::Backup]
989
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
990
+ #
991
+ # @return [::Google::Cloud::GkeBackup::V1::Backup]
992
+ #
993
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
994
+ #
995
+ # @example Basic example
996
+ # require "google/cloud/gke_backup/v1"
997
+ #
998
+ # # Create a client object. The client can be reused for multiple calls.
999
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1000
+ #
1001
+ # # Create a request. To set request fields, pass in keyword arguments.
1002
+ # request = Google::Cloud::GkeBackup::V1::GetBackupRequest.new
1003
+ #
1004
+ # # Call the get_backup method.
1005
+ # result = client.get_backup request
1006
+ #
1007
+ # # The returned object is of type Google::Cloud::GkeBackup::V1::Backup.
1008
+ # p result
1009
+ #
1010
+ def get_backup request, options = nil
1011
+ raise ::ArgumentError, "request must be provided" if request.nil?
1012
+
1013
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetBackupRequest
1014
+
1015
+ # Converts hash and nil to an options object
1016
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1017
+
1018
+ # Customize the options with defaults
1019
+ metadata = @config.rpcs.get_backup.metadata.to_h
1020
+
1021
+ # Set x-goog-api-client and x-goog-user-project headers
1022
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1023
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1024
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1025
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1026
+
1027
+ header_params = {}
1028
+ if request.name
1029
+ header_params["name"] = request.name
1030
+ end
1031
+
1032
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1033
+ metadata[:"x-goog-request-params"] ||= request_params_header
1034
+
1035
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
1036
+ metadata: metadata,
1037
+ retry_policy: @config.rpcs.get_backup.retry_policy
1038
+
1039
+ options.apply_defaults timeout: @config.timeout,
1040
+ metadata: @config.metadata,
1041
+ retry_policy: @config.retry_policy
1042
+
1043
+ @backup_for_gke_stub.call_rpc :get_backup, request, options: options do |response, operation|
1044
+ yield response, operation if block_given?
1045
+ return response
1046
+ end
1047
+ rescue ::GRPC::BadStatus => e
1048
+ raise ::Google::Cloud::Error.from_error(e)
1049
+ end
1050
+
1051
+ ##
1052
+ # Update a Backup.
1053
+ #
1054
+ # @overload update_backup(request, options = nil)
1055
+ # Pass arguments to `update_backup` via a request object, either of type
1056
+ # {::Google::Cloud::GkeBackup::V1::UpdateBackupRequest} or an equivalent Hash.
1057
+ #
1058
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateBackupRequest, ::Hash]
1059
+ # A request object representing the call parameters. Required. To specify no
1060
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1061
+ # @param options [::Gapic::CallOptions, ::Hash]
1062
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1063
+ #
1064
+ # @overload update_backup(backup: nil, update_mask: nil)
1065
+ # Pass arguments to `update_backup` via keyword arguments. Note that at
1066
+ # least one keyword argument is required. To specify no parameters, or to keep all
1067
+ # the default parameter values, pass an empty Hash as a request object (see above).
1068
+ #
1069
+ # @param backup [::Google::Cloud::GkeBackup::V1::Backup, ::Hash]
1070
+ # Required. A new version of the Backup resource that contains updated fields.
1071
+ # This may be sparsely populated if an `update_mask` is provided.
1072
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1073
+ # This is used to specify the fields to be overwritten in the
1074
+ # Backup targeted for update. The values for each of these
1075
+ # updated fields will be taken from the `backup_plan` provided
1076
+ # with this request. Field names are relative to the root of the resource.
1077
+ # If no `update_mask` is provided, all fields in `backup` will be
1078
+ # written to the target Backup resource.
1079
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `backup` are ignored
1080
+ # and are not used to update the target Backup.
1081
+ #
1082
+ # @yield [response, operation] Access the result along with the RPC operation
1083
+ # @yieldparam response [::Gapic::Operation]
1084
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1085
+ #
1086
+ # @return [::Gapic::Operation]
1087
+ #
1088
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1089
+ #
1090
+ # @example Basic example
1091
+ # require "google/cloud/gke_backup/v1"
1092
+ #
1093
+ # # Create a client object. The client can be reused for multiple calls.
1094
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1095
+ #
1096
+ # # Create a request. To set request fields, pass in keyword arguments.
1097
+ # request = Google::Cloud::GkeBackup::V1::UpdateBackupRequest.new
1098
+ #
1099
+ # # Call the update_backup method.
1100
+ # result = client.update_backup request
1101
+ #
1102
+ # # The returned object is of type Gapic::Operation. You can use this
1103
+ # # object to check the status of an operation, cancel it, or wait
1104
+ # # for results. Here is how to block until completion:
1105
+ # result.wait_until_done! timeout: 60
1106
+ # if result.response?
1107
+ # p result.response
1108
+ # else
1109
+ # puts "Error!"
1110
+ # end
1111
+ #
1112
+ def update_backup request, options = nil
1113
+ raise ::ArgumentError, "request must be provided" if request.nil?
1114
+
1115
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateBackupRequest
1116
+
1117
+ # Converts hash and nil to an options object
1118
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1119
+
1120
+ # Customize the options with defaults
1121
+ metadata = @config.rpcs.update_backup.metadata.to_h
1122
+
1123
+ # Set x-goog-api-client and x-goog-user-project headers
1124
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1125
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1126
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1127
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1128
+
1129
+ header_params = {}
1130
+ if request.backup&.name
1131
+ header_params["backup.name"] = request.backup.name
1132
+ end
1133
+
1134
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1135
+ metadata[:"x-goog-request-params"] ||= request_params_header
1136
+
1137
+ options.apply_defaults timeout: @config.rpcs.update_backup.timeout,
1138
+ metadata: metadata,
1139
+ retry_policy: @config.rpcs.update_backup.retry_policy
1140
+
1141
+ options.apply_defaults timeout: @config.timeout,
1142
+ metadata: @config.metadata,
1143
+ retry_policy: @config.retry_policy
1144
+
1145
+ @backup_for_gke_stub.call_rpc :update_backup, request, options: options do |response, operation|
1146
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1147
+ yield response, operation if block_given?
1148
+ return response
1149
+ end
1150
+ rescue ::GRPC::BadStatus => e
1151
+ raise ::Google::Cloud::Error.from_error(e)
1152
+ end
1153
+
1154
+ ##
1155
+ # Deletes an existing Backup.
1156
+ #
1157
+ # @overload delete_backup(request, options = nil)
1158
+ # Pass arguments to `delete_backup` via a request object, either of type
1159
+ # {::Google::Cloud::GkeBackup::V1::DeleteBackupRequest} or an equivalent Hash.
1160
+ #
1161
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteBackupRequest, ::Hash]
1162
+ # A request object representing the call parameters. Required. To specify no
1163
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1164
+ # @param options [::Gapic::CallOptions, ::Hash]
1165
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1166
+ #
1167
+ # @overload delete_backup(name: nil, etag: nil, force: nil)
1168
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
1169
+ # least one keyword argument is required. To specify no parameters, or to keep all
1170
+ # the default parameter values, pass an empty Hash as a request object (see above).
1171
+ #
1172
+ # @param name [::String]
1173
+ # Required. Name of the Backup resource.
1174
+ # Format: projects/*/locations/*/backupPlans/*/backups/*
1175
+ # @param etag [::String]
1176
+ # If provided, this value must match the current value of the
1177
+ # target Backup's {::Google::Cloud::GkeBackup::V1::Backup#etag etag} field or the request is
1178
+ # rejected.
1179
+ # @param force [::Boolean]
1180
+ # If set to true, any VolumeBackups below this Backup will also be deleted.
1181
+ # Otherwise, the request will only succeed if the Backup has no
1182
+ # VolumeBackups.
1183
+ #
1184
+ # @yield [response, operation] Access the result along with the RPC operation
1185
+ # @yieldparam response [::Gapic::Operation]
1186
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1187
+ #
1188
+ # @return [::Gapic::Operation]
1189
+ #
1190
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1191
+ #
1192
+ # @example Basic example
1193
+ # require "google/cloud/gke_backup/v1"
1194
+ #
1195
+ # # Create a client object. The client can be reused for multiple calls.
1196
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1197
+ #
1198
+ # # Create a request. To set request fields, pass in keyword arguments.
1199
+ # request = Google::Cloud::GkeBackup::V1::DeleteBackupRequest.new
1200
+ #
1201
+ # # Call the delete_backup method.
1202
+ # result = client.delete_backup request
1203
+ #
1204
+ # # The returned object is of type Gapic::Operation. You can use this
1205
+ # # object to check the status of an operation, cancel it, or wait
1206
+ # # for results. Here is how to block until completion:
1207
+ # result.wait_until_done! timeout: 60
1208
+ # if result.response?
1209
+ # p result.response
1210
+ # else
1211
+ # puts "Error!"
1212
+ # end
1213
+ #
1214
+ def delete_backup request, options = nil
1215
+ raise ::ArgumentError, "request must be provided" if request.nil?
1216
+
1217
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteBackupRequest
1218
+
1219
+ # Converts hash and nil to an options object
1220
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1221
+
1222
+ # Customize the options with defaults
1223
+ metadata = @config.rpcs.delete_backup.metadata.to_h
1224
+
1225
+ # Set x-goog-api-client and x-goog-user-project headers
1226
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1227
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1228
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1229
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1230
+
1231
+ header_params = {}
1232
+ if request.name
1233
+ header_params["name"] = request.name
1234
+ end
1235
+
1236
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1237
+ metadata[:"x-goog-request-params"] ||= request_params_header
1238
+
1239
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
1240
+ metadata: metadata,
1241
+ retry_policy: @config.rpcs.delete_backup.retry_policy
1242
+
1243
+ options.apply_defaults timeout: @config.timeout,
1244
+ metadata: @config.metadata,
1245
+ retry_policy: @config.retry_policy
1246
+
1247
+ @backup_for_gke_stub.call_rpc :delete_backup, request, options: options do |response, operation|
1248
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1249
+ yield response, operation if block_given?
1250
+ return response
1251
+ end
1252
+ rescue ::GRPC::BadStatus => e
1253
+ raise ::Google::Cloud::Error.from_error(e)
1254
+ end
1255
+
1256
+ ##
1257
+ # Lists the VolumeBackups for a given Backup.
1258
+ #
1259
+ # @overload list_volume_backups(request, options = nil)
1260
+ # Pass arguments to `list_volume_backups` via a request object, either of type
1261
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest} or an equivalent Hash.
1262
+ #
1263
+ # @param request [::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest, ::Hash]
1264
+ # A request object representing the call parameters. Required. To specify no
1265
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1266
+ # @param options [::Gapic::CallOptions, ::Hash]
1267
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1268
+ #
1269
+ # @overload list_volume_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1270
+ # Pass arguments to `list_volume_backups` via keyword arguments. Note that at
1271
+ # least one keyword argument is required. To specify no parameters, or to keep all
1272
+ # the default parameter values, pass an empty Hash as a request object (see above).
1273
+ #
1274
+ # @param parent [::String]
1275
+ # Required. The Backup that contains the VolumeBackups to list.
1276
+ # Format: projects/*/locations/*/backupPlans/*/backups/*
1277
+ # @param page_size [::Integer]
1278
+ # The target number of results to return in a single response.
1279
+ # If not specified, a default value will be chosen by the service.
1280
+ # Note that the response may inclue a partial list and a caller should
1281
+ # only rely on the response's
1282
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsResponse#next_page_token next_page_token}
1283
+ # to determine if there are more instances left to be queried.
1284
+ # @param page_token [::String]
1285
+ # The value of
1286
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsResponse#next_page_token next_page_token}
1287
+ # received from a previous `ListVolumeBackups` call.
1288
+ # Provide this to retrieve the subsequent page in a multi-page list of
1289
+ # results. When paginating, all other parameters provided to
1290
+ # `ListVolumeBackups` must match the call that provided the page token.
1291
+ # @param filter [::String]
1292
+ # Field match expression used to filter the results.
1293
+ # @param order_by [::String]
1294
+ # Field by which to sort the results.
1295
+ #
1296
+ # @yield [response, operation] Access the result along with the RPC operation
1297
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>]
1298
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1299
+ #
1300
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>]
1301
+ #
1302
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1303
+ #
1304
+ # @example Basic example
1305
+ # require "google/cloud/gke_backup/v1"
1306
+ #
1307
+ # # Create a client object. The client can be reused for multiple calls.
1308
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1309
+ #
1310
+ # # Create a request. To set request fields, pass in keyword arguments.
1311
+ # request = Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest.new
1312
+ #
1313
+ # # Call the list_volume_backups method.
1314
+ # result = client.list_volume_backups request
1315
+ #
1316
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1317
+ # # iterate over all elements by calling #each, and the enumerable
1318
+ # # will lazily make API calls to fetch subsequent pages. Other
1319
+ # # methods are also available for managing paging directly.
1320
+ # result.each do |response|
1321
+ # # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeBackup.
1322
+ # p response
1323
+ # end
1324
+ #
1325
+ def list_volume_backups request, options = nil
1326
+ raise ::ArgumentError, "request must be provided" if request.nil?
1327
+
1328
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest
1329
+
1330
+ # Converts hash and nil to an options object
1331
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1332
+
1333
+ # Customize the options with defaults
1334
+ metadata = @config.rpcs.list_volume_backups.metadata.to_h
1335
+
1336
+ # Set x-goog-api-client and x-goog-user-project headers
1337
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1338
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1339
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1340
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1341
+
1342
+ header_params = {}
1343
+ if request.parent
1344
+ header_params["parent"] = request.parent
1345
+ end
1346
+
1347
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1348
+ metadata[:"x-goog-request-params"] ||= request_params_header
1349
+
1350
+ options.apply_defaults timeout: @config.rpcs.list_volume_backups.timeout,
1351
+ metadata: metadata,
1352
+ retry_policy: @config.rpcs.list_volume_backups.retry_policy
1353
+
1354
+ options.apply_defaults timeout: @config.timeout,
1355
+ metadata: @config.metadata,
1356
+ retry_policy: @config.retry_policy
1357
+
1358
+ @backup_for_gke_stub.call_rpc :list_volume_backups, request, options: options do |response, operation|
1359
+ response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_volume_backups, request, response, operation, options
1360
+ yield response, operation if block_given?
1361
+ return response
1362
+ end
1363
+ rescue ::GRPC::BadStatus => e
1364
+ raise ::Google::Cloud::Error.from_error(e)
1365
+ end
1366
+
1367
+ ##
1368
+ # Retrieve the details of a single VolumeBackup.
1369
+ #
1370
+ # @overload get_volume_backup(request, options = nil)
1371
+ # Pass arguments to `get_volume_backup` via a request object, either of type
1372
+ # {::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest} or an equivalent Hash.
1373
+ #
1374
+ # @param request [::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest, ::Hash]
1375
+ # A request object representing the call parameters. Required. To specify no
1376
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1377
+ # @param options [::Gapic::CallOptions, ::Hash]
1378
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1379
+ #
1380
+ # @overload get_volume_backup(name: nil)
1381
+ # Pass arguments to `get_volume_backup` via keyword arguments. Note that at
1382
+ # least one keyword argument is required. To specify no parameters, or to keep all
1383
+ # the default parameter values, pass an empty Hash as a request object (see above).
1384
+ #
1385
+ # @param name [::String]
1386
+ # Required. Full name of the VolumeBackup resource.
1387
+ # Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*
1388
+ #
1389
+ # @yield [response, operation] Access the result along with the RPC operation
1390
+ # @yieldparam response [::Google::Cloud::GkeBackup::V1::VolumeBackup]
1391
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1392
+ #
1393
+ # @return [::Google::Cloud::GkeBackup::V1::VolumeBackup]
1394
+ #
1395
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1396
+ #
1397
+ # @example Basic example
1398
+ # require "google/cloud/gke_backup/v1"
1399
+ #
1400
+ # # Create a client object. The client can be reused for multiple calls.
1401
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1402
+ #
1403
+ # # Create a request. To set request fields, pass in keyword arguments.
1404
+ # request = Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest.new
1405
+ #
1406
+ # # Call the get_volume_backup method.
1407
+ # result = client.get_volume_backup request
1408
+ #
1409
+ # # The returned object is of type Google::Cloud::GkeBackup::V1::VolumeBackup.
1410
+ # p result
1411
+ #
1412
+ def get_volume_backup request, options = nil
1413
+ raise ::ArgumentError, "request must be provided" if request.nil?
1414
+
1415
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest
1416
+
1417
+ # Converts hash and nil to an options object
1418
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1419
+
1420
+ # Customize the options with defaults
1421
+ metadata = @config.rpcs.get_volume_backup.metadata.to_h
1422
+
1423
+ # Set x-goog-api-client and x-goog-user-project headers
1424
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1425
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1426
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1427
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1428
+
1429
+ header_params = {}
1430
+ if request.name
1431
+ header_params["name"] = request.name
1432
+ end
1433
+
1434
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1435
+ metadata[:"x-goog-request-params"] ||= request_params_header
1436
+
1437
+ options.apply_defaults timeout: @config.rpcs.get_volume_backup.timeout,
1438
+ metadata: metadata,
1439
+ retry_policy: @config.rpcs.get_volume_backup.retry_policy
1440
+
1441
+ options.apply_defaults timeout: @config.timeout,
1442
+ metadata: @config.metadata,
1443
+ retry_policy: @config.retry_policy
1444
+
1445
+ @backup_for_gke_stub.call_rpc :get_volume_backup, request, options: options do |response, operation|
1446
+ yield response, operation if block_given?
1447
+ return response
1448
+ end
1449
+ rescue ::GRPC::BadStatus => e
1450
+ raise ::Google::Cloud::Error.from_error(e)
1451
+ end
1452
+
1453
+ ##
1454
+ # Creates a new RestorePlan in a given location.
1455
+ #
1456
+ # @overload create_restore_plan(request, options = nil)
1457
+ # Pass arguments to `create_restore_plan` via a request object, either of type
1458
+ # {::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest} or an equivalent Hash.
1459
+ #
1460
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest, ::Hash]
1461
+ # A request object representing the call parameters. Required. To specify no
1462
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1463
+ # @param options [::Gapic::CallOptions, ::Hash]
1464
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1465
+ #
1466
+ # @overload create_restore_plan(parent: nil, restore_plan: nil, restore_plan_id: nil)
1467
+ # Pass arguments to `create_restore_plan` via keyword arguments. Note that at
1468
+ # least one keyword argument is required. To specify no parameters, or to keep all
1469
+ # the default parameter values, pass an empty Hash as a request object (see above).
1470
+ #
1471
+ # @param parent [::String]
1472
+ # Required. The location within which to create the RestorePlan.
1473
+ # Format: projects/*/locations/*
1474
+ # @param restore_plan [::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash]
1475
+ # Required. The RestorePlan resource object to create.
1476
+ # @param restore_plan_id [::String]
1477
+ # Required. The client-provided short name for the RestorePlan resource.
1478
+ # This name must:
1479
+ #
1480
+ # - be between 1 and 63 characters long (inclusive)
1481
+ # - consist of only lower-case ASCII letters, numbers, and dashes
1482
+ # - start with a lower-case letter
1483
+ # - end with a lower-case letter or number
1484
+ # - be unique within the set of RestorePlans in this location
1485
+ #
1486
+ # @yield [response, operation] Access the result along with the RPC operation
1487
+ # @yieldparam response [::Gapic::Operation]
1488
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1489
+ #
1490
+ # @return [::Gapic::Operation]
1491
+ #
1492
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1493
+ #
1494
+ # @example Basic example
1495
+ # require "google/cloud/gke_backup/v1"
1496
+ #
1497
+ # # Create a client object. The client can be reused for multiple calls.
1498
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1499
+ #
1500
+ # # Create a request. To set request fields, pass in keyword arguments.
1501
+ # request = Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest.new
1502
+ #
1503
+ # # Call the create_restore_plan method.
1504
+ # result = client.create_restore_plan request
1505
+ #
1506
+ # # The returned object is of type Gapic::Operation. You can use this
1507
+ # # object to check the status of an operation, cancel it, or wait
1508
+ # # for results. Here is how to block until completion:
1509
+ # result.wait_until_done! timeout: 60
1510
+ # if result.response?
1511
+ # p result.response
1512
+ # else
1513
+ # puts "Error!"
1514
+ # end
1515
+ #
1516
+ def create_restore_plan request, options = nil
1517
+ raise ::ArgumentError, "request must be provided" if request.nil?
1518
+
1519
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest
1520
+
1521
+ # Converts hash and nil to an options object
1522
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1523
+
1524
+ # Customize the options with defaults
1525
+ metadata = @config.rpcs.create_restore_plan.metadata.to_h
1526
+
1527
+ # Set x-goog-api-client and x-goog-user-project headers
1528
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1529
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1530
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1531
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1532
+
1533
+ header_params = {}
1534
+ if request.parent
1535
+ header_params["parent"] = request.parent
1536
+ end
1537
+
1538
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1539
+ metadata[:"x-goog-request-params"] ||= request_params_header
1540
+
1541
+ options.apply_defaults timeout: @config.rpcs.create_restore_plan.timeout,
1542
+ metadata: metadata,
1543
+ retry_policy: @config.rpcs.create_restore_plan.retry_policy
1544
+
1545
+ options.apply_defaults timeout: @config.timeout,
1546
+ metadata: @config.metadata,
1547
+ retry_policy: @config.retry_policy
1548
+
1549
+ @backup_for_gke_stub.call_rpc :create_restore_plan, request, options: options do |response, operation|
1550
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1551
+ yield response, operation if block_given?
1552
+ return response
1553
+ end
1554
+ rescue ::GRPC::BadStatus => e
1555
+ raise ::Google::Cloud::Error.from_error(e)
1556
+ end
1557
+
1558
+ ##
1559
+ # Lists RestorePlans in a given location.
1560
+ #
1561
+ # @overload list_restore_plans(request, options = nil)
1562
+ # Pass arguments to `list_restore_plans` via a request object, either of type
1563
+ # {::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest} or an equivalent Hash.
1564
+ #
1565
+ # @param request [::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest, ::Hash]
1566
+ # A request object representing the call parameters. Required. To specify no
1567
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1568
+ # @param options [::Gapic::CallOptions, ::Hash]
1569
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1570
+ #
1571
+ # @overload list_restore_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1572
+ # Pass arguments to `list_restore_plans` via keyword arguments. Note that at
1573
+ # least one keyword argument is required. To specify no parameters, or to keep all
1574
+ # the default parameter values, pass an empty Hash as a request object (see above).
1575
+ #
1576
+ # @param parent [::String]
1577
+ # Required. The location that contains the RestorePlans to list.
1578
+ # Format: projects/*/locations/*
1579
+ # @param page_size [::Integer]
1580
+ # The target number of results to return in a single response.
1581
+ # If not specified, a default value will be chosen by the service.
1582
+ # Note that the response may inclue a partial list and a caller should
1583
+ # only rely on the response's
1584
+ # {::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse#next_page_token next_page_token}
1585
+ # to determine if there are more instances left to be queried.
1586
+ # @param page_token [::String]
1587
+ # The value of
1588
+ # {::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse#next_page_token next_page_token}
1589
+ # received from a previous `ListRestorePlans` call.
1590
+ # Provide this to retrieve the subsequent page in a multi-page list of
1591
+ # results. When paginating, all other parameters provided to
1592
+ # `ListRestorePlans` must match the call that provided the page token.
1593
+ # @param filter [::String]
1594
+ # Field match expression used to filter the results.
1595
+ # @param order_by [::String]
1596
+ # Field by which to sort the results.
1597
+ #
1598
+ # @yield [response, operation] Access the result along with the RPC operation
1599
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::RestorePlan>]
1600
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1601
+ #
1602
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::RestorePlan>]
1603
+ #
1604
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1605
+ #
1606
+ # @example Basic example
1607
+ # require "google/cloud/gke_backup/v1"
1608
+ #
1609
+ # # Create a client object. The client can be reused for multiple calls.
1610
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1611
+ #
1612
+ # # Create a request. To set request fields, pass in keyword arguments.
1613
+ # request = Google::Cloud::GkeBackup::V1::ListRestorePlansRequest.new
1614
+ #
1615
+ # # Call the list_restore_plans method.
1616
+ # result = client.list_restore_plans request
1617
+ #
1618
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1619
+ # # iterate over all elements by calling #each, and the enumerable
1620
+ # # will lazily make API calls to fetch subsequent pages. Other
1621
+ # # methods are also available for managing paging directly.
1622
+ # result.each do |response|
1623
+ # # Each element is of type ::Google::Cloud::GkeBackup::V1::RestorePlan.
1624
+ # p response
1625
+ # end
1626
+ #
1627
+ def list_restore_plans request, options = nil
1628
+ raise ::ArgumentError, "request must be provided" if request.nil?
1629
+
1630
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest
1631
+
1632
+ # Converts hash and nil to an options object
1633
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1634
+
1635
+ # Customize the options with defaults
1636
+ metadata = @config.rpcs.list_restore_plans.metadata.to_h
1637
+
1638
+ # Set x-goog-api-client and x-goog-user-project headers
1639
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1640
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1641
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1642
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1643
+
1644
+ header_params = {}
1645
+ if request.parent
1646
+ header_params["parent"] = request.parent
1647
+ end
1648
+
1649
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1650
+ metadata[:"x-goog-request-params"] ||= request_params_header
1651
+
1652
+ options.apply_defaults timeout: @config.rpcs.list_restore_plans.timeout,
1653
+ metadata: metadata,
1654
+ retry_policy: @config.rpcs.list_restore_plans.retry_policy
1655
+
1656
+ options.apply_defaults timeout: @config.timeout,
1657
+ metadata: @config.metadata,
1658
+ retry_policy: @config.retry_policy
1659
+
1660
+ @backup_for_gke_stub.call_rpc :list_restore_plans, request, options: options do |response, operation|
1661
+ response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_restore_plans, request, response, operation, options
1662
+ yield response, operation if block_given?
1663
+ return response
1664
+ end
1665
+ rescue ::GRPC::BadStatus => e
1666
+ raise ::Google::Cloud::Error.from_error(e)
1667
+ end
1668
+
1669
+ ##
1670
+ # Retrieve the details of a single RestorePlan.
1671
+ #
1672
+ # @overload get_restore_plan(request, options = nil)
1673
+ # Pass arguments to `get_restore_plan` via a request object, either of type
1674
+ # {::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest} or an equivalent Hash.
1675
+ #
1676
+ # @param request [::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest, ::Hash]
1677
+ # A request object representing the call parameters. Required. To specify no
1678
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1679
+ # @param options [::Gapic::CallOptions, ::Hash]
1680
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1681
+ #
1682
+ # @overload get_restore_plan(name: nil)
1683
+ # Pass arguments to `get_restore_plan` via keyword arguments. Note that at
1684
+ # least one keyword argument is required. To specify no parameters, or to keep all
1685
+ # the default parameter values, pass an empty Hash as a request object (see above).
1686
+ #
1687
+ # @param name [::String]
1688
+ # Required. Fully qualified RestorePlan name.
1689
+ # Format: projects/*/locations/*/restorePlans/*
1690
+ #
1691
+ # @yield [response, operation] Access the result along with the RPC operation
1692
+ # @yieldparam response [::Google::Cloud::GkeBackup::V1::RestorePlan]
1693
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1694
+ #
1695
+ # @return [::Google::Cloud::GkeBackup::V1::RestorePlan]
1696
+ #
1697
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1698
+ #
1699
+ # @example Basic example
1700
+ # require "google/cloud/gke_backup/v1"
1701
+ #
1702
+ # # Create a client object. The client can be reused for multiple calls.
1703
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1704
+ #
1705
+ # # Create a request. To set request fields, pass in keyword arguments.
1706
+ # request = Google::Cloud::GkeBackup::V1::GetRestorePlanRequest.new
1707
+ #
1708
+ # # Call the get_restore_plan method.
1709
+ # result = client.get_restore_plan request
1710
+ #
1711
+ # # The returned object is of type Google::Cloud::GkeBackup::V1::RestorePlan.
1712
+ # p result
1713
+ #
1714
+ def get_restore_plan request, options = nil
1715
+ raise ::ArgumentError, "request must be provided" if request.nil?
1716
+
1717
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest
1718
+
1719
+ # Converts hash and nil to an options object
1720
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1721
+
1722
+ # Customize the options with defaults
1723
+ metadata = @config.rpcs.get_restore_plan.metadata.to_h
1724
+
1725
+ # Set x-goog-api-client and x-goog-user-project headers
1726
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1727
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1728
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1729
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1730
+
1731
+ header_params = {}
1732
+ if request.name
1733
+ header_params["name"] = request.name
1734
+ end
1735
+
1736
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1737
+ metadata[:"x-goog-request-params"] ||= request_params_header
1738
+
1739
+ options.apply_defaults timeout: @config.rpcs.get_restore_plan.timeout,
1740
+ metadata: metadata,
1741
+ retry_policy: @config.rpcs.get_restore_plan.retry_policy
1742
+
1743
+ options.apply_defaults timeout: @config.timeout,
1744
+ metadata: @config.metadata,
1745
+ retry_policy: @config.retry_policy
1746
+
1747
+ @backup_for_gke_stub.call_rpc :get_restore_plan, request, options: options do |response, operation|
1748
+ yield response, operation if block_given?
1749
+ return response
1750
+ end
1751
+ rescue ::GRPC::BadStatus => e
1752
+ raise ::Google::Cloud::Error.from_error(e)
1753
+ end
1754
+
1755
+ ##
1756
+ # Update a RestorePlan.
1757
+ #
1758
+ # @overload update_restore_plan(request, options = nil)
1759
+ # Pass arguments to `update_restore_plan` via a request object, either of type
1760
+ # {::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest} or an equivalent Hash.
1761
+ #
1762
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest, ::Hash]
1763
+ # A request object representing the call parameters. Required. To specify no
1764
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1765
+ # @param options [::Gapic::CallOptions, ::Hash]
1766
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1767
+ #
1768
+ # @overload update_restore_plan(restore_plan: nil, update_mask: nil)
1769
+ # Pass arguments to `update_restore_plan` via keyword arguments. Note that at
1770
+ # least one keyword argument is required. To specify no parameters, or to keep all
1771
+ # the default parameter values, pass an empty Hash as a request object (see above).
1772
+ #
1773
+ # @param restore_plan [::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash]
1774
+ # Required. A new version of the RestorePlan resource that contains updated fields.
1775
+ # This may be sparsely populated if an `update_mask` is provided.
1776
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1777
+ # This is used to specify the fields to be overwritten in the
1778
+ # RestorePlan targeted for update. The values for each of these
1779
+ # updated fields will be taken from the `restore_plan` provided
1780
+ # with this request. Field names are relative to the root of the resource.
1781
+ # If no `update_mask` is provided, all fields in `restore_plan` will be
1782
+ # written to the target RestorePlan resource.
1783
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `restore_plan` are ignored
1784
+ # and are not used to update the target RestorePlan.
1785
+ #
1786
+ # @yield [response, operation] Access the result along with the RPC operation
1787
+ # @yieldparam response [::Gapic::Operation]
1788
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1789
+ #
1790
+ # @return [::Gapic::Operation]
1791
+ #
1792
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1793
+ #
1794
+ # @example Basic example
1795
+ # require "google/cloud/gke_backup/v1"
1796
+ #
1797
+ # # Create a client object. The client can be reused for multiple calls.
1798
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1799
+ #
1800
+ # # Create a request. To set request fields, pass in keyword arguments.
1801
+ # request = Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest.new
1802
+ #
1803
+ # # Call the update_restore_plan method.
1804
+ # result = client.update_restore_plan request
1805
+ #
1806
+ # # The returned object is of type Gapic::Operation. You can use this
1807
+ # # object to check the status of an operation, cancel it, or wait
1808
+ # # for results. Here is how to block until completion:
1809
+ # result.wait_until_done! timeout: 60
1810
+ # if result.response?
1811
+ # p result.response
1812
+ # else
1813
+ # puts "Error!"
1814
+ # end
1815
+ #
1816
+ def update_restore_plan request, options = nil
1817
+ raise ::ArgumentError, "request must be provided" if request.nil?
1818
+
1819
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest
1820
+
1821
+ # Converts hash and nil to an options object
1822
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1823
+
1824
+ # Customize the options with defaults
1825
+ metadata = @config.rpcs.update_restore_plan.metadata.to_h
1826
+
1827
+ # Set x-goog-api-client and x-goog-user-project headers
1828
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1829
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1830
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1831
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1832
+
1833
+ header_params = {}
1834
+ if request.restore_plan&.name
1835
+ header_params["restore_plan.name"] = request.restore_plan.name
1836
+ end
1837
+
1838
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1839
+ metadata[:"x-goog-request-params"] ||= request_params_header
1840
+
1841
+ options.apply_defaults timeout: @config.rpcs.update_restore_plan.timeout,
1842
+ metadata: metadata,
1843
+ retry_policy: @config.rpcs.update_restore_plan.retry_policy
1844
+
1845
+ options.apply_defaults timeout: @config.timeout,
1846
+ metadata: @config.metadata,
1847
+ retry_policy: @config.retry_policy
1848
+
1849
+ @backup_for_gke_stub.call_rpc :update_restore_plan, request, options: options do |response, operation|
1850
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1851
+ yield response, operation if block_given?
1852
+ return response
1853
+ end
1854
+ rescue ::GRPC::BadStatus => e
1855
+ raise ::Google::Cloud::Error.from_error(e)
1856
+ end
1857
+
1858
+ ##
1859
+ # Deletes an existing RestorePlan.
1860
+ #
1861
+ # @overload delete_restore_plan(request, options = nil)
1862
+ # Pass arguments to `delete_restore_plan` via a request object, either of type
1863
+ # {::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest} or an equivalent Hash.
1864
+ #
1865
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest, ::Hash]
1866
+ # A request object representing the call parameters. Required. To specify no
1867
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1868
+ # @param options [::Gapic::CallOptions, ::Hash]
1869
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1870
+ #
1871
+ # @overload delete_restore_plan(name: nil, etag: nil, force: nil)
1872
+ # Pass arguments to `delete_restore_plan` via keyword arguments. Note that at
1873
+ # least one keyword argument is required. To specify no parameters, or to keep all
1874
+ # the default parameter values, pass an empty Hash as a request object (see above).
1875
+ #
1876
+ # @param name [::String]
1877
+ # Required. Fully qualified RestorePlan name.
1878
+ # Format: projects/*/locations/*/restorePlans/*
1879
+ # @param etag [::String]
1880
+ # If provided, this value must match the current value of the
1881
+ # target RestorePlan's {::Google::Cloud::GkeBackup::V1::RestorePlan#etag etag} field or the request is
1882
+ # rejected.
1883
+ # @param force [::Boolean]
1884
+ # If set to true, any Restores below this RestorePlan will also be deleted.
1885
+ # Otherwise, the request will only succeed if the RestorePlan has no
1886
+ # Restores.
1887
+ #
1888
+ # @yield [response, operation] Access the result along with the RPC operation
1889
+ # @yieldparam response [::Gapic::Operation]
1890
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1891
+ #
1892
+ # @return [::Gapic::Operation]
1893
+ #
1894
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1895
+ #
1896
+ # @example Basic example
1897
+ # require "google/cloud/gke_backup/v1"
1898
+ #
1899
+ # # Create a client object. The client can be reused for multiple calls.
1900
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
1901
+ #
1902
+ # # Create a request. To set request fields, pass in keyword arguments.
1903
+ # request = Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest.new
1904
+ #
1905
+ # # Call the delete_restore_plan method.
1906
+ # result = client.delete_restore_plan request
1907
+ #
1908
+ # # The returned object is of type Gapic::Operation. You can use this
1909
+ # # object to check the status of an operation, cancel it, or wait
1910
+ # # for results. Here is how to block until completion:
1911
+ # result.wait_until_done! timeout: 60
1912
+ # if result.response?
1913
+ # p result.response
1914
+ # else
1915
+ # puts "Error!"
1916
+ # end
1917
+ #
1918
+ def delete_restore_plan request, options = nil
1919
+ raise ::ArgumentError, "request must be provided" if request.nil?
1920
+
1921
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest
1922
+
1923
+ # Converts hash and nil to an options object
1924
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1925
+
1926
+ # Customize the options with defaults
1927
+ metadata = @config.rpcs.delete_restore_plan.metadata.to_h
1928
+
1929
+ # Set x-goog-api-client and x-goog-user-project headers
1930
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1931
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1932
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
1933
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1934
+
1935
+ header_params = {}
1936
+ if request.name
1937
+ header_params["name"] = request.name
1938
+ end
1939
+
1940
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1941
+ metadata[:"x-goog-request-params"] ||= request_params_header
1942
+
1943
+ options.apply_defaults timeout: @config.rpcs.delete_restore_plan.timeout,
1944
+ metadata: metadata,
1945
+ retry_policy: @config.rpcs.delete_restore_plan.retry_policy
1946
+
1947
+ options.apply_defaults timeout: @config.timeout,
1948
+ metadata: @config.metadata,
1949
+ retry_policy: @config.retry_policy
1950
+
1951
+ @backup_for_gke_stub.call_rpc :delete_restore_plan, request, options: options do |response, operation|
1952
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1953
+ yield response, operation if block_given?
1954
+ return response
1955
+ end
1956
+ rescue ::GRPC::BadStatus => e
1957
+ raise ::Google::Cloud::Error.from_error(e)
1958
+ end
1959
+
1960
+ ##
1961
+ # Creates a new Restore for the given RestorePlan.
1962
+ #
1963
+ # @overload create_restore(request, options = nil)
1964
+ # Pass arguments to `create_restore` via a request object, either of type
1965
+ # {::Google::Cloud::GkeBackup::V1::CreateRestoreRequest} or an equivalent Hash.
1966
+ #
1967
+ # @param request [::Google::Cloud::GkeBackup::V1::CreateRestoreRequest, ::Hash]
1968
+ # A request object representing the call parameters. Required. To specify no
1969
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1970
+ # @param options [::Gapic::CallOptions, ::Hash]
1971
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1972
+ #
1973
+ # @overload create_restore(parent: nil, restore: nil, restore_id: nil)
1974
+ # Pass arguments to `create_restore` via keyword arguments. Note that at
1975
+ # least one keyword argument is required. To specify no parameters, or to keep all
1976
+ # the default parameter values, pass an empty Hash as a request object (see above).
1977
+ #
1978
+ # @param parent [::String]
1979
+ # Required. The RestorePlan within which to create the Restore.
1980
+ # Format: projects/*/locations/*/restorePlans/*
1981
+ # @param restore [::Google::Cloud::GkeBackup::V1::Restore, ::Hash]
1982
+ # Required. The restore resource to create.
1983
+ # @param restore_id [::String]
1984
+ # Required. The client-provided short name for the Restore resource.
1985
+ # This name must:
1986
+ #
1987
+ # - be between 1 and 63 characters long (inclusive)
1988
+ # - consist of only lower-case ASCII letters, numbers, and dashes
1989
+ # - start with a lower-case letter
1990
+ # - end with a lower-case letter or number
1991
+ # - be unique within the set of Restores in this RestorePlan.
1992
+ #
1993
+ # @yield [response, operation] Access the result along with the RPC operation
1994
+ # @yieldparam response [::Gapic::Operation]
1995
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1996
+ #
1997
+ # @return [::Gapic::Operation]
1998
+ #
1999
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2000
+ #
2001
+ # @example Basic example
2002
+ # require "google/cloud/gke_backup/v1"
2003
+ #
2004
+ # # Create a client object. The client can be reused for multiple calls.
2005
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
2006
+ #
2007
+ # # Create a request. To set request fields, pass in keyword arguments.
2008
+ # request = Google::Cloud::GkeBackup::V1::CreateRestoreRequest.new
2009
+ #
2010
+ # # Call the create_restore method.
2011
+ # result = client.create_restore request
2012
+ #
2013
+ # # The returned object is of type Gapic::Operation. You can use this
2014
+ # # object to check the status of an operation, cancel it, or wait
2015
+ # # for results. Here is how to block until completion:
2016
+ # result.wait_until_done! timeout: 60
2017
+ # if result.response?
2018
+ # p result.response
2019
+ # else
2020
+ # puts "Error!"
2021
+ # end
2022
+ #
2023
+ def create_restore request, options = nil
2024
+ raise ::ArgumentError, "request must be provided" if request.nil?
2025
+
2026
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateRestoreRequest
2027
+
2028
+ # Converts hash and nil to an options object
2029
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2030
+
2031
+ # Customize the options with defaults
2032
+ metadata = @config.rpcs.create_restore.metadata.to_h
2033
+
2034
+ # Set x-goog-api-client and x-goog-user-project headers
2035
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2036
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2037
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
2038
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2039
+
2040
+ header_params = {}
2041
+ if request.parent
2042
+ header_params["parent"] = request.parent
2043
+ end
2044
+
2045
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2046
+ metadata[:"x-goog-request-params"] ||= request_params_header
2047
+
2048
+ options.apply_defaults timeout: @config.rpcs.create_restore.timeout,
2049
+ metadata: metadata,
2050
+ retry_policy: @config.rpcs.create_restore.retry_policy
2051
+
2052
+ options.apply_defaults timeout: @config.timeout,
2053
+ metadata: @config.metadata,
2054
+ retry_policy: @config.retry_policy
2055
+
2056
+ @backup_for_gke_stub.call_rpc :create_restore, request, options: options do |response, operation|
2057
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2058
+ yield response, operation if block_given?
2059
+ return response
2060
+ end
2061
+ rescue ::GRPC::BadStatus => e
2062
+ raise ::Google::Cloud::Error.from_error(e)
2063
+ end
2064
+
2065
+ ##
2066
+ # Lists the Restores for a given RestorePlan.
2067
+ #
2068
+ # @overload list_restores(request, options = nil)
2069
+ # Pass arguments to `list_restores` via a request object, either of type
2070
+ # {::Google::Cloud::GkeBackup::V1::ListRestoresRequest} or an equivalent Hash.
2071
+ #
2072
+ # @param request [::Google::Cloud::GkeBackup::V1::ListRestoresRequest, ::Hash]
2073
+ # A request object representing the call parameters. Required. To specify no
2074
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2075
+ # @param options [::Gapic::CallOptions, ::Hash]
2076
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2077
+ #
2078
+ # @overload list_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2079
+ # Pass arguments to `list_restores` via keyword arguments. Note that at
2080
+ # least one keyword argument is required. To specify no parameters, or to keep all
2081
+ # the default parameter values, pass an empty Hash as a request object (see above).
2082
+ #
2083
+ # @param parent [::String]
2084
+ # Required. The RestorePlan that contains the Restores to list.
2085
+ # Format: projects/*/locations/*/restorePlans/*
2086
+ # @param page_size [::Integer]
2087
+ # The target number of results to return in a single response.
2088
+ # If not specified, a default value will be chosen by the service.
2089
+ # Note that the response may inclue a partial list and a caller should
2090
+ # only rely on the response's
2091
+ # {::Google::Cloud::GkeBackup::V1::ListRestoresResponse#next_page_token next_page_token}
2092
+ # to determine if there are more instances left to be queried.
2093
+ # @param page_token [::String]
2094
+ # The value of
2095
+ # {::Google::Cloud::GkeBackup::V1::ListRestoresResponse#next_page_token next_page_token}
2096
+ # received from a previous `ListRestores` call.
2097
+ # Provide this to retrieve the subsequent page in a multi-page list of
2098
+ # results. When paginating, all other parameters provided to `ListRestores`
2099
+ # must match the call that provided the page token.
2100
+ # @param filter [::String]
2101
+ # Field match expression used to filter the results.
2102
+ # @param order_by [::String]
2103
+ # Field by which to sort the results.
2104
+ #
2105
+ # @yield [response, operation] Access the result along with the RPC operation
2106
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Restore>]
2107
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2108
+ #
2109
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Restore>]
2110
+ #
2111
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2112
+ #
2113
+ # @example Basic example
2114
+ # require "google/cloud/gke_backup/v1"
2115
+ #
2116
+ # # Create a client object. The client can be reused for multiple calls.
2117
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
2118
+ #
2119
+ # # Create a request. To set request fields, pass in keyword arguments.
2120
+ # request = Google::Cloud::GkeBackup::V1::ListRestoresRequest.new
2121
+ #
2122
+ # # Call the list_restores method.
2123
+ # result = client.list_restores request
2124
+ #
2125
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2126
+ # # iterate over all elements by calling #each, and the enumerable
2127
+ # # will lazily make API calls to fetch subsequent pages. Other
2128
+ # # methods are also available for managing paging directly.
2129
+ # result.each do |response|
2130
+ # # Each element is of type ::Google::Cloud::GkeBackup::V1::Restore.
2131
+ # p response
2132
+ # end
2133
+ #
2134
+ def list_restores request, options = nil
2135
+ raise ::ArgumentError, "request must be provided" if request.nil?
2136
+
2137
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListRestoresRequest
2138
+
2139
+ # Converts hash and nil to an options object
2140
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2141
+
2142
+ # Customize the options with defaults
2143
+ metadata = @config.rpcs.list_restores.metadata.to_h
2144
+
2145
+ # Set x-goog-api-client and x-goog-user-project headers
2146
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2147
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2148
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
2149
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2150
+
2151
+ header_params = {}
2152
+ if request.parent
2153
+ header_params["parent"] = request.parent
2154
+ end
2155
+
2156
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2157
+ metadata[:"x-goog-request-params"] ||= request_params_header
2158
+
2159
+ options.apply_defaults timeout: @config.rpcs.list_restores.timeout,
2160
+ metadata: metadata,
2161
+ retry_policy: @config.rpcs.list_restores.retry_policy
2162
+
2163
+ options.apply_defaults timeout: @config.timeout,
2164
+ metadata: @config.metadata,
2165
+ retry_policy: @config.retry_policy
2166
+
2167
+ @backup_for_gke_stub.call_rpc :list_restores, request, options: options do |response, operation|
2168
+ response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_restores, request, response, operation, options
2169
+ yield response, operation if block_given?
2170
+ return response
2171
+ end
2172
+ rescue ::GRPC::BadStatus => e
2173
+ raise ::Google::Cloud::Error.from_error(e)
2174
+ end
2175
+
2176
+ ##
2177
+ # Retrieves the details of a single Restore.
2178
+ #
2179
+ # @overload get_restore(request, options = nil)
2180
+ # Pass arguments to `get_restore` via a request object, either of type
2181
+ # {::Google::Cloud::GkeBackup::V1::GetRestoreRequest} or an equivalent Hash.
2182
+ #
2183
+ # @param request [::Google::Cloud::GkeBackup::V1::GetRestoreRequest, ::Hash]
2184
+ # A request object representing the call parameters. Required. To specify no
2185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2186
+ # @param options [::Gapic::CallOptions, ::Hash]
2187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2188
+ #
2189
+ # @overload get_restore(name: nil)
2190
+ # Pass arguments to `get_restore` via keyword arguments. Note that at
2191
+ # least one keyword argument is required. To specify no parameters, or to keep all
2192
+ # the default parameter values, pass an empty Hash as a request object (see above).
2193
+ #
2194
+ # @param name [::String]
2195
+ # Required. Name of the restore resource.
2196
+ # Format: projects/*/locations/*/restorePlans/*/restores/*
2197
+ #
2198
+ # @yield [response, operation] Access the result along with the RPC operation
2199
+ # @yieldparam response [::Google::Cloud::GkeBackup::V1::Restore]
2200
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2201
+ #
2202
+ # @return [::Google::Cloud::GkeBackup::V1::Restore]
2203
+ #
2204
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2205
+ #
2206
+ # @example Basic example
2207
+ # require "google/cloud/gke_backup/v1"
2208
+ #
2209
+ # # Create a client object. The client can be reused for multiple calls.
2210
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
2211
+ #
2212
+ # # Create a request. To set request fields, pass in keyword arguments.
2213
+ # request = Google::Cloud::GkeBackup::V1::GetRestoreRequest.new
2214
+ #
2215
+ # # Call the get_restore method.
2216
+ # result = client.get_restore request
2217
+ #
2218
+ # # The returned object is of type Google::Cloud::GkeBackup::V1::Restore.
2219
+ # p result
2220
+ #
2221
+ def get_restore request, options = nil
2222
+ raise ::ArgumentError, "request must be provided" if request.nil?
2223
+
2224
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetRestoreRequest
2225
+
2226
+ # Converts hash and nil to an options object
2227
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2228
+
2229
+ # Customize the options with defaults
2230
+ metadata = @config.rpcs.get_restore.metadata.to_h
2231
+
2232
+ # Set x-goog-api-client and x-goog-user-project headers
2233
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2234
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2235
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
2236
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2237
+
2238
+ header_params = {}
2239
+ if request.name
2240
+ header_params["name"] = request.name
2241
+ end
2242
+
2243
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2244
+ metadata[:"x-goog-request-params"] ||= request_params_header
2245
+
2246
+ options.apply_defaults timeout: @config.rpcs.get_restore.timeout,
2247
+ metadata: metadata,
2248
+ retry_policy: @config.rpcs.get_restore.retry_policy
2249
+
2250
+ options.apply_defaults timeout: @config.timeout,
2251
+ metadata: @config.metadata,
2252
+ retry_policy: @config.retry_policy
2253
+
2254
+ @backup_for_gke_stub.call_rpc :get_restore, request, options: options do |response, operation|
2255
+ yield response, operation if block_given?
2256
+ return response
2257
+ end
2258
+ rescue ::GRPC::BadStatus => e
2259
+ raise ::Google::Cloud::Error.from_error(e)
2260
+ end
2261
+
2262
+ ##
2263
+ # Update a Restore.
2264
+ #
2265
+ # @overload update_restore(request, options = nil)
2266
+ # Pass arguments to `update_restore` via a request object, either of type
2267
+ # {::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest} or an equivalent Hash.
2268
+ #
2269
+ # @param request [::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest, ::Hash]
2270
+ # A request object representing the call parameters. Required. To specify no
2271
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2272
+ # @param options [::Gapic::CallOptions, ::Hash]
2273
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2274
+ #
2275
+ # @overload update_restore(restore: nil, update_mask: nil)
2276
+ # Pass arguments to `update_restore` via keyword arguments. Note that at
2277
+ # least one keyword argument is required. To specify no parameters, or to keep all
2278
+ # the default parameter values, pass an empty Hash as a request object (see above).
2279
+ #
2280
+ # @param restore [::Google::Cloud::GkeBackup::V1::Restore, ::Hash]
2281
+ # Required. A new version of the Restore resource that contains updated fields.
2282
+ # This may be sparsely populated if an `update_mask` is provided.
2283
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2284
+ # This is used to specify the fields to be overwritten in the
2285
+ # Restore targeted for update. The values for each of these
2286
+ # updated fields will be taken from the `restore` provided
2287
+ # with this request. Field names are relative to the root of the resource.
2288
+ # If no `update_mask` is provided, all fields in `restore` will be
2289
+ # written to the target Restore resource.
2290
+ # Note that OUTPUT_ONLY and IMMUTABLE fields in `restore` are ignored
2291
+ # and are not used to update the target Restore.
2292
+ #
2293
+ # @yield [response, operation] Access the result along with the RPC operation
2294
+ # @yieldparam response [::Gapic::Operation]
2295
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2296
+ #
2297
+ # @return [::Gapic::Operation]
2298
+ #
2299
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2300
+ #
2301
+ # @example Basic example
2302
+ # require "google/cloud/gke_backup/v1"
2303
+ #
2304
+ # # Create a client object. The client can be reused for multiple calls.
2305
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
2306
+ #
2307
+ # # Create a request. To set request fields, pass in keyword arguments.
2308
+ # request = Google::Cloud::GkeBackup::V1::UpdateRestoreRequest.new
2309
+ #
2310
+ # # Call the update_restore method.
2311
+ # result = client.update_restore request
2312
+ #
2313
+ # # The returned object is of type Gapic::Operation. You can use this
2314
+ # # object to check the status of an operation, cancel it, or wait
2315
+ # # for results. Here is how to block until completion:
2316
+ # result.wait_until_done! timeout: 60
2317
+ # if result.response?
2318
+ # p result.response
2319
+ # else
2320
+ # puts "Error!"
2321
+ # end
2322
+ #
2323
+ def update_restore request, options = nil
2324
+ raise ::ArgumentError, "request must be provided" if request.nil?
2325
+
2326
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest
2327
+
2328
+ # Converts hash and nil to an options object
2329
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2330
+
2331
+ # Customize the options with defaults
2332
+ metadata = @config.rpcs.update_restore.metadata.to_h
2333
+
2334
+ # Set x-goog-api-client and x-goog-user-project headers
2335
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2336
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2337
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
2338
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2339
+
2340
+ header_params = {}
2341
+ if request.restore&.name
2342
+ header_params["restore.name"] = request.restore.name
2343
+ end
2344
+
2345
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2346
+ metadata[:"x-goog-request-params"] ||= request_params_header
2347
+
2348
+ options.apply_defaults timeout: @config.rpcs.update_restore.timeout,
2349
+ metadata: metadata,
2350
+ retry_policy: @config.rpcs.update_restore.retry_policy
2351
+
2352
+ options.apply_defaults timeout: @config.timeout,
2353
+ metadata: @config.metadata,
2354
+ retry_policy: @config.retry_policy
2355
+
2356
+ @backup_for_gke_stub.call_rpc :update_restore, request, options: options do |response, operation|
2357
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2358
+ yield response, operation if block_given?
2359
+ return response
2360
+ end
2361
+ rescue ::GRPC::BadStatus => e
2362
+ raise ::Google::Cloud::Error.from_error(e)
2363
+ end
2364
+
2365
+ ##
2366
+ # Deletes an existing Restore.
2367
+ #
2368
+ # @overload delete_restore(request, options = nil)
2369
+ # Pass arguments to `delete_restore` via a request object, either of type
2370
+ # {::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest} or an equivalent Hash.
2371
+ #
2372
+ # @param request [::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest, ::Hash]
2373
+ # A request object representing the call parameters. Required. To specify no
2374
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2375
+ # @param options [::Gapic::CallOptions, ::Hash]
2376
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2377
+ #
2378
+ # @overload delete_restore(name: nil, etag: nil, force: nil)
2379
+ # Pass arguments to `delete_restore` via keyword arguments. Note that at
2380
+ # least one keyword argument is required. To specify no parameters, or to keep all
2381
+ # the default parameter values, pass an empty Hash as a request object (see above).
2382
+ #
2383
+ # @param name [::String]
2384
+ # Required. Full name of the Restore
2385
+ # Format: projects/*/locations/*/restorePlans/*/restores/*
2386
+ # @param etag [::String]
2387
+ # If provided, this value must match the current value of the
2388
+ # target Restore's {::Google::Cloud::GkeBackup::V1::Restore#etag etag} field or the request is
2389
+ # rejected.
2390
+ # @param force [::Boolean]
2391
+ # If set to true, any VolumeRestores below this restore will also be deleted.
2392
+ # Otherwise, the request will only succeed if the restore has no
2393
+ # VolumeRestores.
2394
+ #
2395
+ # @yield [response, operation] Access the result along with the RPC operation
2396
+ # @yieldparam response [::Gapic::Operation]
2397
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2398
+ #
2399
+ # @return [::Gapic::Operation]
2400
+ #
2401
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2402
+ #
2403
+ # @example Basic example
2404
+ # require "google/cloud/gke_backup/v1"
2405
+ #
2406
+ # # Create a client object. The client can be reused for multiple calls.
2407
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
2408
+ #
2409
+ # # Create a request. To set request fields, pass in keyword arguments.
2410
+ # request = Google::Cloud::GkeBackup::V1::DeleteRestoreRequest.new
2411
+ #
2412
+ # # Call the delete_restore method.
2413
+ # result = client.delete_restore request
2414
+ #
2415
+ # # The returned object is of type Gapic::Operation. You can use this
2416
+ # # object to check the status of an operation, cancel it, or wait
2417
+ # # for results. Here is how to block until completion:
2418
+ # result.wait_until_done! timeout: 60
2419
+ # if result.response?
2420
+ # p result.response
2421
+ # else
2422
+ # puts "Error!"
2423
+ # end
2424
+ #
2425
+ def delete_restore request, options = nil
2426
+ raise ::ArgumentError, "request must be provided" if request.nil?
2427
+
2428
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest
2429
+
2430
+ # Converts hash and nil to an options object
2431
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2432
+
2433
+ # Customize the options with defaults
2434
+ metadata = @config.rpcs.delete_restore.metadata.to_h
2435
+
2436
+ # Set x-goog-api-client and x-goog-user-project headers
2437
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2438
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2439
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
2440
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2441
+
2442
+ header_params = {}
2443
+ if request.name
2444
+ header_params["name"] = request.name
2445
+ end
2446
+
2447
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2448
+ metadata[:"x-goog-request-params"] ||= request_params_header
2449
+
2450
+ options.apply_defaults timeout: @config.rpcs.delete_restore.timeout,
2451
+ metadata: metadata,
2452
+ retry_policy: @config.rpcs.delete_restore.retry_policy
2453
+
2454
+ options.apply_defaults timeout: @config.timeout,
2455
+ metadata: @config.metadata,
2456
+ retry_policy: @config.retry_policy
2457
+
2458
+ @backup_for_gke_stub.call_rpc :delete_restore, request, options: options do |response, operation|
2459
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2460
+ yield response, operation if block_given?
2461
+ return response
2462
+ end
2463
+ rescue ::GRPC::BadStatus => e
2464
+ raise ::Google::Cloud::Error.from_error(e)
2465
+ end
2466
+
2467
+ ##
2468
+ # Lists the VolumeRestores for a given Restore.
2469
+ #
2470
+ # @overload list_volume_restores(request, options = nil)
2471
+ # Pass arguments to `list_volume_restores` via a request object, either of type
2472
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest} or an equivalent Hash.
2473
+ #
2474
+ # @param request [::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest, ::Hash]
2475
+ # A request object representing the call parameters. Required. To specify no
2476
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2477
+ # @param options [::Gapic::CallOptions, ::Hash]
2478
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2479
+ #
2480
+ # @overload list_volume_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2481
+ # Pass arguments to `list_volume_restores` via keyword arguments. Note that at
2482
+ # least one keyword argument is required. To specify no parameters, or to keep all
2483
+ # the default parameter values, pass an empty Hash as a request object (see above).
2484
+ #
2485
+ # @param parent [::String]
2486
+ # Required. The Restore that contains the VolumeRestores to list.
2487
+ # Format: projects/*/locations/*/restorePlans/*/restores/*
2488
+ # @param page_size [::Integer]
2489
+ # The target number of results to return in a single response.
2490
+ # If not specified, a default value will be chosen by the service.
2491
+ # Note that the response may inclue a partial list and a caller should
2492
+ # only rely on the response's
2493
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresResponse#next_page_token next_page_token}
2494
+ # to determine if there are more instances left to be queried.
2495
+ # @param page_token [::String]
2496
+ # The value of
2497
+ # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresResponse#next_page_token next_page_token}
2498
+ # received from a previous `ListVolumeRestores` call.
2499
+ # Provide this to retrieve the subsequent page in a multi-page list of
2500
+ # results. When paginating, all other parameters provided to
2501
+ # `ListVolumeRestores` must match the call that provided the page token.
2502
+ # @param filter [::String]
2503
+ # Field match expression used to filter the results.
2504
+ # @param order_by [::String]
2505
+ # Field by which to sort the results.
2506
+ #
2507
+ # @yield [response, operation] Access the result along with the RPC operation
2508
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>]
2509
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2510
+ #
2511
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>]
2512
+ #
2513
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2514
+ #
2515
+ # @example Basic example
2516
+ # require "google/cloud/gke_backup/v1"
2517
+ #
2518
+ # # Create a client object. The client can be reused for multiple calls.
2519
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
2520
+ #
2521
+ # # Create a request. To set request fields, pass in keyword arguments.
2522
+ # request = Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest.new
2523
+ #
2524
+ # # Call the list_volume_restores method.
2525
+ # result = client.list_volume_restores request
2526
+ #
2527
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2528
+ # # iterate over all elements by calling #each, and the enumerable
2529
+ # # will lazily make API calls to fetch subsequent pages. Other
2530
+ # # methods are also available for managing paging directly.
2531
+ # result.each do |response|
2532
+ # # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeRestore.
2533
+ # p response
2534
+ # end
2535
+ #
2536
+ def list_volume_restores request, options = nil
2537
+ raise ::ArgumentError, "request must be provided" if request.nil?
2538
+
2539
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest
2540
+
2541
+ # Converts hash and nil to an options object
2542
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2543
+
2544
+ # Customize the options with defaults
2545
+ metadata = @config.rpcs.list_volume_restores.metadata.to_h
2546
+
2547
+ # Set x-goog-api-client and x-goog-user-project headers
2548
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2549
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2550
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
2551
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2552
+
2553
+ header_params = {}
2554
+ if request.parent
2555
+ header_params["parent"] = request.parent
2556
+ end
2557
+
2558
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2559
+ metadata[:"x-goog-request-params"] ||= request_params_header
2560
+
2561
+ options.apply_defaults timeout: @config.rpcs.list_volume_restores.timeout,
2562
+ metadata: metadata,
2563
+ retry_policy: @config.rpcs.list_volume_restores.retry_policy
2564
+
2565
+ options.apply_defaults timeout: @config.timeout,
2566
+ metadata: @config.metadata,
2567
+ retry_policy: @config.retry_policy
2568
+
2569
+ @backup_for_gke_stub.call_rpc :list_volume_restores, request, options: options do |response, operation|
2570
+ response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_volume_restores, request, response, operation, options
2571
+ yield response, operation if block_given?
2572
+ return response
2573
+ end
2574
+ rescue ::GRPC::BadStatus => e
2575
+ raise ::Google::Cloud::Error.from_error(e)
2576
+ end
2577
+
2578
+ ##
2579
+ # Retrieve the details of a single VolumeRestore.
2580
+ #
2581
+ # @overload get_volume_restore(request, options = nil)
2582
+ # Pass arguments to `get_volume_restore` via a request object, either of type
2583
+ # {::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest} or an equivalent Hash.
2584
+ #
2585
+ # @param request [::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest, ::Hash]
2586
+ # A request object representing the call parameters. Required. To specify no
2587
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2588
+ # @param options [::Gapic::CallOptions, ::Hash]
2589
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2590
+ #
2591
+ # @overload get_volume_restore(name: nil)
2592
+ # Pass arguments to `get_volume_restore` via keyword arguments. Note that at
2593
+ # least one keyword argument is required. To specify no parameters, or to keep all
2594
+ # the default parameter values, pass an empty Hash as a request object (see above).
2595
+ #
2596
+ # @param name [::String]
2597
+ # Required. Full name of the VolumeRestore resource.
2598
+ # Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*
2599
+ #
2600
+ # @yield [response, operation] Access the result along with the RPC operation
2601
+ # @yieldparam response [::Google::Cloud::GkeBackup::V1::VolumeRestore]
2602
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2603
+ #
2604
+ # @return [::Google::Cloud::GkeBackup::V1::VolumeRestore]
2605
+ #
2606
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2607
+ #
2608
+ # @example Basic example
2609
+ # require "google/cloud/gke_backup/v1"
2610
+ #
2611
+ # # Create a client object. The client can be reused for multiple calls.
2612
+ # client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new
2613
+ #
2614
+ # # Create a request. To set request fields, pass in keyword arguments.
2615
+ # request = Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest.new
2616
+ #
2617
+ # # Call the get_volume_restore method.
2618
+ # result = client.get_volume_restore request
2619
+ #
2620
+ # # The returned object is of type Google::Cloud::GkeBackup::V1::VolumeRestore.
2621
+ # p result
2622
+ #
2623
+ def get_volume_restore request, options = nil
2624
+ raise ::ArgumentError, "request must be provided" if request.nil?
2625
+
2626
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest
2627
+
2628
+ # Converts hash and nil to an options object
2629
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2630
+
2631
+ # Customize the options with defaults
2632
+ metadata = @config.rpcs.get_volume_restore.metadata.to_h
2633
+
2634
+ # Set x-goog-api-client and x-goog-user-project headers
2635
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2636
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2637
+ gapic_version: ::Google::Cloud::GkeBackup::V1::VERSION
2638
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2639
+
2640
+ header_params = {}
2641
+ if request.name
2642
+ header_params["name"] = request.name
2643
+ end
2644
+
2645
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2646
+ metadata[:"x-goog-request-params"] ||= request_params_header
2647
+
2648
+ options.apply_defaults timeout: @config.rpcs.get_volume_restore.timeout,
2649
+ metadata: metadata,
2650
+ retry_policy: @config.rpcs.get_volume_restore.retry_policy
2651
+
2652
+ options.apply_defaults timeout: @config.timeout,
2653
+ metadata: @config.metadata,
2654
+ retry_policy: @config.retry_policy
2655
+
2656
+ @backup_for_gke_stub.call_rpc :get_volume_restore, request, options: options do |response, operation|
2657
+ yield response, operation if block_given?
2658
+ return response
2659
+ end
2660
+ rescue ::GRPC::BadStatus => e
2661
+ raise ::Google::Cloud::Error.from_error(e)
2662
+ end
2663
+
2664
+ ##
2665
+ # Configuration class for the BackupForGKE API.
2666
+ #
2667
+ # This class represents the configuration for BackupForGKE,
2668
+ # providing control over timeouts, retry behavior, logging, transport
2669
+ # parameters, and other low-level controls. Certain parameters can also be
2670
+ # applied individually to specific RPCs. See
2671
+ # {::Google::Cloud::GkeBackup::V1::BackupForGKE::Client::Configuration::Rpcs}
2672
+ # for a list of RPCs that can be configured independently.
2673
+ #
2674
+ # Configuration can be applied globally to all clients, or to a single client
2675
+ # on construction.
2676
+ #
2677
+ # @example
2678
+ #
2679
+ # # Modify the global config, setting the timeout for
2680
+ # # create_backup_plan to 20 seconds,
2681
+ # # and all remaining timeouts to 10 seconds.
2682
+ # ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.configure do |config|
2683
+ # config.timeout = 10.0
2684
+ # config.rpcs.create_backup_plan.timeout = 20.0
2685
+ # end
2686
+ #
2687
+ # # Apply the above configuration only to a new client.
2688
+ # client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config|
2689
+ # config.timeout = 10.0
2690
+ # config.rpcs.create_backup_plan.timeout = 20.0
2691
+ # end
2692
+ #
2693
+ # @!attribute [rw] endpoint
2694
+ # The hostname or hostname:port of the service endpoint.
2695
+ # Defaults to `"gkebackup.googleapis.com"`.
2696
+ # @return [::String]
2697
+ # @!attribute [rw] credentials
2698
+ # Credentials to send with calls. You may provide any of the following types:
2699
+ # * (`String`) The path to a service account key file in JSON format
2700
+ # * (`Hash`) A service account key as a Hash
2701
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2702
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2703
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2704
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2705
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2706
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2707
+ # * (`nil`) indicating no credentials
2708
+ # @return [::Object]
2709
+ # @!attribute [rw] scope
2710
+ # The OAuth scopes
2711
+ # @return [::Array<::String>]
2712
+ # @!attribute [rw] lib_name
2713
+ # The library name as recorded in instrumentation and logging
2714
+ # @return [::String]
2715
+ # @!attribute [rw] lib_version
2716
+ # The library version as recorded in instrumentation and logging
2717
+ # @return [::String]
2718
+ # @!attribute [rw] channel_args
2719
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2720
+ # `GRPC::Core::Channel` object is provided as the credential.
2721
+ # @return [::Hash]
2722
+ # @!attribute [rw] interceptors
2723
+ # An array of interceptors that are run before calls are executed.
2724
+ # @return [::Array<::GRPC::ClientInterceptor>]
2725
+ # @!attribute [rw] timeout
2726
+ # The call timeout in seconds.
2727
+ # @return [::Numeric]
2728
+ # @!attribute [rw] metadata
2729
+ # Additional gRPC headers to be sent with the call.
2730
+ # @return [::Hash{::Symbol=>::String}]
2731
+ # @!attribute [rw] retry_policy
2732
+ # The retry policy. The value is a hash with the following keys:
2733
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2734
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2735
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2736
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2737
+ # trigger a retry.
2738
+ # @return [::Hash]
2739
+ # @!attribute [rw] quota_project
2740
+ # A separate project against which to charge quota.
2741
+ # @return [::String]
2742
+ #
2743
+ class Configuration
2744
+ extend ::Gapic::Config
2745
+
2746
+ config_attr :endpoint, "gkebackup.googleapis.com", ::String
2747
+ config_attr :credentials, nil do |value|
2748
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2749
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
2750
+ allowed.any? { |klass| klass === value }
2751
+ end
2752
+ config_attr :scope, nil, ::String, ::Array, nil
2753
+ config_attr :lib_name, nil, ::String, nil
2754
+ config_attr :lib_version, nil, ::String, nil
2755
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2756
+ config_attr :interceptors, nil, ::Array, nil
2757
+ config_attr :timeout, nil, ::Numeric, nil
2758
+ config_attr :metadata, nil, ::Hash, nil
2759
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2760
+ config_attr :quota_project, nil, ::String, nil
2761
+
2762
+ # @private
2763
+ def initialize parent_config = nil
2764
+ @parent_config = parent_config unless parent_config.nil?
2765
+
2766
+ yield self if block_given?
2767
+ end
2768
+
2769
+ ##
2770
+ # Configurations for individual RPCs
2771
+ # @return [Rpcs]
2772
+ #
2773
+ def rpcs
2774
+ @rpcs ||= begin
2775
+ parent_rpcs = nil
2776
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2777
+ Rpcs.new parent_rpcs
2778
+ end
2779
+ end
2780
+
2781
+ ##
2782
+ # Configuration RPC class for the BackupForGKE API.
2783
+ #
2784
+ # Includes fields providing the configuration for each RPC in this service.
2785
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2786
+ # the following configuration fields:
2787
+ #
2788
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2789
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2790
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2791
+ # include the following keys:
2792
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2793
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2794
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2795
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2796
+ # trigger a retry.
2797
+ #
2798
+ class Rpcs
2799
+ ##
2800
+ # RPC-specific configuration for `create_backup_plan`
2801
+ # @return [::Gapic::Config::Method]
2802
+ #
2803
+ attr_reader :create_backup_plan
2804
+ ##
2805
+ # RPC-specific configuration for `list_backup_plans`
2806
+ # @return [::Gapic::Config::Method]
2807
+ #
2808
+ attr_reader :list_backup_plans
2809
+ ##
2810
+ # RPC-specific configuration for `get_backup_plan`
2811
+ # @return [::Gapic::Config::Method]
2812
+ #
2813
+ attr_reader :get_backup_plan
2814
+ ##
2815
+ # RPC-specific configuration for `update_backup_plan`
2816
+ # @return [::Gapic::Config::Method]
2817
+ #
2818
+ attr_reader :update_backup_plan
2819
+ ##
2820
+ # RPC-specific configuration for `delete_backup_plan`
2821
+ # @return [::Gapic::Config::Method]
2822
+ #
2823
+ attr_reader :delete_backup_plan
2824
+ ##
2825
+ # RPC-specific configuration for `create_backup`
2826
+ # @return [::Gapic::Config::Method]
2827
+ #
2828
+ attr_reader :create_backup
2829
+ ##
2830
+ # RPC-specific configuration for `list_backups`
2831
+ # @return [::Gapic::Config::Method]
2832
+ #
2833
+ attr_reader :list_backups
2834
+ ##
2835
+ # RPC-specific configuration for `get_backup`
2836
+ # @return [::Gapic::Config::Method]
2837
+ #
2838
+ attr_reader :get_backup
2839
+ ##
2840
+ # RPC-specific configuration for `update_backup`
2841
+ # @return [::Gapic::Config::Method]
2842
+ #
2843
+ attr_reader :update_backup
2844
+ ##
2845
+ # RPC-specific configuration for `delete_backup`
2846
+ # @return [::Gapic::Config::Method]
2847
+ #
2848
+ attr_reader :delete_backup
2849
+ ##
2850
+ # RPC-specific configuration for `list_volume_backups`
2851
+ # @return [::Gapic::Config::Method]
2852
+ #
2853
+ attr_reader :list_volume_backups
2854
+ ##
2855
+ # RPC-specific configuration for `get_volume_backup`
2856
+ # @return [::Gapic::Config::Method]
2857
+ #
2858
+ attr_reader :get_volume_backup
2859
+ ##
2860
+ # RPC-specific configuration for `create_restore_plan`
2861
+ # @return [::Gapic::Config::Method]
2862
+ #
2863
+ attr_reader :create_restore_plan
2864
+ ##
2865
+ # RPC-specific configuration for `list_restore_plans`
2866
+ # @return [::Gapic::Config::Method]
2867
+ #
2868
+ attr_reader :list_restore_plans
2869
+ ##
2870
+ # RPC-specific configuration for `get_restore_plan`
2871
+ # @return [::Gapic::Config::Method]
2872
+ #
2873
+ attr_reader :get_restore_plan
2874
+ ##
2875
+ # RPC-specific configuration for `update_restore_plan`
2876
+ # @return [::Gapic::Config::Method]
2877
+ #
2878
+ attr_reader :update_restore_plan
2879
+ ##
2880
+ # RPC-specific configuration for `delete_restore_plan`
2881
+ # @return [::Gapic::Config::Method]
2882
+ #
2883
+ attr_reader :delete_restore_plan
2884
+ ##
2885
+ # RPC-specific configuration for `create_restore`
2886
+ # @return [::Gapic::Config::Method]
2887
+ #
2888
+ attr_reader :create_restore
2889
+ ##
2890
+ # RPC-specific configuration for `list_restores`
2891
+ # @return [::Gapic::Config::Method]
2892
+ #
2893
+ attr_reader :list_restores
2894
+ ##
2895
+ # RPC-specific configuration for `get_restore`
2896
+ # @return [::Gapic::Config::Method]
2897
+ #
2898
+ attr_reader :get_restore
2899
+ ##
2900
+ # RPC-specific configuration for `update_restore`
2901
+ # @return [::Gapic::Config::Method]
2902
+ #
2903
+ attr_reader :update_restore
2904
+ ##
2905
+ # RPC-specific configuration for `delete_restore`
2906
+ # @return [::Gapic::Config::Method]
2907
+ #
2908
+ attr_reader :delete_restore
2909
+ ##
2910
+ # RPC-specific configuration for `list_volume_restores`
2911
+ # @return [::Gapic::Config::Method]
2912
+ #
2913
+ attr_reader :list_volume_restores
2914
+ ##
2915
+ # RPC-specific configuration for `get_volume_restore`
2916
+ # @return [::Gapic::Config::Method]
2917
+ #
2918
+ attr_reader :get_volume_restore
2919
+
2920
+ # @private
2921
+ def initialize parent_rpcs = nil
2922
+ create_backup_plan_config = parent_rpcs.create_backup_plan if parent_rpcs.respond_to? :create_backup_plan
2923
+ @create_backup_plan = ::Gapic::Config::Method.new create_backup_plan_config
2924
+ list_backup_plans_config = parent_rpcs.list_backup_plans if parent_rpcs.respond_to? :list_backup_plans
2925
+ @list_backup_plans = ::Gapic::Config::Method.new list_backup_plans_config
2926
+ get_backup_plan_config = parent_rpcs.get_backup_plan if parent_rpcs.respond_to? :get_backup_plan
2927
+ @get_backup_plan = ::Gapic::Config::Method.new get_backup_plan_config
2928
+ update_backup_plan_config = parent_rpcs.update_backup_plan if parent_rpcs.respond_to? :update_backup_plan
2929
+ @update_backup_plan = ::Gapic::Config::Method.new update_backup_plan_config
2930
+ delete_backup_plan_config = parent_rpcs.delete_backup_plan if parent_rpcs.respond_to? :delete_backup_plan
2931
+ @delete_backup_plan = ::Gapic::Config::Method.new delete_backup_plan_config
2932
+ create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
2933
+ @create_backup = ::Gapic::Config::Method.new create_backup_config
2934
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
2935
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
2936
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2937
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
2938
+ update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
2939
+ @update_backup = ::Gapic::Config::Method.new update_backup_config
2940
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
2941
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
2942
+ list_volume_backups_config = parent_rpcs.list_volume_backups if parent_rpcs.respond_to? :list_volume_backups
2943
+ @list_volume_backups = ::Gapic::Config::Method.new list_volume_backups_config
2944
+ get_volume_backup_config = parent_rpcs.get_volume_backup if parent_rpcs.respond_to? :get_volume_backup
2945
+ @get_volume_backup = ::Gapic::Config::Method.new get_volume_backup_config
2946
+ create_restore_plan_config = parent_rpcs.create_restore_plan if parent_rpcs.respond_to? :create_restore_plan
2947
+ @create_restore_plan = ::Gapic::Config::Method.new create_restore_plan_config
2948
+ list_restore_plans_config = parent_rpcs.list_restore_plans if parent_rpcs.respond_to? :list_restore_plans
2949
+ @list_restore_plans = ::Gapic::Config::Method.new list_restore_plans_config
2950
+ get_restore_plan_config = parent_rpcs.get_restore_plan if parent_rpcs.respond_to? :get_restore_plan
2951
+ @get_restore_plan = ::Gapic::Config::Method.new get_restore_plan_config
2952
+ update_restore_plan_config = parent_rpcs.update_restore_plan if parent_rpcs.respond_to? :update_restore_plan
2953
+ @update_restore_plan = ::Gapic::Config::Method.new update_restore_plan_config
2954
+ delete_restore_plan_config = parent_rpcs.delete_restore_plan if parent_rpcs.respond_to? :delete_restore_plan
2955
+ @delete_restore_plan = ::Gapic::Config::Method.new delete_restore_plan_config
2956
+ create_restore_config = parent_rpcs.create_restore if parent_rpcs.respond_to? :create_restore
2957
+ @create_restore = ::Gapic::Config::Method.new create_restore_config
2958
+ list_restores_config = parent_rpcs.list_restores if parent_rpcs.respond_to? :list_restores
2959
+ @list_restores = ::Gapic::Config::Method.new list_restores_config
2960
+ get_restore_config = parent_rpcs.get_restore if parent_rpcs.respond_to? :get_restore
2961
+ @get_restore = ::Gapic::Config::Method.new get_restore_config
2962
+ update_restore_config = parent_rpcs.update_restore if parent_rpcs.respond_to? :update_restore
2963
+ @update_restore = ::Gapic::Config::Method.new update_restore_config
2964
+ delete_restore_config = parent_rpcs.delete_restore if parent_rpcs.respond_to? :delete_restore
2965
+ @delete_restore = ::Gapic::Config::Method.new delete_restore_config
2966
+ list_volume_restores_config = parent_rpcs.list_volume_restores if parent_rpcs.respond_to? :list_volume_restores
2967
+ @list_volume_restores = ::Gapic::Config::Method.new list_volume_restores_config
2968
+ get_volume_restore_config = parent_rpcs.get_volume_restore if parent_rpcs.respond_to? :get_volume_restore
2969
+ @get_volume_restore = ::Gapic::Config::Method.new get_volume_restore_config
2970
+
2971
+ yield self if block_given?
2972
+ end
2973
+ end
2974
+ end
2975
+ end
2976
+ end
2977
+ end
2978
+ end
2979
+ end
2980
+ end