google-cloud-backupdr-v1 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -6
  3. data/lib/google/cloud/backupdr/v1/appliedautoprotectionpolicy_pb.rb +30 -0
  4. data/lib/google/cloud/backupdr/v1/autoprotectionpolicy_pb.rb +40 -0
  5. data/lib/google/cloud/backupdr/v1/autoprotectionpolicybinding_pb.rb +33 -0
  6. data/lib/google/cloud/backupdr/v1/backupdr/client.rb +3484 -150
  7. data/lib/google/cloud/backupdr/v1/backupdr/paths.rb +139 -0
  8. data/lib/google/cloud/backupdr/v1/backupdr/rest/client.rb +3268 -137
  9. data/lib/google/cloud/backupdr/v1/backupdr/rest/service_stub.rb +1989 -209
  10. data/lib/google/cloud/backupdr/v1/backupdr_pb.rb +9 -1
  11. data/lib/google/cloud/backupdr/v1/backupdr_services_pb.rb +69 -0
  12. data/lib/google/cloud/backupdr/v1/backupplanassociation_pb.rb +1 -1
  13. data/lib/google/cloud/backupdr/v1/backupvault_pb.rb +3 -1
  14. data/lib/google/cloud/backupdr/v1/bindingmatchingresource_pb.rb +30 -0
  15. data/lib/google/cloud/backupdr/v1/restore_template_common_pb.rb +28 -0
  16. data/lib/google/cloud/backupdr/v1/restore_template_execution_pb.rb +45 -0
  17. data/lib/google/cloud/backupdr/v1/restore_template_pb.rb +40 -0
  18. data/lib/google/cloud/backupdr/v1/restore_verification_plan_association_pb.rb +36 -0
  19. data/lib/google/cloud/backupdr/v1/restore_verification_plan_pb.rb +34 -0
  20. data/lib/google/cloud/backupdr/v1/version.rb +1 -1
  21. data/proto_docs/google/cloud/backupdr/v1/appliedautoprotectionpolicy.rb +123 -0
  22. data/proto_docs/google/cloud/backupdr/v1/autoprotectionpolicy.rb +307 -0
  23. data/proto_docs/google/cloud/backupdr/v1/autoprotectionpolicybinding.rb +207 -0
  24. data/proto_docs/google/cloud/backupdr/v1/backupplanassociation.rb +13 -1
  25. data/proto_docs/google/cloud/backupdr/v1/backupvault.rb +37 -0
  26. data/proto_docs/google/cloud/backupdr/v1/bindingmatchingresource.rb +149 -0
  27. data/proto_docs/google/cloud/backupdr/v1/restore_template.rb +292 -0
  28. data/proto_docs/google/cloud/backupdr/v1/restore_template_common.rb +80 -0
  29. data/proto_docs/google/cloud/backupdr/v1/restore_template_execution.rb +399 -0
  30. data/proto_docs/google/cloud/backupdr/v1/restore_verification_plan.rb +270 -0
  31. data/proto_docs/google/cloud/backupdr/v1/restore_verification_plan_association.rb +264 -0
  32. data/proto_docs/google/protobuf/struct.rb +108 -0
  33. metadata +20 -1
@@ -144,6 +144,106 @@ module Google
144
144
  initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
145
145
  }
146
146
 
147
+ default_config.rpcs.create_auto_protection_policy.timeout = 60.0
148
+
149
+ default_config.rpcs.list_auto_protection_policies.timeout = 60.0
150
+ default_config.rpcs.list_auto_protection_policies.retry_policy = {
151
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
152
+ }
153
+
154
+ default_config.rpcs.get_auto_protection_policy.timeout = 60.0
155
+ default_config.rpcs.get_auto_protection_policy.retry_policy = {
156
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
157
+ }
158
+
159
+ default_config.rpcs.update_auto_protection_policy.timeout = 60.0
160
+
161
+ default_config.rpcs.delete_auto_protection_policy.timeout = 60.0
162
+
163
+ default_config.rpcs.create_auto_protection_policy_binding.timeout = 60.0
164
+
165
+ default_config.rpcs.get_auto_protection_policy_binding.timeout = 60.0
166
+ default_config.rpcs.get_auto_protection_policy_binding.retry_policy = {
167
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
168
+ }
169
+
170
+ default_config.rpcs.list_auto_protection_policy_bindings.timeout = 60.0
171
+ default_config.rpcs.list_auto_protection_policy_bindings.retry_policy = {
172
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
173
+ }
174
+
175
+ default_config.rpcs.list_applied_auto_protection_policies.timeout = 60.0
176
+ default_config.rpcs.list_applied_auto_protection_policies.retry_policy = {
177
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
178
+ }
179
+
180
+ default_config.rpcs.initiate_delete_auto_protection_policy_binding.timeout = 60.0
181
+
182
+ default_config.rpcs.list_binding_matching_resources.timeout = 60.0
183
+ default_config.rpcs.list_binding_matching_resources.retry_policy = {
184
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
185
+ }
186
+
187
+ default_config.rpcs.create_restore_template.timeout = 60.0
188
+
189
+ default_config.rpcs.get_restore_template.timeout = 60.0
190
+ default_config.rpcs.get_restore_template.retry_policy = {
191
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
192
+ }
193
+
194
+ default_config.rpcs.list_restore_templates.timeout = 60.0
195
+ default_config.rpcs.list_restore_templates.retry_policy = {
196
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
197
+ }
198
+
199
+ default_config.rpcs.update_restore_template.timeout = 60.0
200
+
201
+ default_config.rpcs.delete_restore_template.timeout = 60.0
202
+
203
+ default_config.rpcs.run_restore_template.timeout = 60.0
204
+
205
+ default_config.rpcs.get_restore_template_execution.timeout = 60.0
206
+ default_config.rpcs.get_restore_template_execution.retry_policy = {
207
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
208
+ }
209
+
210
+ default_config.rpcs.list_restore_template_executions.timeout = 60.0
211
+ default_config.rpcs.list_restore_template_executions.retry_policy = {
212
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
213
+ }
214
+
215
+ default_config.rpcs.trigger_restore_cleanup.timeout = 60.0
216
+
217
+ default_config.rpcs.create_restore_verification_plan.timeout = 60.0
218
+
219
+ default_config.rpcs.create_restore_verification_plan_association.timeout = 60.0
220
+
221
+ default_config.rpcs.get_restore_verification_plan_association.timeout = 60.0
222
+ default_config.rpcs.get_restore_verification_plan_association.retry_policy = {
223
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
224
+ }
225
+
226
+ default_config.rpcs.list_restore_verification_plan_associations.timeout = 60.0
227
+ default_config.rpcs.list_restore_verification_plan_associations.retry_policy = {
228
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
229
+ }
230
+
231
+ default_config.rpcs.delete_restore_verification_plan_association.timeout = 60.0
232
+
233
+ default_config.rpcs.trigger_restore_verification.timeout = 60.0
234
+
235
+ default_config.rpcs.get_restore_verification_plan.timeout = 60.0
236
+ default_config.rpcs.get_restore_verification_plan.retry_policy = {
237
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
238
+ }
239
+
240
+ default_config.rpcs.list_restore_verification_plans.timeout = 60.0
241
+ default_config.rpcs.list_restore_verification_plans.retry_policy = {
242
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
243
+ }
244
+
245
+ default_config.rpcs.delete_restore_verification_plan.timeout = 60.0
246
+
147
247
  default_config
148
248
  end
149
249
  yield @configure if block_given?
@@ -3669,7 +3769,7 @@ module Google
3669
3769
  # @param options [::Gapic::CallOptions, ::Hash]
3670
3770
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3671
3771
  #
3672
- # @overload delete_backup_plan_association(name: nil, request_id: nil)
3772
+ # @overload delete_backup_plan_association(name: nil, request_id: nil, auto_protection_policy_binding: nil)
3673
3773
  # Pass arguments to `delete_backup_plan_association` via keyword arguments. Note that at
3674
3774
  # least one keyword argument is required. To specify no parameters, or to keep all
3675
3775
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -3691,6 +3791,12 @@ module Google
3691
3791
  #
3692
3792
  # The request ID must be a valid UUID with the exception that zero UUID is
3693
3793
  # not supported (00000000-0000-0000-0000-000000000000).
3794
+ # @param auto_protection_policy_binding [::String]
3795
+ # Optional. This field is exclusively used by Backup and DR's auto-protection
3796
+ # feature. The resource name of the `AutoProtectionPolicyBinding` that
3797
+ # triggered the deletion of this association.
3798
+ # Format:
3799
+ # `projects/{project}/locations/{location}/autoProtectionPolicies/{policy}/bindings/{binding}`.
3694
3800
  #
3695
3801
  # @yield [response, operation] Access the result along with the RPC operation
3696
3802
  # @yieldparam response [::Gapic::Operation]
@@ -4329,177 +4435,3202 @@ module Google
4329
4435
  end
4330
4436
 
4331
4437
  ##
4332
- # Configuration class for the BackupDR API.
4438
+ # Creates a new AutoProtectionPolicy in a given project and location.
4333
4439
  #
4334
- # This class represents the configuration for BackupDR,
4335
- # providing control over timeouts, retry behavior, logging, transport
4336
- # parameters, and other low-level controls. Certain parameters can also be
4337
- # applied individually to specific RPCs. See
4338
- # {::Google::Cloud::BackupDR::V1::BackupDR::Client::Configuration::Rpcs}
4339
- # for a list of RPCs that can be configured independently.
4440
+ # @overload create_auto_protection_policy(request, options = nil)
4441
+ # Pass arguments to `create_auto_protection_policy` via a request object, either of type
4442
+ # {::Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyRequest} or an equivalent Hash.
4340
4443
  #
4341
- # Configuration can be applied globally to all clients, or to a single client
4342
- # on construction.
4444
+ # @param request [::Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyRequest, ::Hash]
4445
+ # A request object representing the call parameters. Required. To specify no
4446
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4447
+ # @param options [::Gapic::CallOptions, ::Hash]
4448
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4343
4449
  #
4344
- # @example
4450
+ # @overload create_auto_protection_policy(parent: nil, auto_protection_policy_id: nil, auto_protection_policy: nil, request_id: nil)
4451
+ # Pass arguments to `create_auto_protection_policy` via keyword arguments. Note that at
4452
+ # least one keyword argument is required. To specify no parameters, or to keep all
4453
+ # the default parameter values, pass an empty Hash as a request object (see above).
4345
4454
  #
4346
- # # Modify the global config, setting the timeout for
4347
- # # list_management_servers to 20 seconds,
4348
- # # and all remaining timeouts to 10 seconds.
4349
- # ::Google::Cloud::BackupDR::V1::BackupDR::Client.configure do |config|
4350
- # config.timeout = 10.0
4351
- # config.rpcs.list_management_servers.timeout = 20.0
4352
- # end
4455
+ # @param parent [::String]
4456
+ # Required. The parent resource where this policy will be created.
4457
+ # Format: projects/\\{project}/locations/\\{location}
4458
+ # @param auto_protection_policy_id [::String]
4459
+ # Required. The ID to use for the policy.
4460
+ # This will become the final component of the policy's resource name.
4461
+ #
4462
+ # This value must start with a lowercase letter followed by up to 62
4463
+ # lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
4464
+ # @param auto_protection_policy [::Google::Cloud::BackupDR::V1::AutoProtectionPolicy, ::Hash]
4465
+ # Required. The AutoProtectionPolicy resource to create.
4466
+ # @param request_id [::String]
4467
+ # Optional. An optional request ID to identify requests. Specify a unique
4468
+ # request ID so that if you must retry your request, the server will know to
4469
+ # ignore the request if it has already been completed. The server will
4470
+ # guarantee that for at least 60 minutes since the first request.
4353
4471
  #
4354
- # # Apply the above configuration only to a new client.
4355
- # client = ::Google::Cloud::BackupDR::V1::BackupDR::Client.new do |config|
4356
- # config.timeout = 10.0
4357
- # config.rpcs.list_management_servers.timeout = 20.0
4358
- # end
4472
+ # The request ID must be a valid UUID with the exception that zero UUID is
4473
+ # not supported (00000000-0000-0000-0000-000000000000).
4359
4474
  #
4360
- # @!attribute [rw] endpoint
4361
- # A custom service endpoint, as a hostname or hostname:port. The default is
4362
- # nil, indicating to use the default endpoint in the current universe domain.
4363
- # @return [::String,nil]
4364
- # @!attribute [rw] credentials
4365
- # Credentials to send with calls. You may provide any of the following types:
4366
- # * (`Google::Auth::Credentials`) A googleauth credentials object
4367
- # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
4368
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
4369
- # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
4370
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
4371
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
4372
- # * (`nil`) indicating no credentials
4475
+ # @yield [response, operation] Access the result along with the RPC operation
4476
+ # @yieldparam response [::Gapic::Operation]
4477
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4373
4478
  #
4374
- # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
4375
- # is deprecated. Providing an unvalidated credential configuration to
4376
- # Google APIs can compromise the security of your systems and data.
4479
+ # @return [::Gapic::Operation]
4377
4480
  #
4378
- # @example
4481
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4379
4482
  #
4380
- # # The recommended way to provide credentials is to use the `make_creds` method
4381
- # # on the appropriate credentials class for your environment.
4483
+ # @example Basic example
4484
+ # require "google/cloud/backupdr/v1"
4382
4485
  #
4383
- # require "googleauth"
4486
+ # # Create a client object. The client can be reused for multiple calls.
4487
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
4384
4488
  #
4385
- # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
4386
- # json_key_io: ::File.open("/path/to/keyfile.json")
4387
- # )
4489
+ # # Create a request. To set request fields, pass in keyword arguments.
4490
+ # request = Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyRequest.new
4388
4491
  #
4389
- # client = ::Google::Cloud::BackupDR::V1::BackupDR::Client.new do |config|
4390
- # config.credentials = credentials
4391
- # end
4492
+ # # Call the create_auto_protection_policy method.
4493
+ # result = client.create_auto_protection_policy request
4392
4494
  #
4393
- # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
4394
- # external source for authentication to Google Cloud, you must validate it before
4395
- # providing it to a Google API client library. Providing an unvalidated credential
4396
- # configuration to Google APIs can compromise the security of your systems and data.
4397
- # For more information, refer to [Validate credential configurations from external
4398
- # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
4399
- # @return [::Object]
4400
- # @!attribute [rw] scope
4401
- # The OAuth scopes
4402
- # @return [::Array<::String>]
4403
- # @!attribute [rw] lib_name
4404
- # The library name as recorded in instrumentation and logging
4405
- # @return [::String]
4406
- # @!attribute [rw] lib_version
4407
- # The library version as recorded in instrumentation and logging
4408
- # @return [::String]
4409
- # @!attribute [rw] channel_args
4410
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
4411
- # `GRPC::Core::Channel` object is provided as the credential.
4412
- # @return [::Hash]
4413
- # @!attribute [rw] interceptors
4414
- # An array of interceptors that are run before calls are executed.
4415
- # @return [::Array<::GRPC::ClientInterceptor>]
4416
- # @!attribute [rw] timeout
4417
- # The call timeout in seconds.
4418
- # @return [::Numeric]
4419
- # @!attribute [rw] metadata
4420
- # Additional gRPC headers to be sent with the call.
4421
- # @return [::Hash{::Symbol=>::String}]
4422
- # @!attribute [rw] retry_policy
4423
- # The retry policy. The value is a hash with the following keys:
4424
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4425
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4426
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4427
- # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
4428
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4429
- # trigger a retry.
4430
- # @return [::Hash]
4431
- # @!attribute [rw] quota_project
4432
- # A separate project against which to charge quota.
4433
- # @return [::String]
4434
- # @!attribute [rw] universe_domain
4435
- # The universe domain within which to make requests. This determines the
4436
- # default endpoint URL. The default value of nil uses the environment
4437
- # universe (usually the default "googleapis.com" universe).
4438
- # @return [::String,nil]
4439
- # @!attribute [rw] logger
4440
- # A custom logger to use for request/response debug logging, or the value
4441
- # `:default` (the default) to construct a default logger, or `nil` to
4442
- # explicitly disable logging.
4443
- # @return [::Logger,:default,nil]
4495
+ # # The returned object is of type Gapic::Operation. You can use it to
4496
+ # # check the status of an operation, cancel it, or wait for results.
4497
+ # # Here is how to wait for a response.
4498
+ # result.wait_until_done! timeout: 60
4499
+ # if result.response?
4500
+ # p result.response
4501
+ # else
4502
+ # puts "No response received."
4503
+ # end
4444
4504
  #
4445
- class Configuration
4446
- extend ::Gapic::Config
4505
+ def create_auto_protection_policy request, options = nil
4506
+ raise ::ArgumentError, "request must be provided" if request.nil?
4447
4507
 
4448
- # @private
4449
- # The endpoint specific to the default "googleapis.com" universe. Deprecated.
4450
- DEFAULT_ENDPOINT = "backupdr.googleapis.com"
4508
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyRequest
4451
4509
 
4452
- config_attr :endpoint, nil, ::String, nil
4453
- config_attr :credentials, nil do |value|
4454
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
4455
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
4456
- allowed.any? { |klass| klass === value }
4457
- end
4458
- config_attr :scope, nil, ::String, ::Array, nil
4459
- config_attr :lib_name, nil, ::String, nil
4460
- config_attr :lib_version, nil, ::String, nil
4461
- config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
4462
- config_attr :interceptors, nil, ::Array, nil
4463
- config_attr :timeout, nil, ::Numeric, nil
4464
- config_attr :metadata, nil, ::Hash, nil
4465
- config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4466
- config_attr :quota_project, nil, ::String, nil
4467
- config_attr :universe_domain, nil, ::String, nil
4468
- config_attr :logger, :default, ::Logger, nil, :default
4510
+ # Converts hash and nil to an options object
4511
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4469
4512
 
4470
- # @private
4471
- def initialize parent_config = nil
4472
- @parent_config = parent_config unless parent_config.nil?
4513
+ # Customize the options with defaults
4514
+ metadata = @config.rpcs.create_auto_protection_policy.metadata.to_h
4473
4515
 
4474
- yield self if block_given?
4475
- end
4516
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4517
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4518
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4519
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
4520
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4521
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4476
4522
 
4477
- ##
4478
- # Configurations for individual RPCs
4479
- # @return [Rpcs]
4480
- #
4481
- def rpcs
4482
- @rpcs ||= begin
4483
- parent_rpcs = nil
4484
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
4485
- Rpcs.new parent_rpcs
4486
- end
4523
+ header_params = {}
4524
+ if request.parent
4525
+ header_params["parent"] = request.parent
4487
4526
  end
4488
4527
 
4489
- ##
4490
- # Configuration for the channel pool
4491
- # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
4492
- #
4493
- def channel_pool
4494
- @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
4495
- end
4528
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4529
+ metadata[:"x-goog-request-params"] ||= request_params_header
4496
4530
 
4497
- ##
4498
- # Configuration RPC class for the BackupDR API.
4499
- #
4500
- # Includes fields providing the configuration for each RPC in this service.
4501
- # Each configuration object is of type `Gapic::Config::Method` and includes
4502
- # the following configuration fields:
4531
+ options.apply_defaults timeout: @config.rpcs.create_auto_protection_policy.timeout,
4532
+ metadata: metadata,
4533
+ retry_policy: @config.rpcs.create_auto_protection_policy.retry_policy
4534
+
4535
+ options.apply_defaults timeout: @config.timeout,
4536
+ metadata: @config.metadata,
4537
+ retry_policy: @config.retry_policy
4538
+
4539
+ @backup_dr_stub.call_rpc :create_auto_protection_policy, request, options: options do |response, operation|
4540
+ response = ::Gapic::Operation.new response, @operations_client, options: options
4541
+ yield response, operation if block_given?
4542
+ throw :response, response
4543
+ end
4544
+ rescue ::GRPC::BadStatus => e
4545
+ raise ::Google::Cloud::Error.from_error(e)
4546
+ end
4547
+
4548
+ ##
4549
+ # Lists AutoProtectionPolicies for a given project and location.
4550
+ #
4551
+ # @overload list_auto_protection_policies(request, options = nil)
4552
+ # Pass arguments to `list_auto_protection_policies` via a request object, either of type
4553
+ # {::Google::Cloud::BackupDR::V1::ListAutoProtectionPoliciesRequest} or an equivalent Hash.
4554
+ #
4555
+ # @param request [::Google::Cloud::BackupDR::V1::ListAutoProtectionPoliciesRequest, ::Hash]
4556
+ # A request object representing the call parameters. Required. To specify no
4557
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4558
+ # @param options [::Gapic::CallOptions, ::Hash]
4559
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4560
+ #
4561
+ # @overload list_auto_protection_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
4562
+ # Pass arguments to `list_auto_protection_policies` via keyword arguments. Note that at
4563
+ # least one keyword argument is required. To specify no parameters, or to keep all
4564
+ # the default parameter values, pass an empty Hash as a request object (see above).
4565
+ #
4566
+ # @param parent [::String]
4567
+ # Required. The project and location for which to retrieve the list of
4568
+ # policies. Format: projects/\\{project}/locations/\\{location}
4569
+ # @param page_size [::Integer]
4570
+ # Optional. The maximum number of policies to return in a single page.
4571
+ # If unspecified, a server-default value will be used.
4572
+ # @param page_token [::String]
4573
+ # Optional. A page token, received from a previous
4574
+ # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent
4575
+ # page.
4576
+ # @param filter [::String]
4577
+ # Optional. A filter expression that filters resources listed in the
4578
+ # response. The following fields are filterable:
4579
+ # @param order_by [::String]
4580
+ # Optional. An expression that sorts the results in the response. The
4581
+ # following fields are sortable:
4582
+ #
4583
+ # @yield [response, operation] Access the result along with the RPC operation
4584
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::AutoProtectionPolicy>]
4585
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4586
+ #
4587
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::AutoProtectionPolicy>]
4588
+ #
4589
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4590
+ #
4591
+ # @example Basic example
4592
+ # require "google/cloud/backupdr/v1"
4593
+ #
4594
+ # # Create a client object. The client can be reused for multiple calls.
4595
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
4596
+ #
4597
+ # # Create a request. To set request fields, pass in keyword arguments.
4598
+ # request = Google::Cloud::BackupDR::V1::ListAutoProtectionPoliciesRequest.new
4599
+ #
4600
+ # # Call the list_auto_protection_policies method.
4601
+ # result = client.list_auto_protection_policies request
4602
+ #
4603
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
4604
+ # # over elements, and API calls will be issued to fetch pages as needed.
4605
+ # result.each do |item|
4606
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::AutoProtectionPolicy.
4607
+ # p item
4608
+ # end
4609
+ #
4610
+ def list_auto_protection_policies request, options = nil
4611
+ raise ::ArgumentError, "request must be provided" if request.nil?
4612
+
4613
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListAutoProtectionPoliciesRequest
4614
+
4615
+ # Converts hash and nil to an options object
4616
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4617
+
4618
+ # Customize the options with defaults
4619
+ metadata = @config.rpcs.list_auto_protection_policies.metadata.to_h
4620
+
4621
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4622
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4623
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4624
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
4625
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4626
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4627
+
4628
+ header_params = {}
4629
+ if request.parent
4630
+ header_params["parent"] = request.parent
4631
+ end
4632
+
4633
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4634
+ metadata[:"x-goog-request-params"] ||= request_params_header
4635
+
4636
+ options.apply_defaults timeout: @config.rpcs.list_auto_protection_policies.timeout,
4637
+ metadata: metadata,
4638
+ retry_policy: @config.rpcs.list_auto_protection_policies.retry_policy
4639
+
4640
+ options.apply_defaults timeout: @config.timeout,
4641
+ metadata: @config.metadata,
4642
+ retry_policy: @config.retry_policy
4643
+
4644
+ @backup_dr_stub.call_rpc :list_auto_protection_policies, request, options: options do |response, operation|
4645
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_auto_protection_policies, request, response, operation, options
4646
+ yield response, operation if block_given?
4647
+ throw :response, response
4648
+ end
4649
+ rescue ::GRPC::BadStatus => e
4650
+ raise ::Google::Cloud::Error.from_error(e)
4651
+ end
4652
+
4653
+ ##
4654
+ # Gets details of a single AutoProtectionPolicy.
4655
+ #
4656
+ # @overload get_auto_protection_policy(request, options = nil)
4657
+ # Pass arguments to `get_auto_protection_policy` via a request object, either of type
4658
+ # {::Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyRequest} or an equivalent Hash.
4659
+ #
4660
+ # @param request [::Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyRequest, ::Hash]
4661
+ # A request object representing the call parameters. Required. To specify no
4662
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4663
+ # @param options [::Gapic::CallOptions, ::Hash]
4664
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4665
+ #
4666
+ # @overload get_auto_protection_policy(name: nil)
4667
+ # Pass arguments to `get_auto_protection_policy` via keyword arguments. Note that at
4668
+ # least one keyword argument is required. To specify no parameters, or to keep all
4669
+ # the default parameter values, pass an empty Hash as a request object (see above).
4670
+ #
4671
+ # @param name [::String]
4672
+ # Required. The name of the policy to retrieve.
4673
+ # Format:
4674
+ # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}
4675
+ #
4676
+ # @yield [response, operation] Access the result along with the RPC operation
4677
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::AutoProtectionPolicy]
4678
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4679
+ #
4680
+ # @return [::Google::Cloud::BackupDR::V1::AutoProtectionPolicy]
4681
+ #
4682
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4683
+ #
4684
+ # @example Basic example
4685
+ # require "google/cloud/backupdr/v1"
4686
+ #
4687
+ # # Create a client object. The client can be reused for multiple calls.
4688
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
4689
+ #
4690
+ # # Create a request. To set request fields, pass in keyword arguments.
4691
+ # request = Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyRequest.new
4692
+ #
4693
+ # # Call the get_auto_protection_policy method.
4694
+ # result = client.get_auto_protection_policy request
4695
+ #
4696
+ # # The returned object is of type Google::Cloud::BackupDR::V1::AutoProtectionPolicy.
4697
+ # p result
4698
+ #
4699
+ def get_auto_protection_policy request, options = nil
4700
+ raise ::ArgumentError, "request must be provided" if request.nil?
4701
+
4702
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyRequest
4703
+
4704
+ # Converts hash and nil to an options object
4705
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4706
+
4707
+ # Customize the options with defaults
4708
+ metadata = @config.rpcs.get_auto_protection_policy.metadata.to_h
4709
+
4710
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4711
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4712
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4713
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
4714
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4715
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4716
+
4717
+ header_params = {}
4718
+ if request.name
4719
+ header_params["name"] = request.name
4720
+ end
4721
+
4722
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4723
+ metadata[:"x-goog-request-params"] ||= request_params_header
4724
+
4725
+ options.apply_defaults timeout: @config.rpcs.get_auto_protection_policy.timeout,
4726
+ metadata: metadata,
4727
+ retry_policy: @config.rpcs.get_auto_protection_policy.retry_policy
4728
+
4729
+ options.apply_defaults timeout: @config.timeout,
4730
+ metadata: @config.metadata,
4731
+ retry_policy: @config.retry_policy
4732
+
4733
+ @backup_dr_stub.call_rpc :get_auto_protection_policy, request, options: options do |response, operation|
4734
+ yield response, operation if block_given?
4735
+ end
4736
+ rescue ::GRPC::BadStatus => e
4737
+ raise ::Google::Cloud::Error.from_error(e)
4738
+ end
4739
+
4740
+ ##
4741
+ # Updates the parameters of a single AutoProtectionPolicy.
4742
+ #
4743
+ # @overload update_auto_protection_policy(request, options = nil)
4744
+ # Pass arguments to `update_auto_protection_policy` via a request object, either of type
4745
+ # {::Google::Cloud::BackupDR::V1::UpdateAutoProtectionPolicyRequest} or an equivalent Hash.
4746
+ #
4747
+ # @param request [::Google::Cloud::BackupDR::V1::UpdateAutoProtectionPolicyRequest, ::Hash]
4748
+ # A request object representing the call parameters. Required. To specify no
4749
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4750
+ # @param options [::Gapic::CallOptions, ::Hash]
4751
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4752
+ #
4753
+ # @overload update_auto_protection_policy(auto_protection_policy: nil, update_mask: nil, request_id: nil)
4754
+ # Pass arguments to `update_auto_protection_policy` via keyword arguments. Note that at
4755
+ # least one keyword argument is required. To specify no parameters, or to keep all
4756
+ # the default parameter values, pass an empty Hash as a request object (see above).
4757
+ #
4758
+ # @param auto_protection_policy [::Google::Cloud::BackupDR::V1::AutoProtectionPolicy, ::Hash]
4759
+ # Required. The policy to update.
4760
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
4761
+ # Optional. Field mask is used to specify the fields to be overwritten in the
4762
+ # AutoProtectionPolicy resource by the update.
4763
+ # The fields specified in the update_mask are relative to the resource, not
4764
+ # the full request. A field will be overwritten if it is in the mask. If the
4765
+ # user does not provide a mask then all fields will be overwritten.
4766
+ # @param request_id [::String]
4767
+ # Optional. An optional request ID to identify requests. Specify a unique
4768
+ # request ID so that if you must retry your request, the server will know to
4769
+ # ignore the request if it has already been completed. The server will
4770
+ # guarantee that for at least 60 minutes since the first request.
4771
+ #
4772
+ # The request ID must be a valid UUID with the exception that zero UUID is
4773
+ # not supported (00000000-0000-0000-0000-000000000000).
4774
+ #
4775
+ # @yield [response, operation] Access the result along with the RPC operation
4776
+ # @yieldparam response [::Gapic::Operation]
4777
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4778
+ #
4779
+ # @return [::Gapic::Operation]
4780
+ #
4781
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4782
+ #
4783
+ # @example Basic example
4784
+ # require "google/cloud/backupdr/v1"
4785
+ #
4786
+ # # Create a client object. The client can be reused for multiple calls.
4787
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
4788
+ #
4789
+ # # Create a request. To set request fields, pass in keyword arguments.
4790
+ # request = Google::Cloud::BackupDR::V1::UpdateAutoProtectionPolicyRequest.new
4791
+ #
4792
+ # # Call the update_auto_protection_policy method.
4793
+ # result = client.update_auto_protection_policy request
4794
+ #
4795
+ # # The returned object is of type Gapic::Operation. You can use it to
4796
+ # # check the status of an operation, cancel it, or wait for results.
4797
+ # # Here is how to wait for a response.
4798
+ # result.wait_until_done! timeout: 60
4799
+ # if result.response?
4800
+ # p result.response
4801
+ # else
4802
+ # puts "No response received."
4803
+ # end
4804
+ #
4805
+ def update_auto_protection_policy request, options = nil
4806
+ raise ::ArgumentError, "request must be provided" if request.nil?
4807
+
4808
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateAutoProtectionPolicyRequest
4809
+
4810
+ # Converts hash and nil to an options object
4811
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4812
+
4813
+ # Customize the options with defaults
4814
+ metadata = @config.rpcs.update_auto_protection_policy.metadata.to_h
4815
+
4816
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4817
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4818
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4819
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
4820
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4821
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4822
+
4823
+ header_params = {}
4824
+ if request.auto_protection_policy&.name
4825
+ header_params["auto_protection_policy.name"] = request.auto_protection_policy.name
4826
+ end
4827
+
4828
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4829
+ metadata[:"x-goog-request-params"] ||= request_params_header
4830
+
4831
+ options.apply_defaults timeout: @config.rpcs.update_auto_protection_policy.timeout,
4832
+ metadata: metadata,
4833
+ retry_policy: @config.rpcs.update_auto_protection_policy.retry_policy
4834
+
4835
+ options.apply_defaults timeout: @config.timeout,
4836
+ metadata: @config.metadata,
4837
+ retry_policy: @config.retry_policy
4838
+
4839
+ @backup_dr_stub.call_rpc :update_auto_protection_policy, request, options: options do |response, operation|
4840
+ response = ::Gapic::Operation.new response, @operations_client, options: options
4841
+ yield response, operation if block_given?
4842
+ throw :response, response
4843
+ end
4844
+ rescue ::GRPC::BadStatus => e
4845
+ raise ::Google::Cloud::Error.from_error(e)
4846
+ end
4847
+
4848
+ ##
4849
+ # Deletes a single AutoProtectionPolicy.
4850
+ #
4851
+ # @overload delete_auto_protection_policy(request, options = nil)
4852
+ # Pass arguments to `delete_auto_protection_policy` via a request object, either of type
4853
+ # {::Google::Cloud::BackupDR::V1::DeleteAutoProtectionPolicyRequest} or an equivalent Hash.
4854
+ #
4855
+ # @param request [::Google::Cloud::BackupDR::V1::DeleteAutoProtectionPolicyRequest, ::Hash]
4856
+ # A request object representing the call parameters. Required. To specify no
4857
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4858
+ # @param options [::Gapic::CallOptions, ::Hash]
4859
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4860
+ #
4861
+ # @overload delete_auto_protection_policy(name: nil, etag: nil, request_id: nil)
4862
+ # Pass arguments to `delete_auto_protection_policy` via keyword arguments. Note that at
4863
+ # least one keyword argument is required. To specify no parameters, or to keep all
4864
+ # the default parameter values, pass an empty Hash as a request object (see above).
4865
+ #
4866
+ # @param name [::String]
4867
+ # Required. The name of the policy to delete.
4868
+ # Format:
4869
+ # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}
4870
+ # @param etag [::String]
4871
+ # Optional. The current etag of the autoprotectionpolicy.
4872
+ # If an etag is provided and does not match the current etag of the
4873
+ # connection, deletion will be blocked.
4874
+ # @param request_id [::String]
4875
+ # Optional. An optional request ID to identify requests. Specify a unique
4876
+ # request ID so that if you must retry your request, the server will know to
4877
+ # ignore the request if it has already been completed. The server will
4878
+ # guarantee that for at least 60 minutes since the first request.
4879
+ #
4880
+ # The request ID must be a valid UUID with the exception that zero UUID is
4881
+ # not supported (00000000-0000-0000-0000-000000000000).
4882
+ #
4883
+ # @yield [response, operation] Access the result along with the RPC operation
4884
+ # @yieldparam response [::Gapic::Operation]
4885
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4886
+ #
4887
+ # @return [::Gapic::Operation]
4888
+ #
4889
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4890
+ #
4891
+ # @example Basic example
4892
+ # require "google/cloud/backupdr/v1"
4893
+ #
4894
+ # # Create a client object. The client can be reused for multiple calls.
4895
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
4896
+ #
4897
+ # # Create a request. To set request fields, pass in keyword arguments.
4898
+ # request = Google::Cloud::BackupDR::V1::DeleteAutoProtectionPolicyRequest.new
4899
+ #
4900
+ # # Call the delete_auto_protection_policy method.
4901
+ # result = client.delete_auto_protection_policy request
4902
+ #
4903
+ # # The returned object is of type Gapic::Operation. You can use it to
4904
+ # # check the status of an operation, cancel it, or wait for results.
4905
+ # # Here is how to wait for a response.
4906
+ # result.wait_until_done! timeout: 60
4907
+ # if result.response?
4908
+ # p result.response
4909
+ # else
4910
+ # puts "No response received."
4911
+ # end
4912
+ #
4913
+ def delete_auto_protection_policy request, options = nil
4914
+ raise ::ArgumentError, "request must be provided" if request.nil?
4915
+
4916
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteAutoProtectionPolicyRequest
4917
+
4918
+ # Converts hash and nil to an options object
4919
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4920
+
4921
+ # Customize the options with defaults
4922
+ metadata = @config.rpcs.delete_auto_protection_policy.metadata.to_h
4923
+
4924
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4925
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4926
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4927
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
4928
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4929
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4930
+
4931
+ header_params = {}
4932
+ if request.name
4933
+ header_params["name"] = request.name
4934
+ end
4935
+
4936
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4937
+ metadata[:"x-goog-request-params"] ||= request_params_header
4938
+
4939
+ options.apply_defaults timeout: @config.rpcs.delete_auto_protection_policy.timeout,
4940
+ metadata: metadata,
4941
+ retry_policy: @config.rpcs.delete_auto_protection_policy.retry_policy
4942
+
4943
+ options.apply_defaults timeout: @config.timeout,
4944
+ metadata: @config.metadata,
4945
+ retry_policy: @config.retry_policy
4946
+
4947
+ @backup_dr_stub.call_rpc :delete_auto_protection_policy, request, options: options do |response, operation|
4948
+ response = ::Gapic::Operation.new response, @operations_client, options: options
4949
+ yield response, operation if block_given?
4950
+ throw :response, response
4951
+ end
4952
+ rescue ::GRPC::BadStatus => e
4953
+ raise ::Google::Cloud::Error.from_error(e)
4954
+ end
4955
+
4956
+ ##
4957
+ # Creates a new AutoProtectionPolicyBinding in a given project and
4958
+ # location.
4959
+ #
4960
+ # @overload create_auto_protection_policy_binding(request, options = nil)
4961
+ # Pass arguments to `create_auto_protection_policy_binding` via a request object, either of type
4962
+ # {::Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyBindingRequest} or an equivalent Hash.
4963
+ #
4964
+ # @param request [::Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyBindingRequest, ::Hash]
4965
+ # A request object representing the call parameters. Required. To specify no
4966
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4967
+ # @param options [::Gapic::CallOptions, ::Hash]
4968
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4969
+ #
4970
+ # @overload create_auto_protection_policy_binding(parent: nil, auto_protection_policy_binding_id: nil, auto_protection_policy_binding: nil, request_id: nil)
4971
+ # Pass arguments to `create_auto_protection_policy_binding` via keyword arguments. Note that at
4972
+ # least one keyword argument is required. To specify no parameters, or to keep all
4973
+ # the default parameter values, pass an empty Hash as a request object (see above).
4974
+ #
4975
+ # @param parent [::String]
4976
+ # Required. The parent resource where this binding will be created.
4977
+ # Format:
4978
+ # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}
4979
+ # @param auto_protection_policy_binding_id [::String]
4980
+ # Required. The ID to use for the binding.
4981
+ # This will become the final component of the binding's resource name.
4982
+ #
4983
+ # This value must start with a lowercase letter followed by up to 62
4984
+ # lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
4985
+ # @param auto_protection_policy_binding [::Google::Cloud::BackupDR::V1::AutoProtectionPolicyBinding, ::Hash]
4986
+ # Required. The AutoProtectionPolicyBinding resource to create.
4987
+ # @param request_id [::String]
4988
+ # Optional. An optional request ID to identify requests. Specify a unique
4989
+ # request ID so that if you must retry your request, the server will know to
4990
+ # ignore the request if it has already been completed. The server will
4991
+ # guarantee that for at least 60 minutes since the first request.
4992
+ #
4993
+ # The request ID must be a valid UUID with the exception that zero UUID is
4994
+ # not supported (00000000-0000-0000-0000-000000000000).
4995
+ #
4996
+ # @yield [response, operation] Access the result along with the RPC operation
4997
+ # @yieldparam response [::Gapic::Operation]
4998
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4999
+ #
5000
+ # @return [::Gapic::Operation]
5001
+ #
5002
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5003
+ #
5004
+ # @example Basic example
5005
+ # require "google/cloud/backupdr/v1"
5006
+ #
5007
+ # # Create a client object. The client can be reused for multiple calls.
5008
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5009
+ #
5010
+ # # Create a request. To set request fields, pass in keyword arguments.
5011
+ # request = Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyBindingRequest.new
5012
+ #
5013
+ # # Call the create_auto_protection_policy_binding method.
5014
+ # result = client.create_auto_protection_policy_binding request
5015
+ #
5016
+ # # The returned object is of type Gapic::Operation. You can use it to
5017
+ # # check the status of an operation, cancel it, or wait for results.
5018
+ # # Here is how to wait for a response.
5019
+ # result.wait_until_done! timeout: 60
5020
+ # if result.response?
5021
+ # p result.response
5022
+ # else
5023
+ # puts "No response received."
5024
+ # end
5025
+ #
5026
+ def create_auto_protection_policy_binding request, options = nil
5027
+ raise ::ArgumentError, "request must be provided" if request.nil?
5028
+
5029
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateAutoProtectionPolicyBindingRequest
5030
+
5031
+ # Converts hash and nil to an options object
5032
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5033
+
5034
+ # Customize the options with defaults
5035
+ metadata = @config.rpcs.create_auto_protection_policy_binding.metadata.to_h
5036
+
5037
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5038
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5039
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5040
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5041
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5042
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5043
+
5044
+ header_params = {}
5045
+ if request.parent
5046
+ header_params["parent"] = request.parent
5047
+ end
5048
+
5049
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5050
+ metadata[:"x-goog-request-params"] ||= request_params_header
5051
+
5052
+ options.apply_defaults timeout: @config.rpcs.create_auto_protection_policy_binding.timeout,
5053
+ metadata: metadata,
5054
+ retry_policy: @config.rpcs.create_auto_protection_policy_binding.retry_policy
5055
+
5056
+ options.apply_defaults timeout: @config.timeout,
5057
+ metadata: @config.metadata,
5058
+ retry_policy: @config.retry_policy
5059
+
5060
+ @backup_dr_stub.call_rpc :create_auto_protection_policy_binding, request, options: options do |response, operation|
5061
+ response = ::Gapic::Operation.new response, @operations_client, options: options
5062
+ yield response, operation if block_given?
5063
+ throw :response, response
5064
+ end
5065
+ rescue ::GRPC::BadStatus => e
5066
+ raise ::Google::Cloud::Error.from_error(e)
5067
+ end
5068
+
5069
+ ##
5070
+ # Returns the auto protection policy binding read from the CCFE tables.
5071
+ #
5072
+ # @overload get_auto_protection_policy_binding(request, options = nil)
5073
+ # Pass arguments to `get_auto_protection_policy_binding` via a request object, either of type
5074
+ # {::Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyBindingRequest} or an equivalent Hash.
5075
+ #
5076
+ # @param request [::Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyBindingRequest, ::Hash]
5077
+ # A request object representing the call parameters. Required. To specify no
5078
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5079
+ # @param options [::Gapic::CallOptions, ::Hash]
5080
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5081
+ #
5082
+ # @overload get_auto_protection_policy_binding(name: nil)
5083
+ # Pass arguments to `get_auto_protection_policy_binding` via keyword arguments. Note that at
5084
+ # least one keyword argument is required. To specify no parameters, or to keep all
5085
+ # the default parameter values, pass an empty Hash as a request object (see above).
5086
+ #
5087
+ # @param name [::String]
5088
+ # Required. The name of the binding to retrieve.
5089
+ # Format:
5090
+ # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding}
5091
+ #
5092
+ # @yield [response, operation] Access the result along with the RPC operation
5093
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::AutoProtectionPolicyBinding]
5094
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5095
+ #
5096
+ # @return [::Google::Cloud::BackupDR::V1::AutoProtectionPolicyBinding]
5097
+ #
5098
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5099
+ #
5100
+ # @example Basic example
5101
+ # require "google/cloud/backupdr/v1"
5102
+ #
5103
+ # # Create a client object. The client can be reused for multiple calls.
5104
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5105
+ #
5106
+ # # Create a request. To set request fields, pass in keyword arguments.
5107
+ # request = Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyBindingRequest.new
5108
+ #
5109
+ # # Call the get_auto_protection_policy_binding method.
5110
+ # result = client.get_auto_protection_policy_binding request
5111
+ #
5112
+ # # The returned object is of type Google::Cloud::BackupDR::V1::AutoProtectionPolicyBinding.
5113
+ # p result
5114
+ #
5115
+ def get_auto_protection_policy_binding request, options = nil
5116
+ raise ::ArgumentError, "request must be provided" if request.nil?
5117
+
5118
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetAutoProtectionPolicyBindingRequest
5119
+
5120
+ # Converts hash and nil to an options object
5121
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5122
+
5123
+ # Customize the options with defaults
5124
+ metadata = @config.rpcs.get_auto_protection_policy_binding.metadata.to_h
5125
+
5126
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5127
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5128
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5129
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5130
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5131
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5132
+
5133
+ header_params = {}
5134
+ if request.name
5135
+ header_params["name"] = request.name
5136
+ end
5137
+
5138
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5139
+ metadata[:"x-goog-request-params"] ||= request_params_header
5140
+
5141
+ options.apply_defaults timeout: @config.rpcs.get_auto_protection_policy_binding.timeout,
5142
+ metadata: metadata,
5143
+ retry_policy: @config.rpcs.get_auto_protection_policy_binding.retry_policy
5144
+
5145
+ options.apply_defaults timeout: @config.timeout,
5146
+ metadata: @config.metadata,
5147
+ retry_policy: @config.retry_policy
5148
+
5149
+ @backup_dr_stub.call_rpc :get_auto_protection_policy_binding, request, options: options do |response, operation|
5150
+ yield response, operation if block_given?
5151
+ end
5152
+ rescue ::GRPC::BadStatus => e
5153
+ raise ::Google::Cloud::Error.from_error(e)
5154
+ end
5155
+
5156
+ ##
5157
+ # Returns the auto protection policy bindings read from the CCFE tables.
5158
+ #
5159
+ # @overload list_auto_protection_policy_bindings(request, options = nil)
5160
+ # Pass arguments to `list_auto_protection_policy_bindings` via a request object, either of type
5161
+ # {::Google::Cloud::BackupDR::V1::ListAutoProtectionPolicyBindingsRequest} or an equivalent Hash.
5162
+ #
5163
+ # @param request [::Google::Cloud::BackupDR::V1::ListAutoProtectionPolicyBindingsRequest, ::Hash]
5164
+ # A request object representing the call parameters. Required. To specify no
5165
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5166
+ # @param options [::Gapic::CallOptions, ::Hash]
5167
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5168
+ #
5169
+ # @overload list_auto_protection_policy_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
5170
+ # Pass arguments to `list_auto_protection_policy_bindings` via keyword arguments. Note that at
5171
+ # least one keyword argument is required. To specify no parameters, or to keep all
5172
+ # the default parameter values, pass an empty Hash as a request object (see above).
5173
+ #
5174
+ # @param parent [::String]
5175
+ # Required. The project and location for which to retrieve the list of
5176
+ # policies. Format: projects/\\{project}/locations/\\{location}
5177
+ # @param page_size [::Integer]
5178
+ # Optional. The maximum number of policies to return in a single page is 500.
5179
+ # If unspecified, a server-default value will be used.
5180
+ # @param page_token [::String]
5181
+ # Optional. A page token, received from a previous
5182
+ # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent
5183
+ # page.
5184
+ # @param filter [::String]
5185
+ # Optional. A filter expression that filters resources listed in the
5186
+ # response. The following fields are filterable:
5187
+ # @param order_by [::String]
5188
+ # Optional. An expression that sorts the results in the response. The
5189
+ # following fields are sortable:
5190
+ #
5191
+ # @yield [response, operation] Access the result along with the RPC operation
5192
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::AutoProtectionPolicyBinding>]
5193
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5194
+ #
5195
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::AutoProtectionPolicyBinding>]
5196
+ #
5197
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5198
+ #
5199
+ # @example Basic example
5200
+ # require "google/cloud/backupdr/v1"
5201
+ #
5202
+ # # Create a client object. The client can be reused for multiple calls.
5203
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5204
+ #
5205
+ # # Create a request. To set request fields, pass in keyword arguments.
5206
+ # request = Google::Cloud::BackupDR::V1::ListAutoProtectionPolicyBindingsRequest.new
5207
+ #
5208
+ # # Call the list_auto_protection_policy_bindings method.
5209
+ # result = client.list_auto_protection_policy_bindings request
5210
+ #
5211
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
5212
+ # # over elements, and API calls will be issued to fetch pages as needed.
5213
+ # result.each do |item|
5214
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::AutoProtectionPolicyBinding.
5215
+ # p item
5216
+ # end
5217
+ #
5218
+ def list_auto_protection_policy_bindings request, options = nil
5219
+ raise ::ArgumentError, "request must be provided" if request.nil?
5220
+
5221
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListAutoProtectionPolicyBindingsRequest
5222
+
5223
+ # Converts hash and nil to an options object
5224
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5225
+
5226
+ # Customize the options with defaults
5227
+ metadata = @config.rpcs.list_auto_protection_policy_bindings.metadata.to_h
5228
+
5229
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5230
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5231
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5232
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5233
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5234
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5235
+
5236
+ header_params = {}
5237
+ if request.parent
5238
+ header_params["parent"] = request.parent
5239
+ end
5240
+
5241
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5242
+ metadata[:"x-goog-request-params"] ||= request_params_header
5243
+
5244
+ options.apply_defaults timeout: @config.rpcs.list_auto_protection_policy_bindings.timeout,
5245
+ metadata: metadata,
5246
+ retry_policy: @config.rpcs.list_auto_protection_policy_bindings.retry_policy
5247
+
5248
+ options.apply_defaults timeout: @config.timeout,
5249
+ metadata: @config.metadata,
5250
+ retry_policy: @config.retry_policy
5251
+
5252
+ @backup_dr_stub.call_rpc :list_auto_protection_policy_bindings, request, options: options do |response, operation|
5253
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_auto_protection_policy_bindings, request, response, operation, options
5254
+ yield response, operation if block_given?
5255
+ throw :response, response
5256
+ end
5257
+ rescue ::GRPC::BadStatus => e
5258
+ raise ::Google::Cloud::Error.from_error(e)
5259
+ end
5260
+
5261
+ ##
5262
+ # Lists AppliedAutoProtectionPolicies in a given project and location.
5263
+ #
5264
+ # @overload list_applied_auto_protection_policies(request, options = nil)
5265
+ # Pass arguments to `list_applied_auto_protection_policies` via a request object, either of type
5266
+ # {::Google::Cloud::BackupDR::V1::ListAppliedAutoProtectionPoliciesRequest} or an equivalent Hash.
5267
+ #
5268
+ # @param request [::Google::Cloud::BackupDR::V1::ListAppliedAutoProtectionPoliciesRequest, ::Hash]
5269
+ # A request object representing the call parameters. Required. To specify no
5270
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5271
+ # @param options [::Gapic::CallOptions, ::Hash]
5272
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5273
+ #
5274
+ # @overload list_applied_auto_protection_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
5275
+ # Pass arguments to `list_applied_auto_protection_policies` via keyword arguments. Note that at
5276
+ # least one keyword argument is required. To specify no parameters, or to keep all
5277
+ # the default parameter values, pass an empty Hash as a request object (see above).
5278
+ #
5279
+ # @param parent [::String]
5280
+ # Required. The project and location for which to retrieve the list of
5281
+ # applied policies. Format: projects/\\{project}/locations/\\{location}
5282
+ # @param page_size [::Integer]
5283
+ # Optional. The maximum number of applied policies to return in a single
5284
+ # page. The maximum value is 1000; values above 1000 will be coerced to
5285
+ # 1000. If unspecified or set to 0, a default page size of 500 will be used.
5286
+ # @param page_token [::String]
5287
+ # Optional. A page token, received from a previous
5288
+ # `ListAppliedAutoProtectionPolicies` call.
5289
+ # @param filter [::String]
5290
+ # Optional. A filter expression that filters resources listed in the
5291
+ # response.
5292
+ # @param order_by [::String]
5293
+ # Optional. An expression that sorts the results in the response.
5294
+ #
5295
+ # @yield [response, operation] Access the result along with the RPC operation
5296
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::AppliedAutoProtectionPolicy>]
5297
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5298
+ #
5299
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::AppliedAutoProtectionPolicy>]
5300
+ #
5301
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5302
+ #
5303
+ # @example Basic example
5304
+ # require "google/cloud/backupdr/v1"
5305
+ #
5306
+ # # Create a client object. The client can be reused for multiple calls.
5307
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5308
+ #
5309
+ # # Create a request. To set request fields, pass in keyword arguments.
5310
+ # request = Google::Cloud::BackupDR::V1::ListAppliedAutoProtectionPoliciesRequest.new
5311
+ #
5312
+ # # Call the list_applied_auto_protection_policies method.
5313
+ # result = client.list_applied_auto_protection_policies request
5314
+ #
5315
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
5316
+ # # over elements, and API calls will be issued to fetch pages as needed.
5317
+ # result.each do |item|
5318
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::AppliedAutoProtectionPolicy.
5319
+ # p item
5320
+ # end
5321
+ #
5322
+ def list_applied_auto_protection_policies request, options = nil
5323
+ raise ::ArgumentError, "request must be provided" if request.nil?
5324
+
5325
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListAppliedAutoProtectionPoliciesRequest
5326
+
5327
+ # Converts hash and nil to an options object
5328
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5329
+
5330
+ # Customize the options with defaults
5331
+ metadata = @config.rpcs.list_applied_auto_protection_policies.metadata.to_h
5332
+
5333
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5334
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5335
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5336
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5337
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5338
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5339
+
5340
+ header_params = {}
5341
+ if request.parent
5342
+ header_params["parent"] = request.parent
5343
+ end
5344
+
5345
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5346
+ metadata[:"x-goog-request-params"] ||= request_params_header
5347
+
5348
+ options.apply_defaults timeout: @config.rpcs.list_applied_auto_protection_policies.timeout,
5349
+ metadata: metadata,
5350
+ retry_policy: @config.rpcs.list_applied_auto_protection_policies.retry_policy
5351
+
5352
+ options.apply_defaults timeout: @config.timeout,
5353
+ metadata: @config.metadata,
5354
+ retry_policy: @config.retry_policy
5355
+
5356
+ @backup_dr_stub.call_rpc :list_applied_auto_protection_policies, request, options: options do |response, operation|
5357
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_applied_auto_protection_policies, request, response, operation, options
5358
+ yield response, operation if block_given?
5359
+ throw :response, response
5360
+ end
5361
+ rescue ::GRPC::BadStatus => e
5362
+ raise ::Google::Cloud::Error.from_error(e)
5363
+ end
5364
+
5365
+ ##
5366
+ # InitiateDeleteAutoProtectionPolicyBinding initiates delete for
5367
+ # AutoProtectionPolicy Binding
5368
+ #
5369
+ # @overload initiate_delete_auto_protection_policy_binding(request, options = nil)
5370
+ # Pass arguments to `initiate_delete_auto_protection_policy_binding` via a request object, either of type
5371
+ # {::Google::Cloud::BackupDR::V1::InitiateDeleteAutoProtectionPolicyBindingRequest} or an equivalent Hash.
5372
+ #
5373
+ # @param request [::Google::Cloud::BackupDR::V1::InitiateDeleteAutoProtectionPolicyBindingRequest, ::Hash]
5374
+ # A request object representing the call parameters. Required. To specify no
5375
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5376
+ # @param options [::Gapic::CallOptions, ::Hash]
5377
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5378
+ #
5379
+ # @overload initiate_delete_auto_protection_policy_binding(name: nil, etag: nil, request_id: nil)
5380
+ # Pass arguments to `initiate_delete_auto_protection_policy_binding` via keyword arguments. Note that at
5381
+ # least one keyword argument is required. To specify no parameters, or to keep all
5382
+ # the default parameter values, pass an empty Hash as a request object (see above).
5383
+ #
5384
+ # @param name [::String]
5385
+ # Required. The name of the binding to delete.
5386
+ # Format:
5387
+ # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding}
5388
+ # @param etag [::String]
5389
+ # Optional. The current etag of the AutoProtectionPolicyBinding.
5390
+ # If an etag is provided and does not match the current etag of the
5391
+ # binding, deletion will be blocked and an ABORTED error will be returned.
5392
+ # @param request_id [::String]
5393
+ # Optional. An optional request ID to identify requests. Specify a unique
5394
+ # request ID so that if you must retry your request, the server will know to
5395
+ # ignore the request if it has already been completed. The server will
5396
+ # guarantee that for at least 60 minutes since the first request.
5397
+ #
5398
+ # The request ID must be a valid UUID with the exception that zero UUID is
5399
+ # not supported (00000000-0000-0000-0000-000000000000).
5400
+ #
5401
+ # @yield [response, operation] Access the result along with the RPC operation
5402
+ # @yieldparam response [::Gapic::Operation]
5403
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5404
+ #
5405
+ # @return [::Gapic::Operation]
5406
+ #
5407
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5408
+ #
5409
+ # @example Basic example
5410
+ # require "google/cloud/backupdr/v1"
5411
+ #
5412
+ # # Create a client object. The client can be reused for multiple calls.
5413
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5414
+ #
5415
+ # # Create a request. To set request fields, pass in keyword arguments.
5416
+ # request = Google::Cloud::BackupDR::V1::InitiateDeleteAutoProtectionPolicyBindingRequest.new
5417
+ #
5418
+ # # Call the initiate_delete_auto_protection_policy_binding method.
5419
+ # result = client.initiate_delete_auto_protection_policy_binding request
5420
+ #
5421
+ # # The returned object is of type Gapic::Operation. You can use it to
5422
+ # # check the status of an operation, cancel it, or wait for results.
5423
+ # # Here is how to wait for a response.
5424
+ # result.wait_until_done! timeout: 60
5425
+ # if result.response?
5426
+ # p result.response
5427
+ # else
5428
+ # puts "No response received."
5429
+ # end
5430
+ #
5431
+ def initiate_delete_auto_protection_policy_binding request, options = nil
5432
+ raise ::ArgumentError, "request must be provided" if request.nil?
5433
+
5434
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::InitiateDeleteAutoProtectionPolicyBindingRequest
5435
+
5436
+ # Converts hash and nil to an options object
5437
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5438
+
5439
+ # Customize the options with defaults
5440
+ metadata = @config.rpcs.initiate_delete_auto_protection_policy_binding.metadata.to_h
5441
+
5442
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5443
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5444
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5445
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5446
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5447
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5448
+
5449
+ header_params = {}
5450
+ if request.name
5451
+ header_params["name"] = request.name
5452
+ end
5453
+
5454
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5455
+ metadata[:"x-goog-request-params"] ||= request_params_header
5456
+
5457
+ options.apply_defaults timeout: @config.rpcs.initiate_delete_auto_protection_policy_binding.timeout,
5458
+ metadata: metadata,
5459
+ retry_policy: @config.rpcs.initiate_delete_auto_protection_policy_binding.retry_policy
5460
+
5461
+ options.apply_defaults timeout: @config.timeout,
5462
+ metadata: @config.metadata,
5463
+ retry_policy: @config.retry_policy
5464
+
5465
+ @backup_dr_stub.call_rpc :initiate_delete_auto_protection_policy_binding, request, options: options do |response, operation|
5466
+ response = ::Gapic::Operation.new response, @operations_client, options: options
5467
+ yield response, operation if block_given?
5468
+ throw :response, response
5469
+ end
5470
+ rescue ::GRPC::BadStatus => e
5471
+ raise ::Google::Cloud::Error.from_error(e)
5472
+ end
5473
+
5474
+ ##
5475
+ # Lists Binding Matching Resources for a given AutoProtectionPolicyBinding.
5476
+ #
5477
+ # @overload list_binding_matching_resources(request, options = nil)
5478
+ # Pass arguments to `list_binding_matching_resources` via a request object, either of type
5479
+ # {::Google::Cloud::BackupDR::V1::ListBindingMatchingResourcesRequest} or an equivalent Hash.
5480
+ #
5481
+ # @param request [::Google::Cloud::BackupDR::V1::ListBindingMatchingResourcesRequest, ::Hash]
5482
+ # A request object representing the call parameters. Required. To specify no
5483
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5484
+ # @param options [::Gapic::CallOptions, ::Hash]
5485
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5486
+ #
5487
+ # @overload list_binding_matching_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
5488
+ # Pass arguments to `list_binding_matching_resources` via keyword arguments. Note that at
5489
+ # least one keyword argument is required. To specify no parameters, or to keep all
5490
+ # the default parameter values, pass an empty Hash as a request object (see above).
5491
+ #
5492
+ # @param parent [::String]
5493
+ # Required. The project, location, auto protection policy and binding for
5494
+ # which to retrieve `BindingMatchingResources` information. Format:
5495
+ # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}`.
5496
+ # In Google Cloud Backup and DR, locations map to Google Cloud regions, for
5497
+ # example **us-central1**.
5498
+ # @param page_size [::Integer]
5499
+ # Optional. The maximum number of `BindingMatchingResources` to return in a
5500
+ # single response. The default page size is 100 and maximum page size is 200.
5501
+ # Note that the response may include a partial list and a caller should
5502
+ # only rely on the response's
5503
+ # {::Google::Cloud::BackupDR::V1::ListBindingMatchingResourcesResponse#next_page_token next_page_token}
5504
+ # to determine if there are more instances left to be queried.
5505
+ # @param page_token [::String]
5506
+ # Optional. The value of
5507
+ # {::Google::Cloud::BackupDR::V1::ListBindingMatchingResourcesResponse#next_page_token next_page_token}
5508
+ # received from a previous `ListBindingMatchingResources` call. Provide this
5509
+ # to retrieve the subsequent page in a multi-page list of results. When
5510
+ # paginating, all other parameters provided to `ListBindingMatchingResources`
5511
+ # must match the call that provided the page token.
5512
+ # @param filter [::String]
5513
+ # Optional. Field match expression used to filter the results.
5514
+ # @param order_by [::String]
5515
+ # Optional. Field by which to sort the results.
5516
+ #
5517
+ # @yield [response, operation] Access the result along with the RPC operation
5518
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BindingMatchingResource>]
5519
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5520
+ #
5521
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BindingMatchingResource>]
5522
+ #
5523
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5524
+ #
5525
+ # @example Basic example
5526
+ # require "google/cloud/backupdr/v1"
5527
+ #
5528
+ # # Create a client object. The client can be reused for multiple calls.
5529
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5530
+ #
5531
+ # # Create a request. To set request fields, pass in keyword arguments.
5532
+ # request = Google::Cloud::BackupDR::V1::ListBindingMatchingResourcesRequest.new
5533
+ #
5534
+ # # Call the list_binding_matching_resources method.
5535
+ # result = client.list_binding_matching_resources request
5536
+ #
5537
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
5538
+ # # over elements, and API calls will be issued to fetch pages as needed.
5539
+ # result.each do |item|
5540
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::BindingMatchingResource.
5541
+ # p item
5542
+ # end
5543
+ #
5544
+ def list_binding_matching_resources request, options = nil
5545
+ raise ::ArgumentError, "request must be provided" if request.nil?
5546
+
5547
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBindingMatchingResourcesRequest
5548
+
5549
+ # Converts hash and nil to an options object
5550
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5551
+
5552
+ # Customize the options with defaults
5553
+ metadata = @config.rpcs.list_binding_matching_resources.metadata.to_h
5554
+
5555
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5556
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5557
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5558
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5559
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5560
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5561
+
5562
+ header_params = {}
5563
+ if request.parent
5564
+ header_params["parent"] = request.parent
5565
+ end
5566
+
5567
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5568
+ metadata[:"x-goog-request-params"] ||= request_params_header
5569
+
5570
+ options.apply_defaults timeout: @config.rpcs.list_binding_matching_resources.timeout,
5571
+ metadata: metadata,
5572
+ retry_policy: @config.rpcs.list_binding_matching_resources.retry_policy
5573
+
5574
+ options.apply_defaults timeout: @config.timeout,
5575
+ metadata: @config.metadata,
5576
+ retry_policy: @config.retry_policy
5577
+
5578
+ @backup_dr_stub.call_rpc :list_binding_matching_resources, request, options: options do |response, operation|
5579
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_binding_matching_resources, request, response, operation, options
5580
+ yield response, operation if block_given?
5581
+ throw :response, response
5582
+ end
5583
+ rescue ::GRPC::BadStatus => e
5584
+ raise ::Google::Cloud::Error.from_error(e)
5585
+ end
5586
+
5587
+ ##
5588
+ # Creates a new RestoreTemplate in a given project and location.
5589
+ #
5590
+ # @overload create_restore_template(request, options = nil)
5591
+ # Pass arguments to `create_restore_template` via a request object, either of type
5592
+ # {::Google::Cloud::BackupDR::V1::CreateRestoreTemplateRequest} or an equivalent Hash.
5593
+ #
5594
+ # @param request [::Google::Cloud::BackupDR::V1::CreateRestoreTemplateRequest, ::Hash]
5595
+ # A request object representing the call parameters. Required. To specify no
5596
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5597
+ # @param options [::Gapic::CallOptions, ::Hash]
5598
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5599
+ #
5600
+ # @overload create_restore_template(parent: nil, restore_template_id: nil, restore_template: nil, request_id: nil)
5601
+ # Pass arguments to `create_restore_template` via keyword arguments. Note that at
5602
+ # least one keyword argument is required. To specify no parameters, or to keep all
5603
+ # the default parameter values, pass an empty Hash as a request object (see above).
5604
+ #
5605
+ # @param parent [::String]
5606
+ # Required. The restore template project and location in the format
5607
+ # 'projects/\\{project_id}/locations/\\{location}'.
5608
+ # @param restore_template_id [::String]
5609
+ # Required. The ID of the restore template to create. The ID must be
5610
+ # unique for the specified project and location.
5611
+ # @param restore_template [::Google::Cloud::BackupDR::V1::RestoreTemplate, ::Hash]
5612
+ # Required. A RestoreTemplate resource.
5613
+ # @param request_id [::String]
5614
+ # Optional. An optional request ID to identify requests. Specify a unique
5615
+ # request ID so that if you must retry your request, the server will know to
5616
+ # ignore the request if it has already been completed.
5617
+ #
5618
+ # The request ID must be a valid UUID with the exception that zero UUID is
5619
+ # not supported (00000000-0000-0000-0000-000000000000).
5620
+ #
5621
+ # @yield [response, operation] Access the result along with the RPC operation
5622
+ # @yieldparam response [::Gapic::Operation]
5623
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5624
+ #
5625
+ # @return [::Gapic::Operation]
5626
+ #
5627
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5628
+ #
5629
+ # @example Basic example
5630
+ # require "google/cloud/backupdr/v1"
5631
+ #
5632
+ # # Create a client object. The client can be reused for multiple calls.
5633
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5634
+ #
5635
+ # # Create a request. To set request fields, pass in keyword arguments.
5636
+ # request = Google::Cloud::BackupDR::V1::CreateRestoreTemplateRequest.new
5637
+ #
5638
+ # # Call the create_restore_template method.
5639
+ # result = client.create_restore_template request
5640
+ #
5641
+ # # The returned object is of type Gapic::Operation. You can use it to
5642
+ # # check the status of an operation, cancel it, or wait for results.
5643
+ # # Here is how to wait for a response.
5644
+ # result.wait_until_done! timeout: 60
5645
+ # if result.response?
5646
+ # p result.response
5647
+ # else
5648
+ # puts "No response received."
5649
+ # end
5650
+ #
5651
+ def create_restore_template request, options = nil
5652
+ raise ::ArgumentError, "request must be provided" if request.nil?
5653
+
5654
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateRestoreTemplateRequest
5655
+
5656
+ # Converts hash and nil to an options object
5657
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5658
+
5659
+ # Customize the options with defaults
5660
+ metadata = @config.rpcs.create_restore_template.metadata.to_h
5661
+
5662
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5663
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5664
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5665
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5666
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5667
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5668
+
5669
+ header_params = {}
5670
+ if request.parent
5671
+ header_params["parent"] = request.parent
5672
+ end
5673
+
5674
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5675
+ metadata[:"x-goog-request-params"] ||= request_params_header
5676
+
5677
+ options.apply_defaults timeout: @config.rpcs.create_restore_template.timeout,
5678
+ metadata: metadata,
5679
+ retry_policy: @config.rpcs.create_restore_template.retry_policy
5680
+
5681
+ options.apply_defaults timeout: @config.timeout,
5682
+ metadata: @config.metadata,
5683
+ retry_policy: @config.retry_policy
5684
+
5685
+ @backup_dr_stub.call_rpc :create_restore_template, request, options: options do |response, operation|
5686
+ response = ::Gapic::Operation.new response, @operations_client, options: options
5687
+ yield response, operation if block_given?
5688
+ throw :response, response
5689
+ end
5690
+ rescue ::GRPC::BadStatus => e
5691
+ raise ::Google::Cloud::Error.from_error(e)
5692
+ end
5693
+
5694
+ ##
5695
+ # Gets details of a RestoreTemplate.
5696
+ #
5697
+ # @overload get_restore_template(request, options = nil)
5698
+ # Pass arguments to `get_restore_template` via a request object, either of type
5699
+ # {::Google::Cloud::BackupDR::V1::GetRestoreTemplateRequest} or an equivalent Hash.
5700
+ #
5701
+ # @param request [::Google::Cloud::BackupDR::V1::GetRestoreTemplateRequest, ::Hash]
5702
+ # A request object representing the call parameters. Required. To specify no
5703
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5704
+ # @param options [::Gapic::CallOptions, ::Hash]
5705
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5706
+ #
5707
+ # @overload get_restore_template(name: nil)
5708
+ # Pass arguments to `get_restore_template` via keyword arguments. Note that at
5709
+ # least one keyword argument is required. To specify no parameters, or to keep all
5710
+ # the default parameter values, pass an empty Hash as a request object (see above).
5711
+ #
5712
+ # @param name [::String]
5713
+ # Required. The name of the restore template to retrieve.
5714
+ # Format:
5715
+ # 'projects/\\{project_id}/locations/\\{location}/restoreTemplates/\\{restore_template_id}'
5716
+ #
5717
+ # @yield [response, operation] Access the result along with the RPC operation
5718
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::RestoreTemplate]
5719
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5720
+ #
5721
+ # @return [::Google::Cloud::BackupDR::V1::RestoreTemplate]
5722
+ #
5723
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5724
+ #
5725
+ # @example Basic example
5726
+ # require "google/cloud/backupdr/v1"
5727
+ #
5728
+ # # Create a client object. The client can be reused for multiple calls.
5729
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5730
+ #
5731
+ # # Create a request. To set request fields, pass in keyword arguments.
5732
+ # request = Google::Cloud::BackupDR::V1::GetRestoreTemplateRequest.new
5733
+ #
5734
+ # # Call the get_restore_template method.
5735
+ # result = client.get_restore_template request
5736
+ #
5737
+ # # The returned object is of type Google::Cloud::BackupDR::V1::RestoreTemplate.
5738
+ # p result
5739
+ #
5740
+ def get_restore_template request, options = nil
5741
+ raise ::ArgumentError, "request must be provided" if request.nil?
5742
+
5743
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetRestoreTemplateRequest
5744
+
5745
+ # Converts hash and nil to an options object
5746
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5747
+
5748
+ # Customize the options with defaults
5749
+ metadata = @config.rpcs.get_restore_template.metadata.to_h
5750
+
5751
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5752
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5753
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5754
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5755
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5756
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5757
+
5758
+ header_params = {}
5759
+ if request.name
5760
+ header_params["name"] = request.name
5761
+ end
5762
+
5763
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5764
+ metadata[:"x-goog-request-params"] ||= request_params_header
5765
+
5766
+ options.apply_defaults timeout: @config.rpcs.get_restore_template.timeout,
5767
+ metadata: metadata,
5768
+ retry_policy: @config.rpcs.get_restore_template.retry_policy
5769
+
5770
+ options.apply_defaults timeout: @config.timeout,
5771
+ metadata: @config.metadata,
5772
+ retry_policy: @config.retry_policy
5773
+
5774
+ @backup_dr_stub.call_rpc :get_restore_template, request, options: options do |response, operation|
5775
+ yield response, operation if block_given?
5776
+ end
5777
+ rescue ::GRPC::BadStatus => e
5778
+ raise ::Google::Cloud::Error.from_error(e)
5779
+ end
5780
+
5781
+ ##
5782
+ # Lists RestoreTemplates in a given project and location.
5783
+ #
5784
+ # @overload list_restore_templates(request, options = nil)
5785
+ # Pass arguments to `list_restore_templates` via a request object, either of type
5786
+ # {::Google::Cloud::BackupDR::V1::ListRestoreTemplatesRequest} or an equivalent Hash.
5787
+ #
5788
+ # @param request [::Google::Cloud::BackupDR::V1::ListRestoreTemplatesRequest, ::Hash]
5789
+ # A request object representing the call parameters. Required. To specify no
5790
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5791
+ # @param options [::Gapic::CallOptions, ::Hash]
5792
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5793
+ #
5794
+ # @overload list_restore_templates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
5795
+ # Pass arguments to `list_restore_templates` via keyword arguments. Note that at
5796
+ # least one keyword argument is required. To specify no parameters, or to keep all
5797
+ # the default parameter values, pass an empty Hash as a request object (see above).
5798
+ #
5799
+ # @param parent [::String]
5800
+ # Required. The project and location from which to list the restore
5801
+ # templates.
5802
+ # Format: `projects/{project}/locations/{location}`.
5803
+ # @param page_size [::Integer]
5804
+ # Optional. The maximum number of items to return.
5805
+ # @param page_token [::String]
5806
+ # Optional. A page token, received from a previous `ListRestoreTemplates`
5807
+ # call.
5808
+ # @param filter [::String]
5809
+ # Optional. Field match expression used to filter the results.
5810
+ # @param order_by [::String]
5811
+ # Optional. Field by which to sort the results.
5812
+ #
5813
+ # @yield [response, operation] Access the result along with the RPC operation
5814
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreTemplate>]
5815
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5816
+ #
5817
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreTemplate>]
5818
+ #
5819
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5820
+ #
5821
+ # @example Basic example
5822
+ # require "google/cloud/backupdr/v1"
5823
+ #
5824
+ # # Create a client object. The client can be reused for multiple calls.
5825
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5826
+ #
5827
+ # # Create a request. To set request fields, pass in keyword arguments.
5828
+ # request = Google::Cloud::BackupDR::V1::ListRestoreTemplatesRequest.new
5829
+ #
5830
+ # # Call the list_restore_templates method.
5831
+ # result = client.list_restore_templates request
5832
+ #
5833
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
5834
+ # # over elements, and API calls will be issued to fetch pages as needed.
5835
+ # result.each do |item|
5836
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::RestoreTemplate.
5837
+ # p item
5838
+ # end
5839
+ #
5840
+ def list_restore_templates request, options = nil
5841
+ raise ::ArgumentError, "request must be provided" if request.nil?
5842
+
5843
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListRestoreTemplatesRequest
5844
+
5845
+ # Converts hash and nil to an options object
5846
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5847
+
5848
+ # Customize the options with defaults
5849
+ metadata = @config.rpcs.list_restore_templates.metadata.to_h
5850
+
5851
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5852
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5853
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5854
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5855
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5856
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5857
+
5858
+ header_params = {}
5859
+ if request.parent
5860
+ header_params["parent"] = request.parent
5861
+ end
5862
+
5863
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5864
+ metadata[:"x-goog-request-params"] ||= request_params_header
5865
+
5866
+ options.apply_defaults timeout: @config.rpcs.list_restore_templates.timeout,
5867
+ metadata: metadata,
5868
+ retry_policy: @config.rpcs.list_restore_templates.retry_policy
5869
+
5870
+ options.apply_defaults timeout: @config.timeout,
5871
+ metadata: @config.metadata,
5872
+ retry_policy: @config.retry_policy
5873
+
5874
+ @backup_dr_stub.call_rpc :list_restore_templates, request, options: options do |response, operation|
5875
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_restore_templates, request, response, operation, options
5876
+ yield response, operation if block_given?
5877
+ throw :response, response
5878
+ end
5879
+ rescue ::GRPC::BadStatus => e
5880
+ raise ::Google::Cloud::Error.from_error(e)
5881
+ end
5882
+
5883
+ ##
5884
+ # Updates the settings of a RestoreTemplate.
5885
+ #
5886
+ # @overload update_restore_template(request, options = nil)
5887
+ # Pass arguments to `update_restore_template` via a request object, either of type
5888
+ # {::Google::Cloud::BackupDR::V1::UpdateRestoreTemplateRequest} or an equivalent Hash.
5889
+ #
5890
+ # @param request [::Google::Cloud::BackupDR::V1::UpdateRestoreTemplateRequest, ::Hash]
5891
+ # A request object representing the call parameters. Required. To specify no
5892
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
5893
+ # @param options [::Gapic::CallOptions, ::Hash]
5894
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
5895
+ #
5896
+ # @overload update_restore_template(update_mask: nil, restore_template: nil, request_id: nil, validate_only: nil)
5897
+ # Pass arguments to `update_restore_template` via keyword arguments. Note that at
5898
+ # least one keyword argument is required. To specify no parameters, or to keep all
5899
+ # the default parameter values, pass an empty Hash as a request object (see above).
5900
+ #
5901
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
5902
+ # Optional. The list of fields to update.
5903
+ # Field mask is used to specify the fields to be overwritten in the
5904
+ # RestoreTemplate resource by the update.
5905
+ # The fields specified in the update_mask are relative to the resource, not
5906
+ # the full request. A field will be overwritten if it is in the mask.
5907
+ # @param restore_template [::Google::Cloud::BackupDR::V1::RestoreTemplate, ::Hash]
5908
+ # Required. The restore template to update.
5909
+ # @param request_id [::String]
5910
+ # Optional. An optional request ID to identify requests. Specify a unique
5911
+ # request ID so that if you must retry your request, the server will know to
5912
+ # ignore the request if it has already been completed.
5913
+ #
5914
+ # The request ID must be a valid UUID with the exception that zero UUID is
5915
+ # not supported (00000000-0000-0000-0000-000000000000).
5916
+ # @param validate_only [::Boolean]
5917
+ # Optional. Only validate the request, but do not perform mutations.
5918
+ # The default is 'false'.
5919
+ #
5920
+ # @yield [response, operation] Access the result along with the RPC operation
5921
+ # @yieldparam response [::Gapic::Operation]
5922
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
5923
+ #
5924
+ # @return [::Gapic::Operation]
5925
+ #
5926
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
5927
+ #
5928
+ # @example Basic example
5929
+ # require "google/cloud/backupdr/v1"
5930
+ #
5931
+ # # Create a client object. The client can be reused for multiple calls.
5932
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
5933
+ #
5934
+ # # Create a request. To set request fields, pass in keyword arguments.
5935
+ # request = Google::Cloud::BackupDR::V1::UpdateRestoreTemplateRequest.new
5936
+ #
5937
+ # # Call the update_restore_template method.
5938
+ # result = client.update_restore_template request
5939
+ #
5940
+ # # The returned object is of type Gapic::Operation. You can use it to
5941
+ # # check the status of an operation, cancel it, or wait for results.
5942
+ # # Here is how to wait for a response.
5943
+ # result.wait_until_done! timeout: 60
5944
+ # if result.response?
5945
+ # p result.response
5946
+ # else
5947
+ # puts "No response received."
5948
+ # end
5949
+ #
5950
+ def update_restore_template request, options = nil
5951
+ raise ::ArgumentError, "request must be provided" if request.nil?
5952
+
5953
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateRestoreTemplateRequest
5954
+
5955
+ # Converts hash and nil to an options object
5956
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
5957
+
5958
+ # Customize the options with defaults
5959
+ metadata = @config.rpcs.update_restore_template.metadata.to_h
5960
+
5961
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
5962
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
5963
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
5964
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
5965
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
5966
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
5967
+
5968
+ header_params = {}
5969
+ if request.restore_template&.name
5970
+ header_params["restore_template.name"] = request.restore_template.name
5971
+ end
5972
+
5973
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
5974
+ metadata[:"x-goog-request-params"] ||= request_params_header
5975
+
5976
+ options.apply_defaults timeout: @config.rpcs.update_restore_template.timeout,
5977
+ metadata: metadata,
5978
+ retry_policy: @config.rpcs.update_restore_template.retry_policy
5979
+
5980
+ options.apply_defaults timeout: @config.timeout,
5981
+ metadata: @config.metadata,
5982
+ retry_policy: @config.retry_policy
5983
+
5984
+ @backup_dr_stub.call_rpc :update_restore_template, request, options: options do |response, operation|
5985
+ response = ::Gapic::Operation.new response, @operations_client, options: options
5986
+ yield response, operation if block_given?
5987
+ throw :response, response
5988
+ end
5989
+ rescue ::GRPC::BadStatus => e
5990
+ raise ::Google::Cloud::Error.from_error(e)
5991
+ end
5992
+
5993
+ ##
5994
+ # Deletes a RestoreTemplate.
5995
+ #
5996
+ # @overload delete_restore_template(request, options = nil)
5997
+ # Pass arguments to `delete_restore_template` via a request object, either of type
5998
+ # {::Google::Cloud::BackupDR::V1::DeleteRestoreTemplateRequest} or an equivalent Hash.
5999
+ #
6000
+ # @param request [::Google::Cloud::BackupDR::V1::DeleteRestoreTemplateRequest, ::Hash]
6001
+ # A request object representing the call parameters. Required. To specify no
6002
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6003
+ # @param options [::Gapic::CallOptions, ::Hash]
6004
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6005
+ #
6006
+ # @overload delete_restore_template(name: nil, request_id: nil, force: nil)
6007
+ # Pass arguments to `delete_restore_template` via keyword arguments. Note that at
6008
+ # least one keyword argument is required. To specify no parameters, or to keep all
6009
+ # the default parameter values, pass an empty Hash as a request object (see above).
6010
+ #
6011
+ # @param name [::String]
6012
+ # Required. The name of the restore template to delete.
6013
+ # Format:
6014
+ # 'projects/\\{project_id}/locations/\\{location}/restoreTemplates/\\{restore_template_id}'
6015
+ # @param request_id [::String]
6016
+ # Optional. An optional request ID to identify requests. Specify a unique
6017
+ # request ID so that if you must retry your request, the server will know to
6018
+ # ignore the request if it has already been completed.
6019
+ #
6020
+ # The request ID must be a valid UUID with the exception that zero UUID is
6021
+ # not supported (00000000-0000-0000-0000-000000000000).
6022
+ # @param force [::Boolean]
6023
+ # Optional. If set to true, any child RestoreTemplateExecutions will also be
6024
+ # deleted. If false and the RestoreTemplate has any child executions, the
6025
+ # request will fail.
6026
+ #
6027
+ # @yield [response, operation] Access the result along with the RPC operation
6028
+ # @yieldparam response [::Gapic::Operation]
6029
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6030
+ #
6031
+ # @return [::Gapic::Operation]
6032
+ #
6033
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6034
+ #
6035
+ # @example Basic example
6036
+ # require "google/cloud/backupdr/v1"
6037
+ #
6038
+ # # Create a client object. The client can be reused for multiple calls.
6039
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6040
+ #
6041
+ # # Create a request. To set request fields, pass in keyword arguments.
6042
+ # request = Google::Cloud::BackupDR::V1::DeleteRestoreTemplateRequest.new
6043
+ #
6044
+ # # Call the delete_restore_template method.
6045
+ # result = client.delete_restore_template request
6046
+ #
6047
+ # # The returned object is of type Gapic::Operation. You can use it to
6048
+ # # check the status of an operation, cancel it, or wait for results.
6049
+ # # Here is how to wait for a response.
6050
+ # result.wait_until_done! timeout: 60
6051
+ # if result.response?
6052
+ # p result.response
6053
+ # else
6054
+ # puts "No response received."
6055
+ # end
6056
+ #
6057
+ def delete_restore_template request, options = nil
6058
+ raise ::ArgumentError, "request must be provided" if request.nil?
6059
+
6060
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteRestoreTemplateRequest
6061
+
6062
+ # Converts hash and nil to an options object
6063
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6064
+
6065
+ # Customize the options with defaults
6066
+ metadata = @config.rpcs.delete_restore_template.metadata.to_h
6067
+
6068
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6069
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6070
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6071
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6072
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6073
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6074
+
6075
+ header_params = {}
6076
+ if request.name
6077
+ header_params["name"] = request.name
6078
+ end
6079
+
6080
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6081
+ metadata[:"x-goog-request-params"] ||= request_params_header
6082
+
6083
+ options.apply_defaults timeout: @config.rpcs.delete_restore_template.timeout,
6084
+ metadata: metadata,
6085
+ retry_policy: @config.rpcs.delete_restore_template.retry_policy
6086
+
6087
+ options.apply_defaults timeout: @config.timeout,
6088
+ metadata: @config.metadata,
6089
+ retry_policy: @config.retry_policy
6090
+
6091
+ @backup_dr_stub.call_rpc :delete_restore_template, request, options: options do |response, operation|
6092
+ response = ::Gapic::Operation.new response, @operations_client, options: options
6093
+ yield response, operation if block_given?
6094
+ throw :response, response
6095
+ end
6096
+ rescue ::GRPC::BadStatus => e
6097
+ raise ::Google::Cloud::Error.from_error(e)
6098
+ end
6099
+
6100
+ ##
6101
+ # Runs a RestoreTemplate.
6102
+ #
6103
+ # @overload run_restore_template(request, options = nil)
6104
+ # Pass arguments to `run_restore_template` via a request object, either of type
6105
+ # {::Google::Cloud::BackupDR::V1::RunRestoreTemplateRequest} or an equivalent Hash.
6106
+ #
6107
+ # @param request [::Google::Cloud::BackupDR::V1::RunRestoreTemplateRequest, ::Hash]
6108
+ # A request object representing the call parameters. Required. To specify no
6109
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6110
+ # @param options [::Gapic::CallOptions, ::Hash]
6111
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6112
+ #
6113
+ # @overload run_restore_template(name: nil, backup: nil, request_id: nil)
6114
+ # Pass arguments to `run_restore_template` via keyword arguments. Note that at
6115
+ # least one keyword argument is required. To specify no parameters, or to keep all
6116
+ # the default parameter values, pass an empty Hash as a request object (see above).
6117
+ #
6118
+ # @param name [::String]
6119
+ # Required. The name of the restore template to run.
6120
+ # Format:
6121
+ # 'projects/\\{project_id}/locations/\\{location}/restoreTemplates/\\{restore_template_id}'
6122
+ # @param backup [::String]
6123
+ # Optional. The resource name of the Backup to restore from.
6124
+ # If not specified, the latest backup matching the backup selection
6125
+ # configuration in the RestoreTemplate will be used.
6126
+ # Format:
6127
+ # 'projects/\\{project}/locations/\\{location}/backupVaults/\\{backup_vault}/dataSources/\\{data_source}/backups/\\{backup}'
6128
+ # @param request_id [::String]
6129
+ # Optional. An optional request ID to identify requests. Specify a unique
6130
+ # request ID so that if you must retry your request, the server will know to
6131
+ # ignore the request if it has already been completed.
6132
+ #
6133
+ # The request ID must be a valid UUID with the exception that zero UUID is
6134
+ # not supported (00000000-0000-0000-0000-000000000000).
6135
+ #
6136
+ # @yield [response, operation] Access the result along with the RPC operation
6137
+ # @yieldparam response [::Gapic::Operation]
6138
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6139
+ #
6140
+ # @return [::Gapic::Operation]
6141
+ #
6142
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6143
+ #
6144
+ # @example Basic example
6145
+ # require "google/cloud/backupdr/v1"
6146
+ #
6147
+ # # Create a client object. The client can be reused for multiple calls.
6148
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6149
+ #
6150
+ # # Create a request. To set request fields, pass in keyword arguments.
6151
+ # request = Google::Cloud::BackupDR::V1::RunRestoreTemplateRequest.new
6152
+ #
6153
+ # # Call the run_restore_template method.
6154
+ # result = client.run_restore_template request
6155
+ #
6156
+ # # The returned object is of type Gapic::Operation. You can use it to
6157
+ # # check the status of an operation, cancel it, or wait for results.
6158
+ # # Here is how to wait for a response.
6159
+ # result.wait_until_done! timeout: 60
6160
+ # if result.response?
6161
+ # p result.response
6162
+ # else
6163
+ # puts "No response received."
6164
+ # end
6165
+ #
6166
+ def run_restore_template request, options = nil
6167
+ raise ::ArgumentError, "request must be provided" if request.nil?
6168
+
6169
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::RunRestoreTemplateRequest
6170
+
6171
+ # Converts hash and nil to an options object
6172
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6173
+
6174
+ # Customize the options with defaults
6175
+ metadata = @config.rpcs.run_restore_template.metadata.to_h
6176
+
6177
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6178
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6179
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6180
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6181
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6182
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6183
+
6184
+ header_params = {}
6185
+ if request.name
6186
+ header_params["name"] = request.name
6187
+ end
6188
+
6189
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6190
+ metadata[:"x-goog-request-params"] ||= request_params_header
6191
+
6192
+ options.apply_defaults timeout: @config.rpcs.run_restore_template.timeout,
6193
+ metadata: metadata,
6194
+ retry_policy: @config.rpcs.run_restore_template.retry_policy
6195
+
6196
+ options.apply_defaults timeout: @config.timeout,
6197
+ metadata: @config.metadata,
6198
+ retry_policy: @config.retry_policy
6199
+
6200
+ @backup_dr_stub.call_rpc :run_restore_template, request, options: options do |response, operation|
6201
+ response = ::Gapic::Operation.new response, @operations_client, options: options
6202
+ yield response, operation if block_given?
6203
+ throw :response, response
6204
+ end
6205
+ rescue ::GRPC::BadStatus => e
6206
+ raise ::Google::Cloud::Error.from_error(e)
6207
+ end
6208
+
6209
+ ##
6210
+ # Gets details of a RestoreTemplateExecution.
6211
+ #
6212
+ # @overload get_restore_template_execution(request, options = nil)
6213
+ # Pass arguments to `get_restore_template_execution` via a request object, either of type
6214
+ # {::Google::Cloud::BackupDR::V1::GetRestoreTemplateExecutionRequest} or an equivalent Hash.
6215
+ #
6216
+ # @param request [::Google::Cloud::BackupDR::V1::GetRestoreTemplateExecutionRequest, ::Hash]
6217
+ # A request object representing the call parameters. Required. To specify no
6218
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6219
+ # @param options [::Gapic::CallOptions, ::Hash]
6220
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6221
+ #
6222
+ # @overload get_restore_template_execution(name: nil)
6223
+ # Pass arguments to `get_restore_template_execution` via keyword arguments. Note that at
6224
+ # least one keyword argument is required. To specify no parameters, or to keep all
6225
+ # the default parameter values, pass an empty Hash as a request object (see above).
6226
+ #
6227
+ # @param name [::String]
6228
+ # Required. The name of the restore template execution to retrieve.
6229
+ # Format:
6230
+ # 'projects/\\{project_id}/locations/\\{location}/restoreTemplates/\\{restore_template_id}/executions/\\{execution_id}'
6231
+ #
6232
+ # @yield [response, operation] Access the result along with the RPC operation
6233
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::RestoreTemplateExecution]
6234
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6235
+ #
6236
+ # @return [::Google::Cloud::BackupDR::V1::RestoreTemplateExecution]
6237
+ #
6238
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6239
+ #
6240
+ # @example Basic example
6241
+ # require "google/cloud/backupdr/v1"
6242
+ #
6243
+ # # Create a client object. The client can be reused for multiple calls.
6244
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6245
+ #
6246
+ # # Create a request. To set request fields, pass in keyword arguments.
6247
+ # request = Google::Cloud::BackupDR::V1::GetRestoreTemplateExecutionRequest.new
6248
+ #
6249
+ # # Call the get_restore_template_execution method.
6250
+ # result = client.get_restore_template_execution request
6251
+ #
6252
+ # # The returned object is of type Google::Cloud::BackupDR::V1::RestoreTemplateExecution.
6253
+ # p result
6254
+ #
6255
+ def get_restore_template_execution request, options = nil
6256
+ raise ::ArgumentError, "request must be provided" if request.nil?
6257
+
6258
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetRestoreTemplateExecutionRequest
6259
+
6260
+ # Converts hash and nil to an options object
6261
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6262
+
6263
+ # Customize the options with defaults
6264
+ metadata = @config.rpcs.get_restore_template_execution.metadata.to_h
6265
+
6266
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6267
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6269
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6270
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6271
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6272
+
6273
+ header_params = {}
6274
+ if request.name
6275
+ header_params["name"] = request.name
6276
+ end
6277
+
6278
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6279
+ metadata[:"x-goog-request-params"] ||= request_params_header
6280
+
6281
+ options.apply_defaults timeout: @config.rpcs.get_restore_template_execution.timeout,
6282
+ metadata: metadata,
6283
+ retry_policy: @config.rpcs.get_restore_template_execution.retry_policy
6284
+
6285
+ options.apply_defaults timeout: @config.timeout,
6286
+ metadata: @config.metadata,
6287
+ retry_policy: @config.retry_policy
6288
+
6289
+ @backup_dr_stub.call_rpc :get_restore_template_execution, request, options: options do |response, operation|
6290
+ yield response, operation if block_given?
6291
+ end
6292
+ rescue ::GRPC::BadStatus => e
6293
+ raise ::Google::Cloud::Error.from_error(e)
6294
+ end
6295
+
6296
+ ##
6297
+ # Lists RestoreTemplateExecutions in a given project, location and restore
6298
+ # template.
6299
+ #
6300
+ # @overload list_restore_template_executions(request, options = nil)
6301
+ # Pass arguments to `list_restore_template_executions` via a request object, either of type
6302
+ # {::Google::Cloud::BackupDR::V1::ListRestoreTemplateExecutionsRequest} or an equivalent Hash.
6303
+ #
6304
+ # @param request [::Google::Cloud::BackupDR::V1::ListRestoreTemplateExecutionsRequest, ::Hash]
6305
+ # A request object representing the call parameters. Required. To specify no
6306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6307
+ # @param options [::Gapic::CallOptions, ::Hash]
6308
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6309
+ #
6310
+ # @overload list_restore_template_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
6311
+ # Pass arguments to `list_restore_template_executions` via keyword arguments. Note that at
6312
+ # least one keyword argument is required. To specify no parameters, or to keep all
6313
+ # the default parameter values, pass an empty Hash as a request object (see above).
6314
+ #
6315
+ # @param parent [::String]
6316
+ # Required. The project, location, and restore template for which to retrieve
6317
+ # executions information.
6318
+ # Format:
6319
+ # `projects/{project}/locations/{location}/restoreTemplates/{restore_template}`.
6320
+ # @param page_size [::Integer]
6321
+ # Optional. Requested page size.
6322
+ # @param page_token [::String]
6323
+ # Optional. A token identifying a page of results.
6324
+ # @param filter [::String]
6325
+ # Optional. Filtering results.
6326
+ # @param order_by [::String]
6327
+ # Optional. Hint for how to order the results.
6328
+ #
6329
+ # @yield [response, operation] Access the result along with the RPC operation
6330
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreTemplateExecution>]
6331
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6332
+ #
6333
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreTemplateExecution>]
6334
+ #
6335
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6336
+ #
6337
+ # @example Basic example
6338
+ # require "google/cloud/backupdr/v1"
6339
+ #
6340
+ # # Create a client object. The client can be reused for multiple calls.
6341
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6342
+ #
6343
+ # # Create a request. To set request fields, pass in keyword arguments.
6344
+ # request = Google::Cloud::BackupDR::V1::ListRestoreTemplateExecutionsRequest.new
6345
+ #
6346
+ # # Call the list_restore_template_executions method.
6347
+ # result = client.list_restore_template_executions request
6348
+ #
6349
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
6350
+ # # over elements, and API calls will be issued to fetch pages as needed.
6351
+ # result.each do |item|
6352
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::RestoreTemplateExecution.
6353
+ # p item
6354
+ # end
6355
+ #
6356
+ def list_restore_template_executions request, options = nil
6357
+ raise ::ArgumentError, "request must be provided" if request.nil?
6358
+
6359
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListRestoreTemplateExecutionsRequest
6360
+
6361
+ # Converts hash and nil to an options object
6362
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6363
+
6364
+ # Customize the options with defaults
6365
+ metadata = @config.rpcs.list_restore_template_executions.metadata.to_h
6366
+
6367
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6368
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6369
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6370
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6371
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6372
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6373
+
6374
+ header_params = {}
6375
+ if request.parent
6376
+ header_params["parent"] = request.parent
6377
+ end
6378
+
6379
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6380
+ metadata[:"x-goog-request-params"] ||= request_params_header
6381
+
6382
+ options.apply_defaults timeout: @config.rpcs.list_restore_template_executions.timeout,
6383
+ metadata: metadata,
6384
+ retry_policy: @config.rpcs.list_restore_template_executions.retry_policy
6385
+
6386
+ options.apply_defaults timeout: @config.timeout,
6387
+ metadata: @config.metadata,
6388
+ retry_policy: @config.retry_policy
6389
+
6390
+ @backup_dr_stub.call_rpc :list_restore_template_executions, request, options: options do |response, operation|
6391
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_restore_template_executions, request, response, operation, options
6392
+ yield response, operation if block_given?
6393
+ throw :response, response
6394
+ end
6395
+ rescue ::GRPC::BadStatus => e
6396
+ raise ::Google::Cloud::Error.from_error(e)
6397
+ end
6398
+
6399
+ ##
6400
+ # Triggers cleanup of restored resources created during execution.
6401
+ #
6402
+ # @overload trigger_restore_cleanup(request, options = nil)
6403
+ # Pass arguments to `trigger_restore_cleanup` via a request object, either of type
6404
+ # {::Google::Cloud::BackupDR::V1::TriggerRestoreCleanupRequest} or an equivalent Hash.
6405
+ #
6406
+ # @param request [::Google::Cloud::BackupDR::V1::TriggerRestoreCleanupRequest, ::Hash]
6407
+ # A request object representing the call parameters. Required. To specify no
6408
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6409
+ # @param options [::Gapic::CallOptions, ::Hash]
6410
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6411
+ #
6412
+ # @overload trigger_restore_cleanup(name: nil, request_id: nil)
6413
+ # Pass arguments to `trigger_restore_cleanup` via keyword arguments. Note that at
6414
+ # least one keyword argument is required. To specify no parameters, or to keep all
6415
+ # the default parameter values, pass an empty Hash as a request object (see above).
6416
+ #
6417
+ # @param name [::String]
6418
+ # Required. Name of the restore template execution.
6419
+ # Format:
6420
+ # 'projects/\\{project_id}/locations/\\{location}/restoreTemplates/\\{restore_template_id}/executions/\\{execution_id}'
6421
+ # @param request_id [::String]
6422
+ # Optional. An optional request ID to identify requests. Specify a unique
6423
+ # request ID so that if you must retry your request, the server will know to
6424
+ # ignore the request if it has already been completed. The server will
6425
+ # guarantee that for at least 60 minutes after the first request.
6426
+ #
6427
+ # The request ID must be a valid UUID with the exception that zero UUID is
6428
+ # not supported (00000000-0000-0000-0000-000000000000).
6429
+ #
6430
+ # @yield [response, operation] Access the result along with the RPC operation
6431
+ # @yieldparam response [::Gapic::Operation]
6432
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6433
+ #
6434
+ # @return [::Gapic::Operation]
6435
+ #
6436
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6437
+ #
6438
+ # @example Basic example
6439
+ # require "google/cloud/backupdr/v1"
6440
+ #
6441
+ # # Create a client object. The client can be reused for multiple calls.
6442
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6443
+ #
6444
+ # # Create a request. To set request fields, pass in keyword arguments.
6445
+ # request = Google::Cloud::BackupDR::V1::TriggerRestoreCleanupRequest.new
6446
+ #
6447
+ # # Call the trigger_restore_cleanup method.
6448
+ # result = client.trigger_restore_cleanup request
6449
+ #
6450
+ # # The returned object is of type Gapic::Operation. You can use it to
6451
+ # # check the status of an operation, cancel it, or wait for results.
6452
+ # # Here is how to wait for a response.
6453
+ # result.wait_until_done! timeout: 60
6454
+ # if result.response?
6455
+ # p result.response
6456
+ # else
6457
+ # puts "No response received."
6458
+ # end
6459
+ #
6460
+ def trigger_restore_cleanup request, options = nil
6461
+ raise ::ArgumentError, "request must be provided" if request.nil?
6462
+
6463
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::TriggerRestoreCleanupRequest
6464
+
6465
+ # Converts hash and nil to an options object
6466
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6467
+
6468
+ # Customize the options with defaults
6469
+ metadata = @config.rpcs.trigger_restore_cleanup.metadata.to_h
6470
+
6471
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6472
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6473
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6474
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6475
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6476
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6477
+
6478
+ header_params = {}
6479
+ if request.name
6480
+ header_params["name"] = request.name
6481
+ end
6482
+
6483
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6484
+ metadata[:"x-goog-request-params"] ||= request_params_header
6485
+
6486
+ options.apply_defaults timeout: @config.rpcs.trigger_restore_cleanup.timeout,
6487
+ metadata: metadata,
6488
+ retry_policy: @config.rpcs.trigger_restore_cleanup.retry_policy
6489
+
6490
+ options.apply_defaults timeout: @config.timeout,
6491
+ metadata: @config.metadata,
6492
+ retry_policy: @config.retry_policy
6493
+
6494
+ @backup_dr_stub.call_rpc :trigger_restore_cleanup, request, options: options do |response, operation|
6495
+ response = ::Gapic::Operation.new response, @operations_client, options: options
6496
+ yield response, operation if block_given?
6497
+ throw :response, response
6498
+ end
6499
+ rescue ::GRPC::BadStatus => e
6500
+ raise ::Google::Cloud::Error.from_error(e)
6501
+ end
6502
+
6503
+ ##
6504
+ # Creates a new RestoreVerificationPlan in a given project and location.
6505
+ #
6506
+ # @overload create_restore_verification_plan(request, options = nil)
6507
+ # Pass arguments to `create_restore_verification_plan` via a request object, either of type
6508
+ # {::Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanRequest} or an equivalent Hash.
6509
+ #
6510
+ # @param request [::Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanRequest, ::Hash]
6511
+ # A request object representing the call parameters. Required. To specify no
6512
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6513
+ # @param options [::Gapic::CallOptions, ::Hash]
6514
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6515
+ #
6516
+ # @overload create_restore_verification_plan(parent: nil, restore_verification_plan_id: nil, restore_verification_plan: nil, request_id: nil)
6517
+ # Pass arguments to `create_restore_verification_plan` via keyword arguments. Note that at
6518
+ # least one keyword argument is required. To specify no parameters, or to keep all
6519
+ # the default parameter values, pass an empty Hash as a request object (see above).
6520
+ #
6521
+ # @param parent [::String]
6522
+ # Required. The `RestoreVerificationPlan` project and location in the format
6523
+ # `projects/{project}/locations/{location}`. In Google Cloud Backup and DR
6524
+ # locations map to Google Cloud regions, for example **us-central1**.
6525
+ # @param restore_verification_plan_id [::String]
6526
+ # Required. The name of the `RestoreVerificationPlan` to create. The name
6527
+ # must be unique for the specified project and location. The name must start
6528
+ # with a lowercase letter followed by up to 62 lowercase letters, numbers, or
6529
+ # hyphens. Pattern, `^[a-z]([-a-z0-9]*[a-z0-9])?$`.
6530
+ # @param restore_verification_plan [::Google::Cloud::BackupDR::V1::RestoreVerificationPlan, ::Hash]
6531
+ # Required. The `RestoreVerificationPlan` resource object to create.
6532
+ # @param request_id [::String]
6533
+ # Optional. An optional request ID to identify requests. Specify a unique
6534
+ # request ID so that if you must retry your request, the server will know to
6535
+ # ignore the request if it has already been completed. The server will
6536
+ # guarantee that for at least 60 minutes since the first request.
6537
+ #
6538
+ # For example, consider a situation where you make an initial request and
6539
+ # the request times out. If you make the request again with the same request
6540
+ # ID, the server can check if original operation with the same request ID
6541
+ # was received, and if so, will ignore the second request. This prevents
6542
+ # clients from accidentally creating duplicate commitments.
6543
+ #
6544
+ # The request ID must be a valid UUID with the exception that zero UUID is
6545
+ # not supported (00000000-0000-0000-0000-000000000000).
6546
+ #
6547
+ # @yield [response, operation] Access the result along with the RPC operation
6548
+ # @yieldparam response [::Gapic::Operation]
6549
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6550
+ #
6551
+ # @return [::Gapic::Operation]
6552
+ #
6553
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6554
+ #
6555
+ # @example Basic example
6556
+ # require "google/cloud/backupdr/v1"
6557
+ #
6558
+ # # Create a client object. The client can be reused for multiple calls.
6559
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6560
+ #
6561
+ # # Create a request. To set request fields, pass in keyword arguments.
6562
+ # request = Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanRequest.new
6563
+ #
6564
+ # # Call the create_restore_verification_plan method.
6565
+ # result = client.create_restore_verification_plan request
6566
+ #
6567
+ # # The returned object is of type Gapic::Operation. You can use it to
6568
+ # # check the status of an operation, cancel it, or wait for results.
6569
+ # # Here is how to wait for a response.
6570
+ # result.wait_until_done! timeout: 60
6571
+ # if result.response?
6572
+ # p result.response
6573
+ # else
6574
+ # puts "No response received."
6575
+ # end
6576
+ #
6577
+ def create_restore_verification_plan request, options = nil
6578
+ raise ::ArgumentError, "request must be provided" if request.nil?
6579
+
6580
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanRequest
6581
+
6582
+ # Converts hash and nil to an options object
6583
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6584
+
6585
+ # Customize the options with defaults
6586
+ metadata = @config.rpcs.create_restore_verification_plan.metadata.to_h
6587
+
6588
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6589
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6590
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6591
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6592
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6593
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6594
+
6595
+ header_params = {}
6596
+ if request.parent
6597
+ header_params["parent"] = request.parent
6598
+ end
6599
+
6600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6601
+ metadata[:"x-goog-request-params"] ||= request_params_header
6602
+
6603
+ options.apply_defaults timeout: @config.rpcs.create_restore_verification_plan.timeout,
6604
+ metadata: metadata,
6605
+ retry_policy: @config.rpcs.create_restore_verification_plan.retry_policy
6606
+
6607
+ options.apply_defaults timeout: @config.timeout,
6608
+ metadata: @config.metadata,
6609
+ retry_policy: @config.retry_policy
6610
+
6611
+ @backup_dr_stub.call_rpc :create_restore_verification_plan, request, options: options do |response, operation|
6612
+ response = ::Gapic::Operation.new response, @operations_client, options: options
6613
+ yield response, operation if block_given?
6614
+ throw :response, response
6615
+ end
6616
+ rescue ::GRPC::BadStatus => e
6617
+ raise ::Google::Cloud::Error.from_error(e)
6618
+ end
6619
+
6620
+ ##
6621
+ # Creates a new RestoreVerificationPlanAssociation in a given
6622
+ # RestoreVerificationPlan.
6623
+ #
6624
+ # @overload create_restore_verification_plan_association(request, options = nil)
6625
+ # Pass arguments to `create_restore_verification_plan_association` via a request object, either of type
6626
+ # {::Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanAssociationRequest} or an equivalent Hash.
6627
+ #
6628
+ # @param request [::Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanAssociationRequest, ::Hash]
6629
+ # A request object representing the call parameters. Required. To specify no
6630
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6631
+ # @param options [::Gapic::CallOptions, ::Hash]
6632
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6633
+ #
6634
+ # @overload create_restore_verification_plan_association(parent: nil, restore_verification_plan_association_id: nil, restore_verification_plan_association: nil, request_id: nil)
6635
+ # Pass arguments to `create_restore_verification_plan_association` via keyword arguments. Note that at
6636
+ # least one keyword argument is required. To specify no parameters, or to keep all
6637
+ # the default parameter values, pass an empty Hash as a request object (see above).
6638
+ #
6639
+ # @param parent [::String]
6640
+ # Required. The parent resource where this association will be created.
6641
+ # Format:
6642
+ # `projects/{project}/locations/{location}/restoreVerificationPlans/{restore_verification_plan}`
6643
+ # @param restore_verification_plan_association_id [::String]
6644
+ # Required. The ID to use for the association, which will become the final
6645
+ # component of the association's resource name.
6646
+ #
6647
+ # This value should be 1-63 characters, and valid characters are
6648
+ # /[a-z0-9_-]/.
6649
+ # @param restore_verification_plan_association [::Google::Cloud::BackupDR::V1::RestoreVerificationPlanAssociation, ::Hash]
6650
+ # Required. The RestoreVerificationPlanAssociation resource to create.
6651
+ # @param request_id [::String]
6652
+ # Optional. An optional request ID to identify requests. Specify a unique
6653
+ # request ID so that if you must retry your request, the server will know
6654
+ # that the server has already received the duplicate request and can avoid
6655
+ # responding with an error. The request ID must be a valid UUID with the
6656
+ # exception that zero UUID is not supported
6657
+ # (00000000-0000-0000-0000-000000000000).
6658
+ #
6659
+ # @yield [response, operation] Access the result along with the RPC operation
6660
+ # @yieldparam response [::Gapic::Operation]
6661
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6662
+ #
6663
+ # @return [::Gapic::Operation]
6664
+ #
6665
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6666
+ #
6667
+ # @example Basic example
6668
+ # require "google/cloud/backupdr/v1"
6669
+ #
6670
+ # # Create a client object. The client can be reused for multiple calls.
6671
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6672
+ #
6673
+ # # Create a request. To set request fields, pass in keyword arguments.
6674
+ # request = Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanAssociationRequest.new
6675
+ #
6676
+ # # Call the create_restore_verification_plan_association method.
6677
+ # result = client.create_restore_verification_plan_association request
6678
+ #
6679
+ # # The returned object is of type Gapic::Operation. You can use it to
6680
+ # # check the status of an operation, cancel it, or wait for results.
6681
+ # # Here is how to wait for a response.
6682
+ # result.wait_until_done! timeout: 60
6683
+ # if result.response?
6684
+ # p result.response
6685
+ # else
6686
+ # puts "No response received."
6687
+ # end
6688
+ #
6689
+ def create_restore_verification_plan_association request, options = nil
6690
+ raise ::ArgumentError, "request must be provided" if request.nil?
6691
+
6692
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateRestoreVerificationPlanAssociationRequest
6693
+
6694
+ # Converts hash and nil to an options object
6695
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6696
+
6697
+ # Customize the options with defaults
6698
+ metadata = @config.rpcs.create_restore_verification_plan_association.metadata.to_h
6699
+
6700
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6701
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6702
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6703
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6704
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6705
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6706
+
6707
+ header_params = {}
6708
+ if request.parent
6709
+ header_params["parent"] = request.parent
6710
+ end
6711
+
6712
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6713
+ metadata[:"x-goog-request-params"] ||= request_params_header
6714
+
6715
+ options.apply_defaults timeout: @config.rpcs.create_restore_verification_plan_association.timeout,
6716
+ metadata: metadata,
6717
+ retry_policy: @config.rpcs.create_restore_verification_plan_association.retry_policy
6718
+
6719
+ options.apply_defaults timeout: @config.timeout,
6720
+ metadata: @config.metadata,
6721
+ retry_policy: @config.retry_policy
6722
+
6723
+ @backup_dr_stub.call_rpc :create_restore_verification_plan_association, request, options: options do |response, operation|
6724
+ response = ::Gapic::Operation.new response, @operations_client, options: options
6725
+ yield response, operation if block_given?
6726
+ throw :response, response
6727
+ end
6728
+ rescue ::GRPC::BadStatus => e
6729
+ raise ::Google::Cloud::Error.from_error(e)
6730
+ end
6731
+
6732
+ ##
6733
+ # Gets details of a single RestoreVerificationPlanAssociation in a given
6734
+ # RestoreVerificationPlan.
6735
+ #
6736
+ # @overload get_restore_verification_plan_association(request, options = nil)
6737
+ # Pass arguments to `get_restore_verification_plan_association` via a request object, either of type
6738
+ # {::Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanAssociationRequest} or an equivalent Hash.
6739
+ #
6740
+ # @param request [::Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanAssociationRequest, ::Hash]
6741
+ # A request object representing the call parameters. Required. To specify no
6742
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6743
+ # @param options [::Gapic::CallOptions, ::Hash]
6744
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6745
+ #
6746
+ # @overload get_restore_verification_plan_association(name: nil)
6747
+ # Pass arguments to `get_restore_verification_plan_association` via keyword arguments. Note that at
6748
+ # least one keyword argument is required. To specify no parameters, or to keep all
6749
+ # the default parameter values, pass an empty Hash as a request object (see above).
6750
+ #
6751
+ # @param name [::String]
6752
+ # Required. The resource name of the RestoreVerificationPlanAssociation to
6753
+ # retrieve.
6754
+ # Format:
6755
+ # `projects/{project}/locations/{location}/restoreVerificationPlans/{restore_verification_plan}/associations/{association}`
6756
+ #
6757
+ # @yield [response, operation] Access the result along with the RPC operation
6758
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::RestoreVerificationPlanAssociation]
6759
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6760
+ #
6761
+ # @return [::Google::Cloud::BackupDR::V1::RestoreVerificationPlanAssociation]
6762
+ #
6763
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6764
+ #
6765
+ # @example Basic example
6766
+ # require "google/cloud/backupdr/v1"
6767
+ #
6768
+ # # Create a client object. The client can be reused for multiple calls.
6769
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6770
+ #
6771
+ # # Create a request. To set request fields, pass in keyword arguments.
6772
+ # request = Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanAssociationRequest.new
6773
+ #
6774
+ # # Call the get_restore_verification_plan_association method.
6775
+ # result = client.get_restore_verification_plan_association request
6776
+ #
6777
+ # # The returned object is of type Google::Cloud::BackupDR::V1::RestoreVerificationPlanAssociation.
6778
+ # p result
6779
+ #
6780
+ def get_restore_verification_plan_association request, options = nil
6781
+ raise ::ArgumentError, "request must be provided" if request.nil?
6782
+
6783
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanAssociationRequest
6784
+
6785
+ # Converts hash and nil to an options object
6786
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6787
+
6788
+ # Customize the options with defaults
6789
+ metadata = @config.rpcs.get_restore_verification_plan_association.metadata.to_h
6790
+
6791
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6792
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6793
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6794
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6795
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6796
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6797
+
6798
+ header_params = {}
6799
+ if request.name
6800
+ header_params["name"] = request.name
6801
+ end
6802
+
6803
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6804
+ metadata[:"x-goog-request-params"] ||= request_params_header
6805
+
6806
+ options.apply_defaults timeout: @config.rpcs.get_restore_verification_plan_association.timeout,
6807
+ metadata: metadata,
6808
+ retry_policy: @config.rpcs.get_restore_verification_plan_association.retry_policy
6809
+
6810
+ options.apply_defaults timeout: @config.timeout,
6811
+ metadata: @config.metadata,
6812
+ retry_policy: @config.retry_policy
6813
+
6814
+ @backup_dr_stub.call_rpc :get_restore_verification_plan_association, request, options: options do |response, operation|
6815
+ yield response, operation if block_given?
6816
+ end
6817
+ rescue ::GRPC::BadStatus => e
6818
+ raise ::Google::Cloud::Error.from_error(e)
6819
+ end
6820
+
6821
+ ##
6822
+ # Lists RestoreVerificationPlanAssociations in a given
6823
+ # RestoreVerificationPlan.
6824
+ #
6825
+ # @overload list_restore_verification_plan_associations(request, options = nil)
6826
+ # Pass arguments to `list_restore_verification_plan_associations` via a request object, either of type
6827
+ # {::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlanAssociationsRequest} or an equivalent Hash.
6828
+ #
6829
+ # @param request [::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlanAssociationsRequest, ::Hash]
6830
+ # A request object representing the call parameters. Required. To specify no
6831
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6832
+ # @param options [::Gapic::CallOptions, ::Hash]
6833
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6834
+ #
6835
+ # @overload list_restore_verification_plan_associations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
6836
+ # Pass arguments to `list_restore_verification_plan_associations` via keyword arguments. Note that at
6837
+ # least one keyword argument is required. To specify no parameters, or to keep all
6838
+ # the default parameter values, pass an empty Hash as a request object (see above).
6839
+ #
6840
+ # @param parent [::String]
6841
+ # Required. The parent RestoreVerificationPlan name.
6842
+ # Format:
6843
+ # `projects/{project}/locations/{location}/restoreVerificationPlans/{restore_verification_plan}`
6844
+ # @param page_size [::Integer]
6845
+ # Optional. The maximum number of associations to return. The service may
6846
+ # return fewer than this value.
6847
+ # If unspecified, at most 500 associations will be returned.
6848
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
6849
+ # @param page_token [::String]
6850
+ # Optional. A page token, received from a previous
6851
+ # `ListRestoreVerificationPlanAssociations` call.
6852
+ # Provide this to retrieve the subsequent page.
6853
+ #
6854
+ # When paginating, all other parameters provided to
6855
+ # `ListRestoreVerificationPlanAssociations` must match the call that provided
6856
+ # the page token.
6857
+ # @param filter [::String]
6858
+ # Optional. Filtering results.
6859
+ # @param order_by [::String]
6860
+ # Optional. Hint for how to order the results.
6861
+ #
6862
+ # @yield [response, operation] Access the result along with the RPC operation
6863
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreVerificationPlanAssociation>]
6864
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6865
+ #
6866
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreVerificationPlanAssociation>]
6867
+ #
6868
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6869
+ #
6870
+ # @example Basic example
6871
+ # require "google/cloud/backupdr/v1"
6872
+ #
6873
+ # # Create a client object. The client can be reused for multiple calls.
6874
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6875
+ #
6876
+ # # Create a request. To set request fields, pass in keyword arguments.
6877
+ # request = Google::Cloud::BackupDR::V1::ListRestoreVerificationPlanAssociationsRequest.new
6878
+ #
6879
+ # # Call the list_restore_verification_plan_associations method.
6880
+ # result = client.list_restore_verification_plan_associations request
6881
+ #
6882
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
6883
+ # # over elements, and API calls will be issued to fetch pages as needed.
6884
+ # result.each do |item|
6885
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::RestoreVerificationPlanAssociation.
6886
+ # p item
6887
+ # end
6888
+ #
6889
+ def list_restore_verification_plan_associations request, options = nil
6890
+ raise ::ArgumentError, "request must be provided" if request.nil?
6891
+
6892
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlanAssociationsRequest
6893
+
6894
+ # Converts hash and nil to an options object
6895
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
6896
+
6897
+ # Customize the options with defaults
6898
+ metadata = @config.rpcs.list_restore_verification_plan_associations.metadata.to_h
6899
+
6900
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
6901
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
6902
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
6903
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
6904
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
6905
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
6906
+
6907
+ header_params = {}
6908
+ if request.parent
6909
+ header_params["parent"] = request.parent
6910
+ end
6911
+
6912
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
6913
+ metadata[:"x-goog-request-params"] ||= request_params_header
6914
+
6915
+ options.apply_defaults timeout: @config.rpcs.list_restore_verification_plan_associations.timeout,
6916
+ metadata: metadata,
6917
+ retry_policy: @config.rpcs.list_restore_verification_plan_associations.retry_policy
6918
+
6919
+ options.apply_defaults timeout: @config.timeout,
6920
+ metadata: @config.metadata,
6921
+ retry_policy: @config.retry_policy
6922
+
6923
+ @backup_dr_stub.call_rpc :list_restore_verification_plan_associations, request, options: options do |response, operation|
6924
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_restore_verification_plan_associations, request, response, operation, options
6925
+ yield response, operation if block_given?
6926
+ throw :response, response
6927
+ end
6928
+ rescue ::GRPC::BadStatus => e
6929
+ raise ::Google::Cloud::Error.from_error(e)
6930
+ end
6931
+
6932
+ ##
6933
+ # Deletes a single RestoreVerificationPlanAssociation in a given
6934
+ # RestoreVerificationPlan.
6935
+ #
6936
+ # @overload delete_restore_verification_plan_association(request, options = nil)
6937
+ # Pass arguments to `delete_restore_verification_plan_association` via a request object, either of type
6938
+ # {::Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanAssociationRequest} or an equivalent Hash.
6939
+ #
6940
+ # @param request [::Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanAssociationRequest, ::Hash]
6941
+ # A request object representing the call parameters. Required. To specify no
6942
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
6943
+ # @param options [::Gapic::CallOptions, ::Hash]
6944
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
6945
+ #
6946
+ # @overload delete_restore_verification_plan_association(name: nil, request_id: nil)
6947
+ # Pass arguments to `delete_restore_verification_plan_association` via keyword arguments. Note that at
6948
+ # least one keyword argument is required. To specify no parameters, or to keep all
6949
+ # the default parameter values, pass an empty Hash as a request object (see above).
6950
+ #
6951
+ # @param name [::String]
6952
+ # Required. The resource name of the RestoreVerificationPlanAssociation to
6953
+ # delete.
6954
+ # Format:
6955
+ # `projects/{project}/locations/{location}/restoreVerificationPlans/{restore_verification_plan}/associations/{association}`
6956
+ # @param request_id [::String]
6957
+ # Optional. An optional request ID to identify requests. Specify a unique
6958
+ # request ID so that if you must retry your request, the server will know
6959
+ # that the server has already received the duplicate request and can avoid
6960
+ # responding with an error. The request ID must be a valid UUID with the
6961
+ # exception that zero UUID is not supported
6962
+ # (00000000-0000-0000-0000-000000000000).
6963
+ #
6964
+ # @yield [response, operation] Access the result along with the RPC operation
6965
+ # @yieldparam response [::Gapic::Operation]
6966
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
6967
+ #
6968
+ # @return [::Gapic::Operation]
6969
+ #
6970
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
6971
+ #
6972
+ # @example Basic example
6973
+ # require "google/cloud/backupdr/v1"
6974
+ #
6975
+ # # Create a client object. The client can be reused for multiple calls.
6976
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
6977
+ #
6978
+ # # Create a request. To set request fields, pass in keyword arguments.
6979
+ # request = Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanAssociationRequest.new
6980
+ #
6981
+ # # Call the delete_restore_verification_plan_association method.
6982
+ # result = client.delete_restore_verification_plan_association request
6983
+ #
6984
+ # # The returned object is of type Gapic::Operation. You can use it to
6985
+ # # check the status of an operation, cancel it, or wait for results.
6986
+ # # Here is how to wait for a response.
6987
+ # result.wait_until_done! timeout: 60
6988
+ # if result.response?
6989
+ # p result.response
6990
+ # else
6991
+ # puts "No response received."
6992
+ # end
6993
+ #
6994
+ def delete_restore_verification_plan_association request, options = nil
6995
+ raise ::ArgumentError, "request must be provided" if request.nil?
6996
+
6997
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanAssociationRequest
6998
+
6999
+ # Converts hash and nil to an options object
7000
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7001
+
7002
+ # Customize the options with defaults
7003
+ metadata = @config.rpcs.delete_restore_verification_plan_association.metadata.to_h
7004
+
7005
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
7006
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7007
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7008
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
7009
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
7010
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7011
+
7012
+ header_params = {}
7013
+ if request.name
7014
+ header_params["name"] = request.name
7015
+ end
7016
+
7017
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7018
+ metadata[:"x-goog-request-params"] ||= request_params_header
7019
+
7020
+ options.apply_defaults timeout: @config.rpcs.delete_restore_verification_plan_association.timeout,
7021
+ metadata: metadata,
7022
+ retry_policy: @config.rpcs.delete_restore_verification_plan_association.retry_policy
7023
+
7024
+ options.apply_defaults timeout: @config.timeout,
7025
+ metadata: @config.metadata,
7026
+ retry_policy: @config.retry_policy
7027
+
7028
+ @backup_dr_stub.call_rpc :delete_restore_verification_plan_association, request, options: options do |response, operation|
7029
+ response = ::Gapic::Operation.new response, @operations_client, options: options
7030
+ yield response, operation if block_given?
7031
+ throw :response, response
7032
+ end
7033
+ rescue ::GRPC::BadStatus => e
7034
+ raise ::Google::Cloud::Error.from_error(e)
7035
+ end
7036
+
7037
+ ##
7038
+ # Triggers a new Restore Verification for the association in a given
7039
+ # RestoreVerificationPlan.
7040
+ #
7041
+ # @overload trigger_restore_verification(request, options = nil)
7042
+ # Pass arguments to `trigger_restore_verification` via a request object, either of type
7043
+ # {::Google::Cloud::BackupDR::V1::TriggerRestoreVerificationRequest} or an equivalent Hash.
7044
+ #
7045
+ # @param request [::Google::Cloud::BackupDR::V1::TriggerRestoreVerificationRequest, ::Hash]
7046
+ # A request object representing the call parameters. Required. To specify no
7047
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7048
+ # @param options [::Gapic::CallOptions, ::Hash]
7049
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7050
+ #
7051
+ # @overload trigger_restore_verification(name: nil, request_id: nil)
7052
+ # Pass arguments to `trigger_restore_verification` via keyword arguments. Note that at
7053
+ # least one keyword argument is required. To specify no parameters, or to keep all
7054
+ # the default parameter values, pass an empty Hash as a request object (see above).
7055
+ #
7056
+ # @param name [::String]
7057
+ # Required. The resource name of the RestoreVerificationPlanAssociation to
7058
+ # trigger.
7059
+ # Format:
7060
+ # `projects/{project}/locations/{location}/restoreVerificationPlans/{restore_verification_plan}/associations/{association}`
7061
+ # @param request_id [::String]
7062
+ # Optional. An optional request ID to identify requests. Specify a unique
7063
+ # request ID so that if you must retry your request, the server will know
7064
+ # that the server has already received the duplicate request and can avoid
7065
+ # responding with an error. The request ID must be a valid UUID with the
7066
+ # exception that zero UUID is not supported
7067
+ # (00000000-0000-0000-0000-000000000000).
7068
+ #
7069
+ # @yield [response, operation] Access the result along with the RPC operation
7070
+ # @yieldparam response [::Gapic::Operation]
7071
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7072
+ #
7073
+ # @return [::Gapic::Operation]
7074
+ #
7075
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7076
+ #
7077
+ # @example Basic example
7078
+ # require "google/cloud/backupdr/v1"
7079
+ #
7080
+ # # Create a client object. The client can be reused for multiple calls.
7081
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
7082
+ #
7083
+ # # Create a request. To set request fields, pass in keyword arguments.
7084
+ # request = Google::Cloud::BackupDR::V1::TriggerRestoreVerificationRequest.new
7085
+ #
7086
+ # # Call the trigger_restore_verification method.
7087
+ # result = client.trigger_restore_verification request
7088
+ #
7089
+ # # The returned object is of type Gapic::Operation. You can use it to
7090
+ # # check the status of an operation, cancel it, or wait for results.
7091
+ # # Here is how to wait for a response.
7092
+ # result.wait_until_done! timeout: 60
7093
+ # if result.response?
7094
+ # p result.response
7095
+ # else
7096
+ # puts "No response received."
7097
+ # end
7098
+ #
7099
+ def trigger_restore_verification request, options = nil
7100
+ raise ::ArgumentError, "request must be provided" if request.nil?
7101
+
7102
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::TriggerRestoreVerificationRequest
7103
+
7104
+ # Converts hash and nil to an options object
7105
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7106
+
7107
+ # Customize the options with defaults
7108
+ metadata = @config.rpcs.trigger_restore_verification.metadata.to_h
7109
+
7110
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
7111
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7112
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7113
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
7114
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
7115
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7116
+
7117
+ header_params = {}
7118
+ if request.name
7119
+ header_params["name"] = request.name
7120
+ end
7121
+
7122
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7123
+ metadata[:"x-goog-request-params"] ||= request_params_header
7124
+
7125
+ options.apply_defaults timeout: @config.rpcs.trigger_restore_verification.timeout,
7126
+ metadata: metadata,
7127
+ retry_policy: @config.rpcs.trigger_restore_verification.retry_policy
7128
+
7129
+ options.apply_defaults timeout: @config.timeout,
7130
+ metadata: @config.metadata,
7131
+ retry_policy: @config.retry_policy
7132
+
7133
+ @backup_dr_stub.call_rpc :trigger_restore_verification, request, options: options do |response, operation|
7134
+ response = ::Gapic::Operation.new response, @operations_client, options: options
7135
+ yield response, operation if block_given?
7136
+ throw :response, response
7137
+ end
7138
+ rescue ::GRPC::BadStatus => e
7139
+ raise ::Google::Cloud::Error.from_error(e)
7140
+ end
7141
+
7142
+ ##
7143
+ # Gets details of a single RestoreVerificationPlan. Returns the requested
7144
+ # RestoreVerificationPlan.
7145
+ #
7146
+ # @overload get_restore_verification_plan(request, options = nil)
7147
+ # Pass arguments to `get_restore_verification_plan` via a request object, either of type
7148
+ # {::Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanRequest} or an equivalent Hash.
7149
+ #
7150
+ # @param request [::Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanRequest, ::Hash]
7151
+ # A request object representing the call parameters. Required. To specify no
7152
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7153
+ # @param options [::Gapic::CallOptions, ::Hash]
7154
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7155
+ #
7156
+ # @overload get_restore_verification_plan(name: nil)
7157
+ # Pass arguments to `get_restore_verification_plan` via keyword arguments. Note that at
7158
+ # least one keyword argument is required. To specify no parameters, or to keep all
7159
+ # the default parameter values, pass an empty Hash as a request object (see above).
7160
+ #
7161
+ # @param name [::String]
7162
+ # Required. The resource name of the `RestoreVerificationPlan` to retrieve.
7163
+ #
7164
+ # Format:
7165
+ # `projects/{project}/locations/{location}/restoreVerificationPlans/{restoreVerificationPlan}`
7166
+ #
7167
+ # @yield [response, operation] Access the result along with the RPC operation
7168
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::RestoreVerificationPlan]
7169
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7170
+ #
7171
+ # @return [::Google::Cloud::BackupDR::V1::RestoreVerificationPlan]
7172
+ #
7173
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7174
+ #
7175
+ # @example Basic example
7176
+ # require "google/cloud/backupdr/v1"
7177
+ #
7178
+ # # Create a client object. The client can be reused for multiple calls.
7179
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
7180
+ #
7181
+ # # Create a request. To set request fields, pass in keyword arguments.
7182
+ # request = Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanRequest.new
7183
+ #
7184
+ # # Call the get_restore_verification_plan method.
7185
+ # result = client.get_restore_verification_plan request
7186
+ #
7187
+ # # The returned object is of type Google::Cloud::BackupDR::V1::RestoreVerificationPlan.
7188
+ # p result
7189
+ #
7190
+ def get_restore_verification_plan request, options = nil
7191
+ raise ::ArgumentError, "request must be provided" if request.nil?
7192
+
7193
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetRestoreVerificationPlanRequest
7194
+
7195
+ # Converts hash and nil to an options object
7196
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7197
+
7198
+ # Customize the options with defaults
7199
+ metadata = @config.rpcs.get_restore_verification_plan.metadata.to_h
7200
+
7201
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
7202
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7203
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7204
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
7205
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
7206
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7207
+
7208
+ header_params = {}
7209
+ if request.name
7210
+ header_params["name"] = request.name
7211
+ end
7212
+
7213
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7214
+ metadata[:"x-goog-request-params"] ||= request_params_header
7215
+
7216
+ options.apply_defaults timeout: @config.rpcs.get_restore_verification_plan.timeout,
7217
+ metadata: metadata,
7218
+ retry_policy: @config.rpcs.get_restore_verification_plan.retry_policy
7219
+
7220
+ options.apply_defaults timeout: @config.timeout,
7221
+ metadata: @config.metadata,
7222
+ retry_policy: @config.retry_policy
7223
+
7224
+ @backup_dr_stub.call_rpc :get_restore_verification_plan, request, options: options do |response, operation|
7225
+ yield response, operation if block_given?
7226
+ end
7227
+ rescue ::GRPC::BadStatus => e
7228
+ raise ::Google::Cloud::Error.from_error(e)
7229
+ end
7230
+
7231
+ ##
7232
+ # Lists RestoreVerificationPlans in a given project and location.
7233
+ #
7234
+ # @overload list_restore_verification_plans(request, options = nil)
7235
+ # Pass arguments to `list_restore_verification_plans` via a request object, either of type
7236
+ # {::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlansRequest} or an equivalent Hash.
7237
+ #
7238
+ # @param request [::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlansRequest, ::Hash]
7239
+ # A request object representing the call parameters. Required. To specify no
7240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7241
+ # @param options [::Gapic::CallOptions, ::Hash]
7242
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7243
+ #
7244
+ # @overload list_restore_verification_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
7245
+ # Pass arguments to `list_restore_verification_plans` via keyword arguments. Note that at
7246
+ # least one keyword argument is required. To specify no parameters, or to keep all
7247
+ # the default parameter values, pass an empty Hash as a request object (see above).
7248
+ #
7249
+ # @param parent [::String]
7250
+ # Required. The project and location for which to retrieve
7251
+ # `RestoreVerificationPlans` information. Format:
7252
+ # `projects/{project}/locations/{location}`. In Google Cloud Backup and DR,
7253
+ # locations map to Google Cloud regions, for example **us-central1**. To
7254
+ # retrieve restore verification plans for all locations, use
7255
+ # "-" for the `{location}` value.
7256
+ # @param page_size [::Integer]
7257
+ # Optional. The maximum number of `RestoreVerificationPlans` to return in a
7258
+ # single response. If not specified, a default value will be chosen by the
7259
+ # service. Note that the response may include a partial list and a caller
7260
+ # should only rely on the response's
7261
+ # {::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlansResponse#next_page_token next_page_token}
7262
+ # to determine if there are more instances left to be queried.
7263
+ # @param page_token [::String]
7264
+ # Optional. The value of
7265
+ # {::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlansResponse#next_page_token next_page_token}
7266
+ # received from a previous `ListRestoreVerificationPlans` call.
7267
+ # Provide this to retrieve the subsequent page in a multi-page list of
7268
+ # results. When paginating, all other parameters provided to
7269
+ # `ListRestoreVerificationPlans` must match the call that provided the page
7270
+ # token.
7271
+ # @param filter [::String]
7272
+ # Optional. Field match expression used to filter the results.
7273
+ # @param order_by [::String]
7274
+ # Optional. Field by which to sort the results.
7275
+ #
7276
+ # @yield [response, operation] Access the result along with the RPC operation
7277
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreVerificationPlan>]
7278
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7279
+ #
7280
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::RestoreVerificationPlan>]
7281
+ #
7282
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7283
+ #
7284
+ # @example Basic example
7285
+ # require "google/cloud/backupdr/v1"
7286
+ #
7287
+ # # Create a client object. The client can be reused for multiple calls.
7288
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
7289
+ #
7290
+ # # Create a request. To set request fields, pass in keyword arguments.
7291
+ # request = Google::Cloud::BackupDR::V1::ListRestoreVerificationPlansRequest.new
7292
+ #
7293
+ # # Call the list_restore_verification_plans method.
7294
+ # result = client.list_restore_verification_plans request
7295
+ #
7296
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
7297
+ # # over elements, and API calls will be issued to fetch pages as needed.
7298
+ # result.each do |item|
7299
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::RestoreVerificationPlan.
7300
+ # p item
7301
+ # end
7302
+ #
7303
+ def list_restore_verification_plans request, options = nil
7304
+ raise ::ArgumentError, "request must be provided" if request.nil?
7305
+
7306
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListRestoreVerificationPlansRequest
7307
+
7308
+ # Converts hash and nil to an options object
7309
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7310
+
7311
+ # Customize the options with defaults
7312
+ metadata = @config.rpcs.list_restore_verification_plans.metadata.to_h
7313
+
7314
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
7315
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7316
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7317
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
7318
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
7319
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7320
+
7321
+ header_params = {}
7322
+ if request.parent
7323
+ header_params["parent"] = request.parent
7324
+ end
7325
+
7326
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7327
+ metadata[:"x-goog-request-params"] ||= request_params_header
7328
+
7329
+ options.apply_defaults timeout: @config.rpcs.list_restore_verification_plans.timeout,
7330
+ metadata: metadata,
7331
+ retry_policy: @config.rpcs.list_restore_verification_plans.retry_policy
7332
+
7333
+ options.apply_defaults timeout: @config.timeout,
7334
+ metadata: @config.metadata,
7335
+ retry_policy: @config.retry_policy
7336
+
7337
+ @backup_dr_stub.call_rpc :list_restore_verification_plans, request, options: options do |response, operation|
7338
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_restore_verification_plans, request, response, operation, options
7339
+ yield response, operation if block_given?
7340
+ throw :response, response
7341
+ end
7342
+ rescue ::GRPC::BadStatus => e
7343
+ raise ::Google::Cloud::Error.from_error(e)
7344
+ end
7345
+
7346
+ ##
7347
+ # Deletes a single RestoreVerificationPlan. If the `force` flag is set to
7348
+ # `true`, any RestoreVerificationPlanAssociations linked to this
7349
+ # RestoreVerificationPlan will also be deleted.
7350
+ #
7351
+ # @overload delete_restore_verification_plan(request, options = nil)
7352
+ # Pass arguments to `delete_restore_verification_plan` via a request object, either of type
7353
+ # {::Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanRequest} or an equivalent Hash.
7354
+ #
7355
+ # @param request [::Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanRequest, ::Hash]
7356
+ # A request object representing the call parameters. Required. To specify no
7357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
7358
+ # @param options [::Gapic::CallOptions, ::Hash]
7359
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
7360
+ #
7361
+ # @overload delete_restore_verification_plan(name: nil, request_id: nil, force: nil)
7362
+ # Pass arguments to `delete_restore_verification_plan` via keyword arguments. Note that at
7363
+ # least one keyword argument is required. To specify no parameters, or to keep all
7364
+ # the default parameter values, pass an empty Hash as a request object (see above).
7365
+ #
7366
+ # @param name [::String]
7367
+ # Required. The resource name of the `RestoreVerificationPlan` to delete.
7368
+ #
7369
+ # Format:
7370
+ # `projects/{project}/locations/{location}/restoreVerificationPlans/{restoreVerificationPlan}`
7371
+ # @param request_id [::String]
7372
+ # Optional. An optional request ID to identify requests. Specify a unique
7373
+ # request ID so that if you must retry your request, the server will know to
7374
+ # ignore the request if it has already been completed. The server will
7375
+ # guarantee that for at least 60 minutes after the first request.
7376
+ #
7377
+ # For example, consider a situation where you make an initial request and
7378
+ # the request times out. If you make the request again with the same request
7379
+ # ID, the server can check if original operation with the same request ID
7380
+ # was received, and if so, will ignore the second request. This prevents
7381
+ # clients from accidentally creating duplicate commitments.
7382
+ #
7383
+ # The request ID must be a valid UUID with the exception that zero UUID is
7384
+ # not supported (00000000-0000-0000-0000-000000000000).
7385
+ # @param force [::Boolean]
7386
+ # Optional. If set to true, any RestoreVerificationPlanAssociations linked to
7387
+ # this RestoreVerificationPlan will also be deleted.
7388
+ #
7389
+ # @yield [response, operation] Access the result along with the RPC operation
7390
+ # @yieldparam response [::Gapic::Operation]
7391
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
7392
+ #
7393
+ # @return [::Gapic::Operation]
7394
+ #
7395
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
7396
+ #
7397
+ # @example Basic example
7398
+ # require "google/cloud/backupdr/v1"
7399
+ #
7400
+ # # Create a client object. The client can be reused for multiple calls.
7401
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
7402
+ #
7403
+ # # Create a request. To set request fields, pass in keyword arguments.
7404
+ # request = Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanRequest.new
7405
+ #
7406
+ # # Call the delete_restore_verification_plan method.
7407
+ # result = client.delete_restore_verification_plan request
7408
+ #
7409
+ # # The returned object is of type Gapic::Operation. You can use it to
7410
+ # # check the status of an operation, cancel it, or wait for results.
7411
+ # # Here is how to wait for a response.
7412
+ # result.wait_until_done! timeout: 60
7413
+ # if result.response?
7414
+ # p result.response
7415
+ # else
7416
+ # puts "No response received."
7417
+ # end
7418
+ #
7419
+ def delete_restore_verification_plan request, options = nil
7420
+ raise ::ArgumentError, "request must be provided" if request.nil?
7421
+
7422
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteRestoreVerificationPlanRequest
7423
+
7424
+ # Converts hash and nil to an options object
7425
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
7426
+
7427
+ # Customize the options with defaults
7428
+ metadata = @config.rpcs.delete_restore_verification_plan.metadata.to_h
7429
+
7430
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
7431
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
7432
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
7433
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
7434
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
7435
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
7436
+
7437
+ header_params = {}
7438
+ if request.name
7439
+ header_params["name"] = request.name
7440
+ end
7441
+
7442
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
7443
+ metadata[:"x-goog-request-params"] ||= request_params_header
7444
+
7445
+ options.apply_defaults timeout: @config.rpcs.delete_restore_verification_plan.timeout,
7446
+ metadata: metadata,
7447
+ retry_policy: @config.rpcs.delete_restore_verification_plan.retry_policy
7448
+
7449
+ options.apply_defaults timeout: @config.timeout,
7450
+ metadata: @config.metadata,
7451
+ retry_policy: @config.retry_policy
7452
+
7453
+ @backup_dr_stub.call_rpc :delete_restore_verification_plan, request, options: options do |response, operation|
7454
+ response = ::Gapic::Operation.new response, @operations_client, options: options
7455
+ yield response, operation if block_given?
7456
+ throw :response, response
7457
+ end
7458
+ rescue ::GRPC::BadStatus => e
7459
+ raise ::Google::Cloud::Error.from_error(e)
7460
+ end
7461
+
7462
+ ##
7463
+ # Configuration class for the BackupDR API.
7464
+ #
7465
+ # This class represents the configuration for BackupDR,
7466
+ # providing control over timeouts, retry behavior, logging, transport
7467
+ # parameters, and other low-level controls. Certain parameters can also be
7468
+ # applied individually to specific RPCs. See
7469
+ # {::Google::Cloud::BackupDR::V1::BackupDR::Client::Configuration::Rpcs}
7470
+ # for a list of RPCs that can be configured independently.
7471
+ #
7472
+ # Configuration can be applied globally to all clients, or to a single client
7473
+ # on construction.
7474
+ #
7475
+ # @example
7476
+ #
7477
+ # # Modify the global config, setting the timeout for
7478
+ # # list_management_servers to 20 seconds,
7479
+ # # and all remaining timeouts to 10 seconds.
7480
+ # ::Google::Cloud::BackupDR::V1::BackupDR::Client.configure do |config|
7481
+ # config.timeout = 10.0
7482
+ # config.rpcs.list_management_servers.timeout = 20.0
7483
+ # end
7484
+ #
7485
+ # # Apply the above configuration only to a new client.
7486
+ # client = ::Google::Cloud::BackupDR::V1::BackupDR::Client.new do |config|
7487
+ # config.timeout = 10.0
7488
+ # config.rpcs.list_management_servers.timeout = 20.0
7489
+ # end
7490
+ #
7491
+ # @!attribute [rw] endpoint
7492
+ # A custom service endpoint, as a hostname or hostname:port. The default is
7493
+ # nil, indicating to use the default endpoint in the current universe domain.
7494
+ # @return [::String,nil]
7495
+ # @!attribute [rw] credentials
7496
+ # Credentials to send with calls. You may provide any of the following types:
7497
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
7498
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
7499
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
7500
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
7501
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
7502
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
7503
+ # * (`nil`) indicating no credentials
7504
+ #
7505
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
7506
+ # is deprecated. Providing an unvalidated credential configuration to
7507
+ # Google APIs can compromise the security of your systems and data.
7508
+ #
7509
+ # @example
7510
+ #
7511
+ # # The recommended way to provide credentials is to use the `make_creds` method
7512
+ # # on the appropriate credentials class for your environment.
7513
+ #
7514
+ # require "googleauth"
7515
+ #
7516
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
7517
+ # json_key_io: ::File.open("/path/to/keyfile.json")
7518
+ # )
7519
+ #
7520
+ # client = ::Google::Cloud::BackupDR::V1::BackupDR::Client.new do |config|
7521
+ # config.credentials = credentials
7522
+ # end
7523
+ #
7524
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
7525
+ # external source for authentication to Google Cloud, you must validate it before
7526
+ # providing it to a Google API client library. Providing an unvalidated credential
7527
+ # configuration to Google APIs can compromise the security of your systems and data.
7528
+ # For more information, refer to [Validate credential configurations from external
7529
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
7530
+ # @return [::Object]
7531
+ # @!attribute [rw] scope
7532
+ # The OAuth scopes
7533
+ # @return [::Array<::String>]
7534
+ # @!attribute [rw] lib_name
7535
+ # The library name as recorded in instrumentation and logging
7536
+ # @return [::String]
7537
+ # @!attribute [rw] lib_version
7538
+ # The library version as recorded in instrumentation and logging
7539
+ # @return [::String]
7540
+ # @!attribute [rw] channel_args
7541
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
7542
+ # `GRPC::Core::Channel` object is provided as the credential.
7543
+ # @return [::Hash]
7544
+ # @!attribute [rw] interceptors
7545
+ # An array of interceptors that are run before calls are executed.
7546
+ # @return [::Array<::GRPC::ClientInterceptor>]
7547
+ # @!attribute [rw] timeout
7548
+ # The call timeout in seconds.
7549
+ # @return [::Numeric]
7550
+ # @!attribute [rw] metadata
7551
+ # Additional gRPC headers to be sent with the call.
7552
+ # @return [::Hash{::Symbol=>::String}]
7553
+ # @!attribute [rw] retry_policy
7554
+ # The retry policy. The value is a hash with the following keys:
7555
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
7556
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
7557
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
7558
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
7559
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
7560
+ # trigger a retry.
7561
+ # @return [::Hash]
7562
+ # @!attribute [rw] quota_project
7563
+ # A separate project against which to charge quota.
7564
+ # @return [::String]
7565
+ # @!attribute [rw] universe_domain
7566
+ # The universe domain within which to make requests. This determines the
7567
+ # default endpoint URL. The default value of nil uses the environment
7568
+ # universe (usually the default "googleapis.com" universe).
7569
+ # @return [::String,nil]
7570
+ # @!attribute [rw] logger
7571
+ # A custom logger to use for request/response debug logging, or the value
7572
+ # `:default` (the default) to construct a default logger, or `nil` to
7573
+ # explicitly disable logging.
7574
+ # @return [::Logger,:default,nil]
7575
+ #
7576
+ class Configuration
7577
+ extend ::Gapic::Config
7578
+
7579
+ # @private
7580
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
7581
+ DEFAULT_ENDPOINT = "backupdr.googleapis.com"
7582
+
7583
+ config_attr :endpoint, nil, ::String, nil
7584
+ config_attr :credentials, nil do |value|
7585
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
7586
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
7587
+ allowed.any? { |klass| klass === value }
7588
+ end
7589
+ config_attr :scope, nil, ::String, ::Array, nil
7590
+ config_attr :lib_name, nil, ::String, nil
7591
+ config_attr :lib_version, nil, ::String, nil
7592
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
7593
+ config_attr :interceptors, nil, ::Array, nil
7594
+ config_attr :timeout, nil, ::Numeric, nil
7595
+ config_attr :metadata, nil, ::Hash, nil
7596
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
7597
+ config_attr :quota_project, nil, ::String, nil
7598
+ config_attr :universe_domain, nil, ::String, nil
7599
+ config_attr :logger, :default, ::Logger, nil, :default
7600
+
7601
+ # @private
7602
+ def initialize parent_config = nil
7603
+ @parent_config = parent_config unless parent_config.nil?
7604
+
7605
+ yield self if block_given?
7606
+ end
7607
+
7608
+ ##
7609
+ # Configurations for individual RPCs
7610
+ # @return [Rpcs]
7611
+ #
7612
+ def rpcs
7613
+ @rpcs ||= begin
7614
+ parent_rpcs = nil
7615
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
7616
+ Rpcs.new parent_rpcs
7617
+ end
7618
+ end
7619
+
7620
+ ##
7621
+ # Configuration for the channel pool
7622
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
7623
+ #
7624
+ def channel_pool
7625
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
7626
+ end
7627
+
7628
+ ##
7629
+ # Configuration RPC class for the BackupDR API.
7630
+ #
7631
+ # Includes fields providing the configuration for each RPC in this service.
7632
+ # Each configuration object is of type `Gapic::Config::Method` and includes
7633
+ # the following configuration fields:
4503
7634
  #
4504
7635
  # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
4505
7636
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
@@ -4698,6 +7829,151 @@ module Google
4698
7829
  # @return [::Gapic::Config::Method]
4699
7830
  #
4700
7831
  attr_reader :initialize_service
7832
+ ##
7833
+ # RPC-specific configuration for `create_auto_protection_policy`
7834
+ # @return [::Gapic::Config::Method]
7835
+ #
7836
+ attr_reader :create_auto_protection_policy
7837
+ ##
7838
+ # RPC-specific configuration for `list_auto_protection_policies`
7839
+ # @return [::Gapic::Config::Method]
7840
+ #
7841
+ attr_reader :list_auto_protection_policies
7842
+ ##
7843
+ # RPC-specific configuration for `get_auto_protection_policy`
7844
+ # @return [::Gapic::Config::Method]
7845
+ #
7846
+ attr_reader :get_auto_protection_policy
7847
+ ##
7848
+ # RPC-specific configuration for `update_auto_protection_policy`
7849
+ # @return [::Gapic::Config::Method]
7850
+ #
7851
+ attr_reader :update_auto_protection_policy
7852
+ ##
7853
+ # RPC-specific configuration for `delete_auto_protection_policy`
7854
+ # @return [::Gapic::Config::Method]
7855
+ #
7856
+ attr_reader :delete_auto_protection_policy
7857
+ ##
7858
+ # RPC-specific configuration for `create_auto_protection_policy_binding`
7859
+ # @return [::Gapic::Config::Method]
7860
+ #
7861
+ attr_reader :create_auto_protection_policy_binding
7862
+ ##
7863
+ # RPC-specific configuration for `get_auto_protection_policy_binding`
7864
+ # @return [::Gapic::Config::Method]
7865
+ #
7866
+ attr_reader :get_auto_protection_policy_binding
7867
+ ##
7868
+ # RPC-specific configuration for `list_auto_protection_policy_bindings`
7869
+ # @return [::Gapic::Config::Method]
7870
+ #
7871
+ attr_reader :list_auto_protection_policy_bindings
7872
+ ##
7873
+ # RPC-specific configuration for `list_applied_auto_protection_policies`
7874
+ # @return [::Gapic::Config::Method]
7875
+ #
7876
+ attr_reader :list_applied_auto_protection_policies
7877
+ ##
7878
+ # RPC-specific configuration for `initiate_delete_auto_protection_policy_binding`
7879
+ # @return [::Gapic::Config::Method]
7880
+ #
7881
+ attr_reader :initiate_delete_auto_protection_policy_binding
7882
+ ##
7883
+ # RPC-specific configuration for `list_binding_matching_resources`
7884
+ # @return [::Gapic::Config::Method]
7885
+ #
7886
+ attr_reader :list_binding_matching_resources
7887
+ ##
7888
+ # RPC-specific configuration for `create_restore_template`
7889
+ # @return [::Gapic::Config::Method]
7890
+ #
7891
+ attr_reader :create_restore_template
7892
+ ##
7893
+ # RPC-specific configuration for `get_restore_template`
7894
+ # @return [::Gapic::Config::Method]
7895
+ #
7896
+ attr_reader :get_restore_template
7897
+ ##
7898
+ # RPC-specific configuration for `list_restore_templates`
7899
+ # @return [::Gapic::Config::Method]
7900
+ #
7901
+ attr_reader :list_restore_templates
7902
+ ##
7903
+ # RPC-specific configuration for `update_restore_template`
7904
+ # @return [::Gapic::Config::Method]
7905
+ #
7906
+ attr_reader :update_restore_template
7907
+ ##
7908
+ # RPC-specific configuration for `delete_restore_template`
7909
+ # @return [::Gapic::Config::Method]
7910
+ #
7911
+ attr_reader :delete_restore_template
7912
+ ##
7913
+ # RPC-specific configuration for `run_restore_template`
7914
+ # @return [::Gapic::Config::Method]
7915
+ #
7916
+ attr_reader :run_restore_template
7917
+ ##
7918
+ # RPC-specific configuration for `get_restore_template_execution`
7919
+ # @return [::Gapic::Config::Method]
7920
+ #
7921
+ attr_reader :get_restore_template_execution
7922
+ ##
7923
+ # RPC-specific configuration for `list_restore_template_executions`
7924
+ # @return [::Gapic::Config::Method]
7925
+ #
7926
+ attr_reader :list_restore_template_executions
7927
+ ##
7928
+ # RPC-specific configuration for `trigger_restore_cleanup`
7929
+ # @return [::Gapic::Config::Method]
7930
+ #
7931
+ attr_reader :trigger_restore_cleanup
7932
+ ##
7933
+ # RPC-specific configuration for `create_restore_verification_plan`
7934
+ # @return [::Gapic::Config::Method]
7935
+ #
7936
+ attr_reader :create_restore_verification_plan
7937
+ ##
7938
+ # RPC-specific configuration for `create_restore_verification_plan_association`
7939
+ # @return [::Gapic::Config::Method]
7940
+ #
7941
+ attr_reader :create_restore_verification_plan_association
7942
+ ##
7943
+ # RPC-specific configuration for `get_restore_verification_plan_association`
7944
+ # @return [::Gapic::Config::Method]
7945
+ #
7946
+ attr_reader :get_restore_verification_plan_association
7947
+ ##
7948
+ # RPC-specific configuration for `list_restore_verification_plan_associations`
7949
+ # @return [::Gapic::Config::Method]
7950
+ #
7951
+ attr_reader :list_restore_verification_plan_associations
7952
+ ##
7953
+ # RPC-specific configuration for `delete_restore_verification_plan_association`
7954
+ # @return [::Gapic::Config::Method]
7955
+ #
7956
+ attr_reader :delete_restore_verification_plan_association
7957
+ ##
7958
+ # RPC-specific configuration for `trigger_restore_verification`
7959
+ # @return [::Gapic::Config::Method]
7960
+ #
7961
+ attr_reader :trigger_restore_verification
7962
+ ##
7963
+ # RPC-specific configuration for `get_restore_verification_plan`
7964
+ # @return [::Gapic::Config::Method]
7965
+ #
7966
+ attr_reader :get_restore_verification_plan
7967
+ ##
7968
+ # RPC-specific configuration for `list_restore_verification_plans`
7969
+ # @return [::Gapic::Config::Method]
7970
+ #
7971
+ attr_reader :list_restore_verification_plans
7972
+ ##
7973
+ # RPC-specific configuration for `delete_restore_verification_plan`
7974
+ # @return [::Gapic::Config::Method]
7975
+ #
7976
+ attr_reader :delete_restore_verification_plan
4701
7977
 
4702
7978
  # @private
4703
7979
  def initialize parent_rpcs = nil
@@ -4775,6 +8051,64 @@ module Google
4775
8051
  @fetch_data_source_references_for_resource_type = ::Gapic::Config::Method.new fetch_data_source_references_for_resource_type_config
4776
8052
  initialize_service_config = parent_rpcs.initialize_service if parent_rpcs.respond_to? :initialize_service
4777
8053
  @initialize_service = ::Gapic::Config::Method.new initialize_service_config
8054
+ create_auto_protection_policy_config = parent_rpcs.create_auto_protection_policy if parent_rpcs.respond_to? :create_auto_protection_policy
8055
+ @create_auto_protection_policy = ::Gapic::Config::Method.new create_auto_protection_policy_config
8056
+ list_auto_protection_policies_config = parent_rpcs.list_auto_protection_policies if parent_rpcs.respond_to? :list_auto_protection_policies
8057
+ @list_auto_protection_policies = ::Gapic::Config::Method.new list_auto_protection_policies_config
8058
+ get_auto_protection_policy_config = parent_rpcs.get_auto_protection_policy if parent_rpcs.respond_to? :get_auto_protection_policy
8059
+ @get_auto_protection_policy = ::Gapic::Config::Method.new get_auto_protection_policy_config
8060
+ update_auto_protection_policy_config = parent_rpcs.update_auto_protection_policy if parent_rpcs.respond_to? :update_auto_protection_policy
8061
+ @update_auto_protection_policy = ::Gapic::Config::Method.new update_auto_protection_policy_config
8062
+ delete_auto_protection_policy_config = parent_rpcs.delete_auto_protection_policy if parent_rpcs.respond_to? :delete_auto_protection_policy
8063
+ @delete_auto_protection_policy = ::Gapic::Config::Method.new delete_auto_protection_policy_config
8064
+ create_auto_protection_policy_binding_config = parent_rpcs.create_auto_protection_policy_binding if parent_rpcs.respond_to? :create_auto_protection_policy_binding
8065
+ @create_auto_protection_policy_binding = ::Gapic::Config::Method.new create_auto_protection_policy_binding_config
8066
+ get_auto_protection_policy_binding_config = parent_rpcs.get_auto_protection_policy_binding if parent_rpcs.respond_to? :get_auto_protection_policy_binding
8067
+ @get_auto_protection_policy_binding = ::Gapic::Config::Method.new get_auto_protection_policy_binding_config
8068
+ list_auto_protection_policy_bindings_config = parent_rpcs.list_auto_protection_policy_bindings if parent_rpcs.respond_to? :list_auto_protection_policy_bindings
8069
+ @list_auto_protection_policy_bindings = ::Gapic::Config::Method.new list_auto_protection_policy_bindings_config
8070
+ list_applied_auto_protection_policies_config = parent_rpcs.list_applied_auto_protection_policies if parent_rpcs.respond_to? :list_applied_auto_protection_policies
8071
+ @list_applied_auto_protection_policies = ::Gapic::Config::Method.new list_applied_auto_protection_policies_config
8072
+ initiate_delete_auto_protection_policy_binding_config = parent_rpcs.initiate_delete_auto_protection_policy_binding if parent_rpcs.respond_to? :initiate_delete_auto_protection_policy_binding
8073
+ @initiate_delete_auto_protection_policy_binding = ::Gapic::Config::Method.new initiate_delete_auto_protection_policy_binding_config
8074
+ list_binding_matching_resources_config = parent_rpcs.list_binding_matching_resources if parent_rpcs.respond_to? :list_binding_matching_resources
8075
+ @list_binding_matching_resources = ::Gapic::Config::Method.new list_binding_matching_resources_config
8076
+ create_restore_template_config = parent_rpcs.create_restore_template if parent_rpcs.respond_to? :create_restore_template
8077
+ @create_restore_template = ::Gapic::Config::Method.new create_restore_template_config
8078
+ get_restore_template_config = parent_rpcs.get_restore_template if parent_rpcs.respond_to? :get_restore_template
8079
+ @get_restore_template = ::Gapic::Config::Method.new get_restore_template_config
8080
+ list_restore_templates_config = parent_rpcs.list_restore_templates if parent_rpcs.respond_to? :list_restore_templates
8081
+ @list_restore_templates = ::Gapic::Config::Method.new list_restore_templates_config
8082
+ update_restore_template_config = parent_rpcs.update_restore_template if parent_rpcs.respond_to? :update_restore_template
8083
+ @update_restore_template = ::Gapic::Config::Method.new update_restore_template_config
8084
+ delete_restore_template_config = parent_rpcs.delete_restore_template if parent_rpcs.respond_to? :delete_restore_template
8085
+ @delete_restore_template = ::Gapic::Config::Method.new delete_restore_template_config
8086
+ run_restore_template_config = parent_rpcs.run_restore_template if parent_rpcs.respond_to? :run_restore_template
8087
+ @run_restore_template = ::Gapic::Config::Method.new run_restore_template_config
8088
+ get_restore_template_execution_config = parent_rpcs.get_restore_template_execution if parent_rpcs.respond_to? :get_restore_template_execution
8089
+ @get_restore_template_execution = ::Gapic::Config::Method.new get_restore_template_execution_config
8090
+ list_restore_template_executions_config = parent_rpcs.list_restore_template_executions if parent_rpcs.respond_to? :list_restore_template_executions
8091
+ @list_restore_template_executions = ::Gapic::Config::Method.new list_restore_template_executions_config
8092
+ trigger_restore_cleanup_config = parent_rpcs.trigger_restore_cleanup if parent_rpcs.respond_to? :trigger_restore_cleanup
8093
+ @trigger_restore_cleanup = ::Gapic::Config::Method.new trigger_restore_cleanup_config
8094
+ create_restore_verification_plan_config = parent_rpcs.create_restore_verification_plan if parent_rpcs.respond_to? :create_restore_verification_plan
8095
+ @create_restore_verification_plan = ::Gapic::Config::Method.new create_restore_verification_plan_config
8096
+ create_restore_verification_plan_association_config = parent_rpcs.create_restore_verification_plan_association if parent_rpcs.respond_to? :create_restore_verification_plan_association
8097
+ @create_restore_verification_plan_association = ::Gapic::Config::Method.new create_restore_verification_plan_association_config
8098
+ get_restore_verification_plan_association_config = parent_rpcs.get_restore_verification_plan_association if parent_rpcs.respond_to? :get_restore_verification_plan_association
8099
+ @get_restore_verification_plan_association = ::Gapic::Config::Method.new get_restore_verification_plan_association_config
8100
+ list_restore_verification_plan_associations_config = parent_rpcs.list_restore_verification_plan_associations if parent_rpcs.respond_to? :list_restore_verification_plan_associations
8101
+ @list_restore_verification_plan_associations = ::Gapic::Config::Method.new list_restore_verification_plan_associations_config
8102
+ delete_restore_verification_plan_association_config = parent_rpcs.delete_restore_verification_plan_association if parent_rpcs.respond_to? :delete_restore_verification_plan_association
8103
+ @delete_restore_verification_plan_association = ::Gapic::Config::Method.new delete_restore_verification_plan_association_config
8104
+ trigger_restore_verification_config = parent_rpcs.trigger_restore_verification if parent_rpcs.respond_to? :trigger_restore_verification
8105
+ @trigger_restore_verification = ::Gapic::Config::Method.new trigger_restore_verification_config
8106
+ get_restore_verification_plan_config = parent_rpcs.get_restore_verification_plan if parent_rpcs.respond_to? :get_restore_verification_plan
8107
+ @get_restore_verification_plan = ::Gapic::Config::Method.new get_restore_verification_plan_config
8108
+ list_restore_verification_plans_config = parent_rpcs.list_restore_verification_plans if parent_rpcs.respond_to? :list_restore_verification_plans
8109
+ @list_restore_verification_plans = ::Gapic::Config::Method.new list_restore_verification_plans_config
8110
+ delete_restore_verification_plan_config = parent_rpcs.delete_restore_verification_plan if parent_rpcs.respond_to? :delete_restore_verification_plan
8111
+ @delete_restore_verification_plan = ::Gapic::Config::Method.new delete_restore_verification_plan_config
4778
8112
 
4779
8113
  yield self if block_given?
4780
8114
  end