From 060790462ee19ae3f6b29cb364bcfa24cc2ab782 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Wed, 16 Sep 2026 14:54:25 -0400 Subject: [PATCH] feat(google/cloud/backupdr/v1beta): add google-cloud-backupdr-v1beta --- .release-please-manifest.json | 2 + google-cloud-backupdr-v1beta/.gitignore | 20 + .../.repo-metadata.json | 19 + google-cloud-backupdr-v1beta/.rubocop.yml | 33 + google-cloud-backupdr-v1beta/.toys.rb | 28 + google-cloud-backupdr-v1beta/.yardopts | 12 + .../AUTHENTICATION.md | 122 + google-cloud-backupdr-v1beta/CHANGELOG.md | 2 + google-cloud-backupdr-v1beta/Gemfile | 15 + google-cloud-backupdr-v1beta/LICENSE.md | 201 + google-cloud-backupdr-v1beta/README.md | 154 + google-cloud-backupdr-v1beta/Rakefile | 169 + .../gapic_metadata.json | 277 + .../google-cloud-backupdr-v1beta.gemspec | 30 + .../lib/google-cloud-backupdr-v1beta.rb | 21 + .../lib/google/cloud/backupdr/v1beta.rb | 46 + .../v1beta/appliedautoprotectionpolicy_pb.rb | 30 + .../v1beta/autoprotectionpolicy_pb.rb | 39 + .../v1beta/autoprotectionpolicybinding_pb.rb | 32 + .../v1beta/backup_dr_protection_summary.rb | 55 + .../backup_dr_protection_summary/client.rb | 532 ++ .../credentials.rb | 48 + .../backup_dr_protection_summary/paths.rb | 50 + .../backup_dr_protection_summary/rest.rb | 53 + .../rest/client.rb | 491 ++ .../rest/service_stub.rb | 142 + .../google/cloud/backupdr/v1beta/backupdr.rb | 56 + .../cloud/backupdr/v1beta/backupdr/client.rb | 6101 +++++++++++++++++ .../backupdr/v1beta/backupdr/credentials.rb | 48 + .../backupdr/v1beta/backupdr/operations.rb | 843 +++ .../cloud/backupdr/v1beta/backupdr/paths.rb | 372 + .../cloud/backupdr/v1beta/backupdr/rest.rb | 54 + .../backupdr/v1beta/backupdr/rest/client.rb | 5724 ++++++++++++++++ .../v1beta/backupdr/rest/operations.rb | 927 +++ .../v1beta/backupdr/rest/service_stub.rb | 3086 +++++++++ .../cloud/backupdr/v1beta/backupdr_pb.rb | 55 + .../backupdr/v1beta/backupdr_services_pb.rb | 145 + .../cloud/backupdr/v1beta/backupplan_pb.rb | 49 + .../v1beta/backupplanassociation_pb.rb | 42 + .../backupdr/v1beta/backupvault_alloydb_pb.rb | 30 + .../backupdr/v1beta/backupvault_ba_pb.rb | 24 + .../v1beta/backupvault_cloudsql_pb.rb | 30 + .../backupdr/v1beta/backupvault_disk_pb.rb | 33 + .../backupdr/v1beta/backupvault_gce_pb.rb | 66 + .../cloud/backupdr/v1beta/backupvault_pb.rb | 80 + .../v1beta/bindingmatchingresource_pb.rb | 31 + .../backupdr/v1beta/bindings_override.rb | 108 + .../backupdr/v1beta/datasourcereference_pb.rb | 35 + .../backupdr/v1beta/protection_summary_pb.rb | 40 + .../v1beta/protection_summary_services_pb.rb | 45 + .../lib/google/cloud/backupdr/v1beta/rest.rb | 39 + .../google/cloud/backupdr/v1beta/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../v1beta/appliedautoprotectionpolicy.rb | 121 + .../backupdr/v1beta/autoprotectionpolicy.rb | 277 + .../v1beta/autoprotectionpolicybinding.rb | 180 + .../google/cloud/backupdr/v1beta/backupdr.rb | 428 ++ .../cloud/backupdr/v1beta/backupplan.rb | 637 ++ .../backupdr/v1beta/backupplanassociation.rb | 423 ++ .../cloud/backupdr/v1beta/backupvault.rb | 1391 ++++ .../backupdr/v1beta/backupvault_alloydb.rb | 105 + .../cloud/backupdr/v1beta/backupvault_ba.rb | 47 + .../backupdr/v1beta/backupvault_cloudsql.rb | 131 + .../cloud/backupdr/v1beta/backupvault_disk.rb | 301 + .../cloud/backupdr/v1beta/backupvault_gce.rb | 1010 +++ .../v1beta/bindingmatchingresource.rb | 160 + .../backupdr/v1beta/datasourcereference.rb | 236 + .../backupdr/v1beta/protection_summary.rb | 309 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/timestamp.rb | 128 + .../proto_docs/google/protobuf/wrappers.rb | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/dayofweek.rb | 49 + .../proto_docs/google/type/month.rb | 64 + google-cloud-backupdr-v1beta/snippets/Gemfile | 32 + .../list_resource_backup_configs.rb | 51 + .../backupdr/create_auto_protection_policy.rb | 54 + .../create_auto_protection_policy_binding.rb | 54 + .../snippets/backupdr/create_backup_plan.rb | 54 + .../create_backup_plan_association.rb | 54 + .../snippets/backupdr/create_backup_vault.rb | 54 + .../backupdr/create_management_server.rb | 54 + .../backupdr/delete_auto_protection_policy.rb | 54 + .../snippets/backupdr/delete_backup.rb | 54 + .../snippets/backupdr/delete_backup_plan.rb | 54 + .../delete_backup_plan_association.rb | 54 + .../snippets/backupdr/delete_backup_vault.rb | 54 + .../backupdr/delete_management_server.rb | 54 + ...kup_plan_associations_for_resource_type.rb | 51 + .../fetch_backups_for_resource_type.rb | 51 + ...ata_source_references_for_resource_type.rb | 51 + .../backupdr/fetch_usable_backup_vaults.rb | 51 + .../backupdr/get_auto_protection_policy.rb | 47 + .../get_auto_protection_policy_binding.rb | 47 + .../snippets/backupdr/get_backup.rb | 47 + .../snippets/backupdr/get_backup_plan.rb | 47 + .../backupdr/get_backup_plan_association.rb | 47 + .../backupdr/get_backup_plan_revision.rb | 47 + .../snippets/backupdr/get_backup_vault.rb | 47 + .../backupdr/get_binding_matching_resource.rb | 47 + .../snippets/backupdr/get_data_source.rb | 47 + .../backupdr/get_data_source_reference.rb | 47 + .../backupdr/get_management_server.rb | 47 + .../snippets/backupdr/initialize_service.rb | 54 + ...e_delete_auto_protection_policy_binding.rb | 54 + .../list_applied_auto_protection_policies.rb | 51 + .../backupdr/list_auto_protection_policies.rb | 51 + .../list_auto_protection_policy_bindings.rb | 51 + .../backupdr/list_backup_plan_associations.rb | 51 + .../backupdr/list_backup_plan_revisions.rb | 51 + .../snippets/backupdr/list_backup_plans.rb | 51 + .../snippets/backupdr/list_backup_vaults.rb | 51 + .../snippets/backupdr/list_backups.rb | 51 + .../list_binding_matching_resources.rb | 51 + .../backupdr/list_data_source_references.rb | 51 + .../snippets/backupdr/list_data_sources.rb | 51 + .../backupdr/list_management_servers.rb | 51 + .../snippets/backupdr/restore_backup.rb | 54 + .../snippets/backupdr/trigger_backup.rb | 54 + .../backupdr/update_auto_protection_policy.rb | 54 + .../snippets/backupdr/update_backup.rb | 54 + .../snippets/backupdr/update_backup_plan.rb | 54 + .../update_backup_plan_association.rb | 54 + .../snippets/backupdr/update_backup_vault.rb | 54 + .../snippets/backupdr/update_data_source.rb | 54 + ...metadata_google.cloud.backupdr.v1beta.json | 2015 ++++++ ...backup_dr_protection_summary_paths_test.rb | 55 + .../backup_dr_protection_summary_rest_test.rb | 157 + .../backup_dr_protection_summary_test.rb | 175 + .../v1beta/backupdr_operations_test.rb | 400 ++ .../backupdr/v1beta/backupdr_paths_test.rb | 247 + .../backupdr/v1beta/backupdr_rest_test.rb | 2871 ++++++++ .../cloud/backupdr/v1beta/backupdr_test.rb | 3408 +++++++++ google-cloud-backupdr-v1beta/test/helper.rb | 35 + librarian.yaml | 8 + release-please-config.json | 4 + 145 files changed, 40651 insertions(+) create mode 100644 google-cloud-backupdr-v1beta/.gitignore create mode 100644 google-cloud-backupdr-v1beta/.repo-metadata.json create mode 100644 google-cloud-backupdr-v1beta/.rubocop.yml create mode 100644 google-cloud-backupdr-v1beta/.toys.rb create mode 100644 google-cloud-backupdr-v1beta/.yardopts create mode 100644 google-cloud-backupdr-v1beta/AUTHENTICATION.md create mode 100644 google-cloud-backupdr-v1beta/CHANGELOG.md create mode 100644 google-cloud-backupdr-v1beta/Gemfile create mode 100644 google-cloud-backupdr-v1beta/LICENSE.md create mode 100644 google-cloud-backupdr-v1beta/README.md create mode 100644 google-cloud-backupdr-v1beta/Rakefile create mode 100644 google-cloud-backupdr-v1beta/gapic_metadata.json create mode 100644 google-cloud-backupdr-v1beta/google-cloud-backupdr-v1beta.gemspec create mode 100644 google-cloud-backupdr-v1beta/lib/google-cloud-backupdr-v1beta.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/autoprotectionpolicy_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/autoprotectionpolicybinding_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/client.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/credentials.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/paths.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/client.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/service_stub.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/client.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/credentials.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/operations.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/paths.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/client.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/operations.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/service_stub.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr_services_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupplan_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupplanassociation_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupvault_alloydb_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupvault_ba_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupvault_cloudsql_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupvault_disk_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupvault_gce_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupvault_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/bindingmatchingresource_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/bindings_override.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/datasourcereference_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/protection_summary_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/protection_summary_services_pb.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/rest.rb create mode 100644 google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/version.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/README.md create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/api/client.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/api/field_behavior.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/api/field_info.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/api/resource.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicy.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicybinding.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupdr.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplan.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplanassociation.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_alloydb.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_ba.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_cloudsql.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_disk.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_gce.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/bindingmatchingresource.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/datasourcereference.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/protection_summary.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/longrunning/operations.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/protobuf/any.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/protobuf/empty.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/protobuf/wrappers.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/rpc/status.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/type/dayofweek.rb create mode 100644 google-cloud-backupdr-v1beta/proto_docs/google/type/month.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/Gemfile create mode 100644 google-cloud-backupdr-v1beta/snippets/backup_dr_protection_summary/list_resource_backup_configs.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy_binding.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan_association.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_vault.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/create_management_server.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/delete_auto_protection_policy.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan_association.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_vault.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/delete_management_server.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backup_plan_associations_for_resource_type.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backups_for_resource_type.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/fetch_data_source_references_for_resource_type.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/fetch_usable_backup_vaults.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy_binding.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_backup.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_association.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_revision.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_vault.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_binding_matching_resource.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source_reference.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/get_management_server.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/initialize_service.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/initiate_delete_auto_protection_policy_binding.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_applied_auto_protection_policies.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policies.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policy_bindings.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_associations.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_revisions.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plans.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_vaults.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_backups.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_binding_matching_resources.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_data_source_references.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_data_sources.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/list_management_servers.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/restore_backup.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/trigger_backup.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/update_auto_protection_policy.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/update_backup.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan_association.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_vault.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/backupdr/update_data_source.rb create mode 100644 google-cloud-backupdr-v1beta/snippets/snippet_metadata_google.cloud.backupdr.v1beta.json create mode 100644 google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_paths_test.rb create mode 100644 google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_rest_test.rb create mode 100644 google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_test.rb create mode 100644 google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_operations_test.rb create mode 100644 google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_paths_test.rb create mode 100644 google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_rest_test.rb create mode 100644 google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_test.rb create mode 100644 google-cloud-backupdr-v1beta/test/helper.rb diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c328103dab44..fb83c45fc866 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -125,6 +125,8 @@ "google-cloud-backupdr+FILLER": "0.0.0", "google-cloud-backupdr-v1": "1.11.2", "google-cloud-backupdr-v1+FILLER": "0.0.0", + "google-cloud-backupdr-v1beta": "0.0.1", + "google-cloud-backupdr-v1beta+FILLER": "0.0.0", "google-cloud-bare_metal_solution": "2.2.1", "google-cloud-bare_metal_solution+FILLER": "0.0.0", "google-cloud-bare_metal_solution-v2": "1.6.1", diff --git a/google-cloud-backupdr-v1beta/.gitignore b/google-cloud-backupdr-v1beta/.gitignore new file mode 100644 index 000000000000..a2e97ac84259 --- /dev/null +++ b/google-cloud-backupdr-v1beta/.gitignore @@ -0,0 +1,20 @@ +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/google-cloud-backupdr-v1beta/.repo-metadata.json b/google-cloud-backupdr-v1beta/.repo-metadata.json new file mode 100644 index 000000000000..30942f8a891b --- /dev/null +++ b/google-cloud-backupdr-v1beta/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_id": "backupdr.googleapis.com", + "api_shortname": "backupdr", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-backupdr-v1beta/latest", + "distribution_name": "google-cloud-backupdr-v1beta", + "is_cloud": true, + "language": "ruby", + "name": "backupdr", + "name_pretty": "Backup and DR Service V1BETA API", + "product_documentation": "https://cloud.google.com/backup-disaster-recovery/docs/reference/rpc", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "google-cloud-backupdr-v1beta is the official client library for the Backup and DR Service V1BETA API. Note that google-cloud-backupdr-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-backupdr instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/backup-disaster-recovery/docs/reference/rpc", + "ruby-cloud-path-override": "backup_dr=backupdr", + "ruby-cloud-namespace-override": "Backupdr=BackupDR", + "library_type": "GAPIC_AUTO" +} diff --git a/google-cloud-backupdr-v1beta/.rubocop.yml b/google-cloud-backupdr-v1beta/.rubocop.yml new file mode 100644 index 000000000000..d71dc49fc11f --- /dev/null +++ b/google-cloud-backupdr-v1beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-backupdr-v1beta.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-backupdr-v1beta.rb" diff --git a/google-cloud-backupdr-v1beta/.toys.rb b/google-cloud-backupdr-v1beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/google-cloud-backupdr-v1beta/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/google-cloud-backupdr-v1beta/.yardopts b/google-cloud-backupdr-v1beta/.yardopts new file mode 100644 index 000000000000..a8803a49c16e --- /dev/null +++ b/google-cloud-backupdr-v1beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Backup and DR Service V1BETA API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/google-cloud-backupdr-v1beta/AUTHENTICATION.md b/google-cloud-backupdr-v1beta/AUTHENTICATION.md new file mode 100644 index 000000000000..5cf0b9bee0a6 --- /dev/null +++ b/google-cloud-backupdr-v1beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-backupdr-v1beta library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-backupdr-v1beta library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/backupdr/v1beta" + +client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/backupdr/v1beta" + +::Google::Cloud::BackupDR::V1beta::BackupDR::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-backupdr-v1beta +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/backupdr/v1beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/google-cloud-backupdr-v1beta/CHANGELOG.md b/google-cloud-backupdr-v1beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/google-cloud-backupdr-v1beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/google-cloud-backupdr-v1beta/Gemfile b/google-cloud-backupdr-v1beta/Gemfile new file mode 100644 index 000000000000..823c136ec3c0 --- /dev/null +++ b/google-cloud-backupdr-v1beta/Gemfile @@ -0,0 +1,15 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-reporters", "~> 1.8.0", require: false +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/google-cloud-backupdr-v1beta/LICENSE.md b/google-cloud-backupdr-v1beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/google-cloud-backupdr-v1beta/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/google-cloud-backupdr-v1beta/README.md b/google-cloud-backupdr-v1beta/README.md new file mode 100644 index 000000000000..db1bdd61df1a --- /dev/null +++ b/google-cloud-backupdr-v1beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Backup and DR Service V1BETA API + +API Client library for the Backup and DR Service V1BETA API + +google-cloud-backupdr-v1beta is the official client library for the Backup and DR Service V1BETA API. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Backup and DR Service V1BETA API. Most users should consider using +the main client gem, +[google-cloud-backupdr](https://rubygems.org/gems/google-cloud-backupdr). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-backupdr-v1beta +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/backupdr.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/backupdr/v1beta" + +client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new +request = ::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new # (request fields as keyword arguments...) +response = client.list_management_servers request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-backupdr-v1beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/backup-disaster-recovery/docs/reference/rpc) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/backupdr/v1beta" +require "logger" + +client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.2+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-backupdr`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-backupdr-v1beta`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-backupdr`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-backupdr-v1beta`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/google-cloud-backupdr-v1beta/Rakefile b/google-cloud-backupdr-v1beta/Rakefile new file mode 100644 index 000000000000..ba789ef338c6 --- /dev/null +++ b/google-cloud-backupdr-v1beta/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-backupdr-v1beta acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/backupdr/v1beta/backupdr/credentials" + ::Google::Cloud::BackupDR::V1beta::BackupDR::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-backupdr-v1beta gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-backupdr-v1beta gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-backupdr-v1beta gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-backupdr-v1beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-backupdr-v1beta" + header "google-cloud-backupdr-v1beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-backupdr-v1beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-backupdr-v1beta test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-backupdr-v1beta smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-backupdr-v1beta acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/google-cloud-backupdr-v1beta/gapic_metadata.json b/google-cloud-backupdr-v1beta/gapic_metadata.json new file mode 100644 index 000000000000..47725293bcc2 --- /dev/null +++ b/google-cloud-backupdr-v1beta/gapic_metadata.json @@ -0,0 +1,277 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.backupdr.v1beta", + "libraryPackage": "::Google::Cloud::BackupDR::V1beta", + "services": { + "BackupDR": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client", + "rpcs": { + "ListManagementServers": { + "methods": [ + "list_management_servers" + ] + }, + "GetManagementServer": { + "methods": [ + "get_management_server" + ] + }, + "CreateManagementServer": { + "methods": [ + "create_management_server" + ] + }, + "DeleteManagementServer": { + "methods": [ + "delete_management_server" + ] + }, + "CreateBackupVault": { + "methods": [ + "create_backup_vault" + ] + }, + "ListBackupVaults": { + "methods": [ + "list_backup_vaults" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetch_usable_backup_vaults" + ] + }, + "GetBackupVault": { + "methods": [ + "get_backup_vault" + ] + }, + "UpdateBackupVault": { + "methods": [ + "update_backup_vault" + ] + }, + "DeleteBackupVault": { + "methods": [ + "delete_backup_vault" + ] + }, + "ListDataSources": { + "methods": [ + "list_data_sources" + ] + }, + "GetDataSource": { + "methods": [ + "get_data_source" + ] + }, + "UpdateDataSource": { + "methods": [ + "update_data_source" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "FetchBackupsForResourceType": { + "methods": [ + "fetch_backups_for_resource_type" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "UpdateBackup": { + "methods": [ + "update_backup" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "RestoreBackup": { + "methods": [ + "restore_backup" + ] + }, + "CreateBackupPlan": { + "methods": [ + "create_backup_plan" + ] + }, + "UpdateBackupPlan": { + "methods": [ + "update_backup_plan" + ] + }, + "GetBackupPlan": { + "methods": [ + "get_backup_plan" + ] + }, + "ListBackupPlans": { + "methods": [ + "list_backup_plans" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "delete_backup_plan" + ] + }, + "GetBackupPlanRevision": { + "methods": [ + "get_backup_plan_revision" + ] + }, + "ListBackupPlanRevisions": { + "methods": [ + "list_backup_plan_revisions" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "create_backup_plan_association" + ] + }, + "UpdateBackupPlanAssociation": { + "methods": [ + "update_backup_plan_association" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "get_backup_plan_association" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "list_backup_plan_associations" + ] + }, + "FetchBackupPlanAssociationsForResourceType": { + "methods": [ + "fetch_backup_plan_associations_for_resource_type" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "delete_backup_plan_association" + ] + }, + "TriggerBackup": { + "methods": [ + "trigger_backup" + ] + }, + "GetDataSourceReference": { + "methods": [ + "get_data_source_reference" + ] + }, + "ListDataSourceReferences": { + "methods": [ + "list_data_source_references" + ] + }, + "FetchDataSourceReferencesForResourceType": { + "methods": [ + "fetch_data_source_references_for_resource_type" + ] + }, + "InitializeService": { + "methods": [ + "initialize_service" + ] + }, + "CreateAutoProtectionPolicy": { + "methods": [ + "create_auto_protection_policy" + ] + }, + "ListAutoProtectionPolicies": { + "methods": [ + "list_auto_protection_policies" + ] + }, + "GetAutoProtectionPolicy": { + "methods": [ + "get_auto_protection_policy" + ] + }, + "UpdateAutoProtectionPolicy": { + "methods": [ + "update_auto_protection_policy" + ] + }, + "DeleteAutoProtectionPolicy": { + "methods": [ + "delete_auto_protection_policy" + ] + }, + "CreateAutoProtectionPolicyBinding": { + "methods": [ + "create_auto_protection_policy_binding" + ] + }, + "GetAutoProtectionPolicyBinding": { + "methods": [ + "get_auto_protection_policy_binding" + ] + }, + "ListAutoProtectionPolicyBindings": { + "methods": [ + "list_auto_protection_policy_bindings" + ] + }, + "ListAppliedAutoProtectionPolicies": { + "methods": [ + "list_applied_auto_protection_policies" + ] + }, + "InitiateDeleteAutoProtectionPolicyBinding": { + "methods": [ + "initiate_delete_auto_protection_policy_binding" + ] + }, + "GetBindingMatchingResource": { + "methods": [ + "get_binding_matching_resource" + ] + }, + "ListBindingMatchingResources": { + "methods": [ + "list_binding_matching_resources" + ] + } + } + } + } + }, + "BackupDrProtectionSummary": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client", + "rpcs": { + "ListResourceBackupConfigs": { + "methods": [ + "list_resource_backup_configs" + ] + } + } + } + } + } + } +} diff --git a/google-cloud-backupdr-v1beta/google-cloud-backupdr-v1beta.gemspec b/google-cloud-backupdr-v1beta/google-cloud-backupdr-v1beta.gemspec new file mode 100644 index 000000000000..c9cf71bb8c26 --- /dev/null +++ b/google-cloud-backupdr-v1beta/google-cloud-backupdr-v1beta.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/backupdr/v1beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-backupdr-v1beta" + gem.version = Google::Cloud::BackupDR::V1beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "google-cloud-backupdr-v1beta is the official client library for the Backup and DR Service V1BETA API. Note that google-cloud-backupdr-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-backupdr instead. See the readme for more details." + gem.summary = "API Client library for the Backup and DR Service V1BETA API" + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.3" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/google-cloud-backupdr-v1beta/lib/google-cloud-backupdr-v1beta.rb b/google-cloud-backupdr-v1beta/lib/google-cloud-backupdr-v1beta.rb new file mode 100644 index 000000000000..7b5e6844ea10 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google-cloud-backupdr-v1beta.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/backupdr/v1beta" diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta.rb new file mode 100644 index 000000000000..3c2f570e5588 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/backupdr/v1beta/backupdr" +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary" +require "google/cloud/backupdr/v1beta/version" + +module Google + module Cloud + module BackupDR + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/backupdr/v1beta" + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/backupdr/v1beta" + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + module V1beta + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" +require "google/cloud/backupdr/v1beta/_helpers" if ::File.file? helper_path diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy_pb.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy_pb.rb new file mode 100644 index 000000000000..e3f8358e821a --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/backupdr/v1beta/appliedautoprotectionpolicy.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/backupdr/v1beta/autoprotectionpolicy_pb' +require 'google/cloud/backupdr/v1beta/autoprotectionpolicybinding_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n>google/cloud/backupdr/v1beta/appliedautoprotectionpolicy.proto\x12\x1cgoogle.cloud.backupdr.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/backupdr/v1beta/autoprotectionpolicy.proto\x1a>google/cloud/backupdr/v1beta/autoprotectionpolicybinding.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x06\n\x1b\x41ppliedAutoProtectionPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0esource_binding\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12=\n\x08\x63riteria\x18\x03 \x01(\x0b\x32&.google.cloud.backupdr.v1beta.CriteriaB\x03\xe0\x41\x03\x12P\n\x13\x62\x61\x63kup_plan_details\x18\x04 \x03(\x0b\x32..google.cloud.backupdr.v1beta.BackupPlanDetailB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12_\n\x1a\x62inding_evaluation_summary\x18\x07 \x01(\x0b\x32\x36.google.cloud.backupdr.v1beta.BindingEvaluationSummaryB\x03\xe0\x41\x03\x12T\n\x06status\x18\x08 \x01(\x0e\x32?.google.cloud.backupdr.v1beta.AppliedAutoProtectionPolicy.StateB\x03\xe0\x41\x03\"P\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x16\n\x12\x44\x45LETION_INITIATED\x10\x03:\xdd\x01\xea\x41\xd9\x01\n3backupdr.googleapis.com/AppliedAutoProtectionPolicy\x12\x66projects/{project}/locations/{location}/appliedAutoProtectionPolicies/{applied_auto_protection_policy}*\x1d\x61ppliedAutoProtectionPolicies2\x1b\x61ppliedAutoProtectionPolicy\"\xc2\x01\n(ListAppliedAutoProtectionPoliciesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xc3\x01\n)ListAppliedAutoProtectionPoliciesResponse\x12\x63\n applied_auto_protection_policies\x18\x01 \x03(\x0b\x32\x39.google.cloud.backupdr.v1beta.AppliedAutoProtectionPolicy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x06\x42\xe4\x01\n com.google.cloud.backupdr.v1betaB AppliedAutoProtectionPolicyProtoP\x01Z] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest.new + # + # # Call the list_resource_backup_configs method. + # result = client.list_resource_backup_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig. + # p item + # end + # + def list_resource_backup_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_resource_backup_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_resource_backup_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_resource_backup_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_protection_summary_stub.call_rpc :list_resource_backup_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_protection_summary_stub, :list_resource_backup_configs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BackupDrProtectionSummary API. + # + # This class represents the configuration for BackupDrProtectionSummary, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_resource_backup_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_resource_backup_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_resource_backup_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "backupdr.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BackupDrProtectionSummary API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_resource_backup_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_resource_backup_configs + + # @private + def initialize parent_rpcs = nil + list_resource_backup_configs_config = parent_rpcs.list_resource_backup_configs if parent_rpcs.respond_to? :list_resource_backup_configs + @list_resource_backup_configs = ::Gapic::Config::Method.new list_resource_backup_configs_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/credentials.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/credentials.rb new file mode 100644 index 000000000000..d5a40815cdc5 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/credentials.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDrProtectionSummary + # Credentials for the BackupDrProtectionSummary API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-backupdr", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/paths.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/paths.rb new file mode 100644 index 000000000000..fc375bc49138 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDrProtectionSummary + # Path helper methods for the BackupDrProtectionSummary API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest.rb new file mode 100644 index 000000000000..18a12c9ddf9d --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/backupdr/v1beta/version" +require "google/cloud/backupdr/v1beta/bindings_override" + +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary/credentials" +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary/paths" +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/client" + +module Google + module Cloud + module BackupDR + module V1beta + ## + # The Protection Summary service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest" + # client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.new + # + module BackupDrProtectionSummary + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/client.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/client.rb new file mode 100644 index 000000000000..30f4ec5a154e --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/client.rb @@ -0,0 +1,491 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/backupdr/v1beta/protection_summary_pb" +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDrProtectionSummary + module Rest + ## + # REST client for the BackupDrProtectionSummary service. + # + # The Protection Summary service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "backupdr.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :backup_dr_protection_summary_stub + + ## + # Configure the BackupDrProtectionSummary Client class. + # + # See {::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BackupDrProtectionSummary clients + # ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "BackupDR", "V1beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_resource_backup_configs.timeout = 60.0 + default_config.rpcs.list_resource_backup_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BackupDrProtectionSummary Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @backup_dr_protection_summary_stub.universe_domain + end + + ## + # Create a new BackupDrProtectionSummary REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BackupDrProtectionSummary client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @backup_dr_protection_summary_stub = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @backup_dr_protection_summary_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_dr_protection_summary_stub.endpoint + config.universe_domain = @backup_dr_protection_summary_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @backup_dr_protection_summary_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_dr_protection_summary_stub.endpoint + config.universe_domain = @backup_dr_protection_summary_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @backup_dr_protection_summary_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @backup_dr_protection_summary_stub.logger + end + + # Service calls + + ## + # Lists ResourceBackupConfigs. + # + # @overload list_resource_backup_configs(request, options = nil) + # Pass arguments to `list_resource_backup_configs` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_resource_backup_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_resource_backup_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve resource backup + # configs. Format: 'projects/\\{project_id}/locations/\\{location}'. In Google + # Cloud Backup and DR, locations map to Google Cloud regions, for example + # **us-central1**. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will use 100 as default. Maximum value is + # 500 and values above 500 will be coerced to 500. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest.new + # + # # Call the list_resource_backup_configs method. + # result = client.list_resource_backup_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig. + # p item + # end + # + def list_resource_backup_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_resource_backup_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_resource_backup_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_resource_backup_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_protection_summary_stub.list_resource_backup_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_protection_summary_stub, :list_resource_backup_configs, "resource_backup_configs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BackupDrProtectionSummary REST API. + # + # This class represents the configuration for BackupDrProtectionSummary REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_resource_backup_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_resource_backup_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_resource_backup_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "backupdr.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the BackupDrProtectionSummary API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_resource_backup_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_resource_backup_configs + + # @private + def initialize parent_rpcs = nil + list_resource_backup_configs_config = parent_rpcs.list_resource_backup_configs if parent_rpcs.respond_to? :list_resource_backup_configs + @list_resource_backup_configs = ::Gapic::Config::Method.new list_resource_backup_configs_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/service_stub.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/service_stub.rb new file mode 100644 index 000000000000..e7293c383e8c --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest/service_stub.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/backupdr/v1beta/protection_summary_pb" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDrProtectionSummary + module Rest + ## + # REST service stub for the BackupDrProtectionSummary service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_resource_backup_configs REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsResponse] + # A result object deserialized from the server's reply + def list_resource_backup_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_resource_backup_configs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_resource_backup_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_resource_backup_configs REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_resource_backup_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/resourceBackupConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr.rb new file mode 100644 index 000000000000..1eb5fb8fd26d --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/backupdr/v1beta/version" + +require "google/cloud/backupdr/v1beta/backupdr/credentials" +require "google/cloud/backupdr/v1beta/backupdr/paths" +require "google/cloud/backupdr/v1beta/backupdr/operations" +require "google/cloud/backupdr/v1beta/backupdr/client" +require "google/cloud/backupdr/v1beta/backupdr/rest" + +module Google + module Cloud + module BackupDR + module V1beta + ## + # The BackupDR Service + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/backupdr/v1beta/backupdr" + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/backupdr/v1beta/backupdr/rest" + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + module BackupDR + end + end + end + end +end + +helper_path = ::File.join __dir__, "backupdr", "helpers.rb" +require "google/cloud/backupdr/v1beta/backupdr/helpers" if ::File.file? helper_path diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/client.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/client.rb new file mode 100644 index 000000000000..cd555cdaff06 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/client.rb @@ -0,0 +1,6101 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/backupdr/v1beta/backupdr_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDR + ## + # Client for the BackupDR service. + # + # The BackupDR Service + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "backupdr.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :backup_dr_stub + + ## + # Configure the BackupDR Client class. + # + # See {::Google::Cloud::BackupDR::V1beta::BackupDR::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BackupDR clients + # ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "BackupDR", "V1beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_management_servers.timeout = 60.0 + default_config.rpcs.list_management_servers.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_management_server.timeout = 60.0 + default_config.rpcs.get_management_server.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_management_server.timeout = 60.0 + + default_config.rpcs.delete_management_server.timeout = 60.0 + + default_config.rpcs.create_backup_vault.timeout = 60.0 + default_config.rpcs.create_backup_vault.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_backup_vaults.timeout = 60.0 + default_config.rpcs.list_backup_vaults.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.fetch_usable_backup_vaults.timeout = 60.0 + default_config.rpcs.fetch_usable_backup_vaults.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_backup_vault.timeout = 60.0 + default_config.rpcs.get_backup_vault.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_backup_vault.timeout = 60.0 + + default_config.rpcs.delete_backup_vault.timeout = 60.0 + default_config.rpcs.delete_backup_vault.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_data_sources.timeout = 60.0 + default_config.rpcs.list_data_sources.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_data_source.timeout = 60.0 + default_config.rpcs.get_data_source.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_data_source.timeout = 60.0 + + default_config.rpcs.list_backups.timeout = 60.0 + default_config.rpcs.list_backups.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_backup.timeout = 60.0 + default_config.rpcs.get_backup.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_backup.timeout = 60.0 + + default_config.rpcs.restore_backup.timeout = 60.0 + + default_config.rpcs.initialize_service.timeout = 60.0 + default_config.rpcs.initialize_service.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BackupDR Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::BackupDR::V1beta::BackupDR::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @backup_dr_stub.universe_domain + end + + ## + # Create a new BackupDR client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BackupDR client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/backupdr/v1beta/backupdr_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @backup_dr_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::BackupDR::V1beta::BackupDR::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @backup_dr_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_dr_stub.endpoint + config.universe_domain = @backup_dr_stub.universe_domain + config.logger = @backup_dr_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_dr_stub.endpoint + config.universe_domain = @backup_dr_stub.universe_domain + config.logger = @backup_dr_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupDR::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @backup_dr_stub.logger + end + + # Service calls + + ## + # Lists ManagementServers in a given project and location. + # + # @overload list_management_servers(request, options = nil) + # Pass arguments to `list_management_servers` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_management_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_management_servers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve management servers + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. + # In Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. To retrieve management servers for all locations, use "-" + # for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::ManagementServer>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::ManagementServer>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new + # + # # Call the list_management_servers method. + # result = client.list_management_servers request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::ManagementServer. + # p item + # end + # + def list_management_servers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_management_servers.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_management_servers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_management_servers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_management_servers, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_management_servers, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single ManagementServer. + # + # @overload get_management_server(request, options = nil) + # Pass arguments to `get_management_server` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_management_server(name: nil) + # Pass arguments to `get_management_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the management server resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/managementServers/\\{resource_name}' + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::ManagementServer] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ManagementServer] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetManagementServerRequest.new + # + # # Call the get_management_server method. + # result = client.get_management_server request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::ManagementServer. + # p result + # + def get_management_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_management_server.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_management_server.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_management_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_management_server, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new ManagementServer in a given project and location. + # + # @overload create_management_server(request, options = nil) + # Pass arguments to `create_management_server` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_management_server(parent: nil, management_server_id: nil, management_server: nil, request_id: nil) + # Pass arguments to `create_management_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The management server project and location in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and DR + # locations map to Google Cloud regions, for example **us-central1**. + # @param management_server_id [::String] + # Required. The name of the management server to create. The name must be + # unique for the specified project and location. + # @param management_server [::Google::Cloud::BackupDR::V1beta::ManagementServer, ::Hash] + # Required. A [management server + # resource][google.cloud.backupdr.v1.ManagementServer] + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest.new + # + # # Call the create_management_server method. + # result = client.create_management_server request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_management_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_management_server.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_management_server.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_management_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :create_management_server, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single ManagementServer. + # + # @overload delete_management_server(request, options = nil) + # Pass arguments to `delete_management_server` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_management_server(name: nil, request_id: nil) + # Pass arguments to `delete_management_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest.new + # + # # Call the delete_management_server method. + # result = client.delete_management_server request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_management_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_management_server.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_management_server.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_management_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :delete_management_server, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new BackupVault in a given project and location. + # + # @overload create_backup_vault(request, options = nil) + # Pass arguments to `create_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_backup_vault(parent: nil, backup_vault_id: nil, backup_vault: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param backup_vault_id [::String] + # Required. ID of the requesting object + # If auto-generating ID server-side, remove this field and + # backup_vault_id from the method_signature of Create RPC + # @param backup_vault [::Google::Cloud::BackupDR::V1beta::BackupVault, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest.new + # + # # Call the create_backup_vault method. + # result = client.create_backup_vault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_backup_vault.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :create_backup_vault, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupVaults in a given project and location. + # + # @overload list_backup_vaults(request, options = nil) + # Pass arguments to `list_backup_vaults` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `list_backup_vaults` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backupvault stores + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. + # To retrieve backupvault stores for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @param view [::Google::Cloud::BackupDR::V1beta::BackupVaultView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # Vault. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest.new + # + # # Call the list_backup_vaults method. + # result = client.list_backup_vaults request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupVault. + # p item + # end + # + def list_backup_vaults request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_vaults.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_vaults.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_vaults.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_backup_vaults, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_vaults, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # FetchUsableBackupVaults lists usable BackupVaults in a given project and + # location. Usable BackupVault are the ones that user has + # backupdr.backupVaults.get permission. + # + # @overload fetch_usable_backup_vaults(request, options = nil) + # Pass arguments to `fetch_usable_backup_vaults` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_usable_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `fetch_usable_backup_vaults` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backupvault stores + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. + # To retrieve backupvault stores for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest.new + # + # # Call the fetch_usable_backup_vaults method. + # result = client.fetch_usable_backup_vaults request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupVault. + # p item + # end + # + def fetch_usable_backup_vaults request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_usable_backup_vaults.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_usable_backup_vaults.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_usable_backup_vaults.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :fetch_usable_backup_vaults, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_usable_backup_vaults, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a BackupVault. + # + # @overload get_backup_vault(request, options = nil) + # Pass arguments to `get_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_vault(name: nil, view: nil) + # Pass arguments to `get_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backupvault store resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}' + # @param view [::Google::Cloud::BackupDR::V1beta::BackupVaultView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # Vault + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::BackupVault] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest.new + # + # # Call the get_backup_vault method. + # result = client.get_backup_vault request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupVault. + # p result + # + def get_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup_vault.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_backup_vault, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the settings of a BackupVault. + # + # @overload update_backup_vault(request, options = nil) + # Pass arguments to `update_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_backup_vault(update_mask: nil, backup_vault: nil, request_id: nil, validate_only: nil, force: nil, force_update_access_restriction: nil) + # Pass arguments to `update_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # BackupVault resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @param backup_vault [::Google::Cloud::BackupDR::V1beta::BackupVault, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # @param force [::Boolean] + # Optional. If set to true, will not check plan duration against backup vault + # enforcement duration. + # @param force_update_access_restriction [::Boolean] + # Optional. If set to true, we will force update access restriction even if + # some non compliant data sources are present. The default is 'false'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest.new + # + # # Call the update_backup_vault method. + # result = client.update_backup_vault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.backup_vault&.name + header_params["backup_vault.name"] = request.backup_vault.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_backup_vault.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :update_backup_vault, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a BackupVault. + # + # @overload delete_backup_vault(request, options = nil) + # Pass arguments to `delete_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil, ignore_backup_plan_references: nil) + # Pass arguments to `delete_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any data source from this backup vault will also + # be deleted. + # @param etag [::String] + # The current etag of the backup vault. + # If an etag is provided and does not match the current etag of the + # connection, deletion will be blocked. + # @param validate_only [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # @param allow_missing [::Boolean] + # Optional. If true and the BackupVault is not found, the request will + # succeed but no action will be taken. + # @param ignore_backup_plan_references [::Boolean] + # Optional. If set to true, backupvault deletion will proceed even if there + # are backup plans referencing the backupvault. The default is 'false'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest.new + # + # # Call the delete_backup_vault method. + # result = client.delete_backup_vault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_backup_vault.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :delete_backup_vault, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists DataSources in a given project and location. + # + # @overload list_data_sources(request, options = nil) + # Pass arguments to `list_data_sources` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_data_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_data_sources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve data + # sources information, in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and + # DR, locations map to Google Cloud regions, for example + # **us-central1**. + # To retrieve data sources for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSource>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest.new + # + # # Call the list_data_sources method. + # result = client.list_data_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSource. + # p item + # end + # + def list_data_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_data_sources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_data_sources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_data_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_data_sources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_data_sources, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a DataSource. + # + # @overload get_data_source(request, options = nil) + # Pass arguments to `get_data_source` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_data_source(name: nil) + # Pass arguments to `get_data_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the data source resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}/dataSource/\\{resource_name}' + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::DataSource] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::DataSource] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetDataSourceRequest.new + # + # # Call the get_data_source method. + # result = client.get_data_source request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::DataSource. + # p result + # + def get_data_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_data_source.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_data_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_data_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_data_source, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the settings of a DataSource. + # + # @overload update_data_source(request, options = nil) + # Pass arguments to `update_data_source` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_data_source(update_mask: nil, data_source: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_data_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # DataSource resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @param data_source [::Google::Cloud::BackupDR::V1beta::DataSource, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # Optional. Enable upsert. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest.new + # + # # Call the update_data_source method. + # result = client.update_data_source request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_data_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_data_source.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.data_source&.name + header_params["data_source.name"] = request.data_source.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_data_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_data_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :update_data_source, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Backups in a given project and location. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backup + # information, in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and + # DR, locations map to Google Cloud regions, for example + # **us-central1**. + # To retrieve data sources for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @param view [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetch Backups for a given resource type. + # + # @overload fetch_backups_for_resource_type(request, options = nil) + # Pass arguments to `fetch_backups_for_resource_type` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_backups_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `fetch_backups_for_resource_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Datasources are the parent resource for the backups. + # Format: + # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupVaultId}/dataSources/\\{datasourceId} + # @param resource_type [::String] + # Required. The type of the GCP resource. + # Ex: sqladmin.googleapis.com/Instance + # @param page_size [::Integer] + # Optional. The maximum number of Backups to return. The service may + # return fewer than this value. If unspecified, at most 50 + # Backups will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous call of + # `FetchBackupsForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchBackupsForResourceType` must match + # the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * name + # * state + # * backup_type + # * create_time + # * expire_time + # * enforced_retention_end_time + # * gcp_backup_plan_info.backup_plan + # * cloud_sql_instance_backup_properties.instance_tier + # * cloud_sql_instance_backup_properties.database_installed_version + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + # @param view [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. This parameter is used to specify the view of the backup. + # If not specified, the default view is BASIC. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest.new + # + # # Call the fetch_backups_for_resource_type method. + # result = client.fetch_backups_for_resource_type request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::Backup. + # p item + # end + # + def fetch_backups_for_resource_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_backups_for_resource_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_backups_for_resource_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_backups_for_resource_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :fetch_backups_for_resource_type, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_backups_for_resource_type, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a Backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup(name: nil, view: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the data source resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{backupVault}/dataSources/\\{datasource}/backups/\\{backup}' + # @param view [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_backup, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the settings of a Backup. + # + # @overload update_backup(request, options = nil) + # Pass arguments to `update_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_backup(update_mask: nil, backup: nil, request_id: nil) + # Pass arguments to `update_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Backup resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @param backup [::Google::Cloud::BackupDR::V1beta::Backup, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupRequest.new + # + # # Call the update_backup method. + # result = client.update_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.backup&.name + header_params["backup.name"] = request.backup.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :update_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :delete_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Restore from a Backup + # + # @overload restore_backup(request, options = nil) + # Pass arguments to `restore_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload restore_backup(compute_instance_target_environment: nil, disk_target_environment: nil, region_disk_target_environment: nil, compute_instance_restore_properties: nil, disk_restore_properties: nil, name: nil, request_id: nil, clear_overrides_field_mask: nil) + # Pass arguments to `restore_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param compute_instance_target_environment [::Google::Cloud::BackupDR::V1beta::ComputeInstanceTargetEnvironment, ::Hash] + # Compute Engine target environment to be used during restore. + # + # Note: The following parameters are mutually exclusive: `compute_instance_target_environment`, `disk_target_environment`, `region_disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disk_target_environment [::Google::Cloud::BackupDR::V1beta::DiskTargetEnvironment, ::Hash] + # Disk target environment to be used during restore. + # + # Note: The following parameters are mutually exclusive: `disk_target_environment`, `compute_instance_target_environment`, `region_disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param region_disk_target_environment [::Google::Cloud::BackupDR::V1beta::RegionDiskTargetEnvironment, ::Hash] + # Region disk target environment to be used during restore. + # + # Note: The following parameters are mutually exclusive: `region_disk_target_environment`, `compute_instance_target_environment`, `disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param compute_instance_restore_properties [::Google::Cloud::BackupDR::V1beta::ComputeInstanceRestoreProperties, ::Hash] + # Compute Engine instance properties to be overridden during restore. + # + # Note: The following parameters are mutually exclusive: `compute_instance_restore_properties`, `disk_restore_properties`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disk_restore_properties [::Google::Cloud::BackupDR::V1beta::DiskRestoreProperties, ::Hash] + # Disk properties to be overridden during restore. + # + # Note: The following parameters are mutually exclusive: `disk_restore_properties`, `compute_instance_restore_properties`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param name [::String] + # Required. The resource name of the Backup instance, in the format + # 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param clear_overrides_field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A field mask used to clear server-side default values + # for fields within the `instance_properties` oneof. + # + # When a field in this mask is cleared, the server will not apply its + # default logic (like inheriting a value from the source) for that field. + # + # The most common current use case is clearing default encryption keys. + # + # Examples of field mask paths: + # - Compute Instance Disks: + # `compute_instance_restore_properties.disks.*.disk_encryption_key` + # - Single Disk: `disk_restore_properties.disk_encryption_key` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::RestoreBackupRequest.new + # + # # Call the restore_backup method. + # result = client.restore_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def restore_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.restore_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.restore_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :restore_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a BackupPlan + # + # @overload create_backup_plan(request, options = nil) + # Pass arguments to `create_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_backup_plan(parent: nil, backup_plan_id: nil, backup_plan: nil, request_id: nil) + # Pass arguments to `create_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The `BackupPlan` project and location in the format + # `projects/{project}/locations/{location}`. In Google Cloud Backup and DR + # locations map to Google Cloud regions, for example **us-central1**. + # @param backup_plan_id [::String] + # Required. The name of the `BackupPlan` to create. The name must be unique + # for the specified project and location.The name must start with a lowercase + # letter followed by up to 62 lowercase letters, numbers, or hyphens. + # Pattern, /[a-z][a-z0-9-]\\{,62}/. + # @param backup_plan [::Google::Cloud::BackupDR::V1beta::BackupPlan, ::Hash] + # Required. The `BackupPlan` resource object to create. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest.new + # + # # Call the create_backup_plan method. + # result = client.create_backup_plan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_backup_plan.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :create_backup_plan, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a BackupPlan. + # + # @overload update_backup_plan(request, options = nil) + # Pass arguments to `update_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_backup_plan(backup_plan: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_plan [::Google::Cloud::BackupDR::V1beta::BackupPlan, ::Hash] + # Required. The resource being updated + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # Field mask is used to specify the fields to be overwritten in the + # BackupPlan resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # Currently, these fields are supported in update: description, schedules, + # retention period, adding and removing Backup Rules. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest.new + # + # # Call the update_backup_plan method. + # result = client.update_backup_plan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.backup_plan&.name + header_params["backup_plan.name"] = request.backup_plan.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_backup_plan.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :update_backup_plan, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single BackupPlan. + # + # @overload get_backup_plan(request, options = nil) + # Pass arguments to `get_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_plan(name: nil) + # Pass arguments to `get_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the `BackupPlan` to retrieve. + # + # Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest.new + # + # # Call the get_backup_plan method. + # result = client.get_backup_plan request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlan. + # p result + # + def get_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup_plan.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_backup_plan, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupPlans in a given project and location. + # + # @overload list_backup_plans(request, options = nil) + # Pass arguments to `list_backup_plans` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_backup_plans` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve `BackupPlans` + # information. Format: `projects/{project}/locations/{location}`. In Google + # Cloud Backup and DR, locations map to Google Cloud regions, for e.g. + # **us-central1**. To retrieve backup plans for all locations, use "-" for + # the + # `{location}` value. + # @param page_size [::Integer] + # Optional. The maximum number of `BackupPlans` to return in a single + # response. If not specified, a default value will be chosen by the service. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # received from a previous `ListBackupPlans` call. + # Provide this to retrieve the subsequent page in a multi-page list of + # results. When paginating, all other parameters provided to + # `ListBackupPlans` must match the call that provided the page token. + # @param filter [::String] + # Optional. Field match expression used to filter the results. + # @param order_by [::String] + # Optional. Field by which to sort the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlan>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlan>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest.new + # + # # Call the list_backup_plans method. + # result = client.list_backup_plans request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlan. + # p item + # end + # + def list_backup_plans request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_plans.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_plans.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_plans.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_backup_plans, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_plans, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single BackupPlan. + # + # @overload delete_backup_plan(request, options = nil) + # Pass arguments to `delete_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup_plan(name: nil, request_id: nil) + # Pass arguments to `delete_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the `BackupPlan` to delete. + # + # Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest.new + # + # # Call the delete_backup_plan method. + # result = client.delete_backup_plan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_backup_plan.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :delete_backup_plan, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single BackupPlanRevision. + # + # @overload get_backup_plan_revision(request, options = nil) + # Pass arguments to `get_backup_plan_revision` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_plan_revision(name: nil) + # Pass arguments to `get_backup_plan_revision` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the `BackupPlanRevision` to retrieve. + # + # Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::BackupPlanRevision] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanRevision] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest.new + # + # # Call the get_backup_plan_revision method. + # result = client.get_backup_plan_revision request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlanRevision. + # p result + # + def get_backup_plan_revision request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_plan_revision.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup_plan_revision.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_plan_revision.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_backup_plan_revision, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupPlanRevisions in a given project and location. + # + # @overload list_backup_plan_revisions(request, options = nil) + # Pass arguments to `list_backup_plan_revisions` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_plan_revisions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_plan_revisions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve + # `BackupPlanRevisions` information. Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for e.g. + # **us-central1**. + # @param page_size [::Integer] + # Optional. The maximum number of `BackupPlans` to return in a single + # response. If not specified, a default value will be chosen by the service. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # received from a previous `ListBackupPlans` call. + # Provide this to retrieve the subsequent page in a multi-page list of + # results. When paginating, all other parameters provided to + # `ListBackupPlans` must match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanRevision>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanRevision>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest.new + # + # # Call the list_backup_plan_revisions method. + # result = client.list_backup_plan_revisions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanRevision. + # p item + # end + # + def list_backup_plan_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_plan_revisions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_plan_revisions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_plan_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_backup_plan_revisions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_revisions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a BackupPlanAssociation + # + # @overload create_backup_plan_association(request, options = nil) + # Pass arguments to `create_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_backup_plan_association(parent: nil, backup_plan_association_id: nil, backup_plan_association: nil, request_id: nil) + # Pass arguments to `create_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The backup plan association project and location in the format + # `projects/{project_id}/locations/{location}`. In Backup and DR locations + # map to Google Cloud regions, for example **us-central1**. + # @param backup_plan_association_id [::String] + # Required. The name of the backup plan association to create. The name must + # be unique for the specified project and location. + # @param backup_plan_association [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest.new + # + # # Call the create_backup_plan_association method. + # result = client.create_backup_plan_association request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_backup_plan_association.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :create_backup_plan_association, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a BackupPlanAssociation. + # + # @overload update_backup_plan_association(request, options = nil) + # Pass arguments to `update_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_backup_plan_association(backup_plan_association: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_plan_association [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation, ::Hash] + # Required. The resource being updated + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # Field mask is used to specify the fields to be overwritten in the + # BackupPlanAssociation resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # Currently backup_plan_association.backup_plan is the only supported field. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest.new + # + # # Call the update_backup_plan_association method. + # result = client.update_backup_plan_association request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.backup_plan_association&.name + header_params["backup_plan_association.name"] = request.backup_plan_association.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_backup_plan_association.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :update_backup_plan_association, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single BackupPlanAssociation. + # + # @overload get_backup_plan_association(request, options = nil) + # Pass arguments to `get_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_plan_association(name: nil) + # Pass arguments to `get_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest.new + # + # # Call the get_backup_plan_association method. + # result = client.get_backup_plan_association request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + # p result + # + def get_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup_plan_association.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_backup_plan_association, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupPlanAssociations in a given project and location. + # + # @overload list_backup_plan_associations(request, options = nil) + # Pass arguments to `list_backup_plan_associations` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_plan_associations(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_backup_plan_associations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backup Plan + # Associations information, in the format + # `projects/{project_id}/locations/{location}`. In Backup and DR, locations + # map to Google Cloud regions, for example **us-central1**. To retrieve + # backup plan associations for all locations, use "-" for the + # `{location}` value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest.new + # + # # Call the list_backup_plan_associations method. + # result = client.list_backup_plan_associations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + # p item + # end + # + def list_backup_plan_associations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_plan_associations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_plan_associations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_plan_associations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_backup_plan_associations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_associations, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List BackupPlanAssociations for a given resource type. + # + # @overload fetch_backup_plan_associations_for_resource_type(request, options = nil) + # Pass arguments to `fetch_backup_plan_associations_for_resource_type` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_backup_plan_associations_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `fetch_backup_plan_associations_for_resource_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @param resource_type [::String] + # Required. The type of the Google Cloud resource. + # Ex: sql.googleapis.com/Instance + # @param page_size [::Integer] + # Optional. The maximum number of BackupPlanAssociations to return. The + # service may return fewer than this value. If unspecified, at most 50 + # BackupPlanAssociations will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous call of + # `FetchBackupPlanAssociationsForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchBackupPlanAssociationsForResourceType` must match + # the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * resource + # * backup_plan + # * state + # * data_source + # * cloud_sql_instance_backup_plan_association_properties.instance_create_time + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest.new + # + # # Call the fetch_backup_plan_associations_for_resource_type method. + # result = client.fetch_backup_plan_associations_for_resource_type request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + # p item + # end + # + def fetch_backup_plan_associations_for_resource_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_backup_plan_associations_for_resource_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_backup_plan_associations_for_resource_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_backup_plan_associations_for_resource_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :fetch_backup_plan_associations_for_resource_type, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_backup_plan_associations_for_resource_type, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single BackupPlanAssociation. + # + # @overload delete_backup_plan_association(request, options = nil) + # Pass arguments to `delete_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup_plan_association(name: nil, request_id: nil, auto_protection_policy_binding: nil) + # Pass arguments to `delete_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param auto_protection_policy_binding [::String] + # Optional. This field is exclusively used by Backup and DR's auto-protection + # feature. The resource name of the `AutoProtectionPolicyBinding` that + # triggered the deletion of this association. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{policy}/bindings/{binding}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest.new + # + # # Call the delete_backup_plan_association method. + # result = client.delete_backup_plan_association request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_backup_plan_association.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :delete_backup_plan_association, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Triggers a new Backup. + # + # @overload trigger_backup(request, options = nil) + # Pass arguments to `trigger_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload trigger_backup(name: nil, rule_id: nil, request_id: nil, custom_retention_days: nil, labels: nil) + # Pass arguments to `trigger_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # @param rule_id [::String] + # Optional. backup rule_id for which a backup needs to be triggered. + # If not specified, on-demand backup with custom retention will be triggered. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param custom_retention_days [::Integer] + # Optional. The duration for which backup data will be kept, while taking an + # on-demand backup with custom retention. It is defined in "days". + # It is mutually exclusive with rule_id. This field is required if + # rule_id is not provided. + # @param labels [::Hash{::String => ::String}] + # Optional. Labels to be applied on the backup. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::TriggerBackupRequest.new + # + # # Call the trigger_backup method. + # result = client.trigger_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def trigger_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.trigger_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.trigger_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.trigger_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :trigger_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single DataSourceReference. + # + # @overload get_data_source_reference(request, options = nil) + # Pass arguments to `get_data_source_reference` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_data_source_reference(name: nil) + # Pass arguments to `get_data_source_reference` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataSourceReference to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/dataSourceReferences/\\{data_source_reference} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::DataSourceReference] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::DataSourceReference] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest.new + # + # # Call the get_data_source_reference method. + # result = client.get_data_source_reference request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::DataSourceReference. + # p result + # + def get_data_source_reference request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_data_source_reference.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_data_source_reference.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_data_source_reference.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_data_source_reference, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists DataSourceReferences for a given project and location. + # + # @overload list_data_source_references(request, options = nil) + # Pass arguments to `list_data_source_references` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_data_source_references(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_data_source_references` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of DataSourceReferences to return. The service + # may return fewer than this value. If unspecified, at most 50 + # DataSourceReferences will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDataSourceReferences` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDataSourceReferences` must match the call that provided the page + # token. + # @param filter [::String] + # Optional. A filter expression that filters the results listed in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. + # + # The following field and operator combinations are supported: + # + # * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + # * data_source_gcp_resource_info.type with `=`, `!=` + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # + # * data_source + # * data_source_gcp_resource_info.gcp_resourcename + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest.new + # + # # Call the list_data_source_references method. + # result = client.list_data_source_references request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSourceReference. + # p item + # end + # + def list_data_source_references request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_data_source_references.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_data_source_references.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_data_source_references.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_data_source_references, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_data_source_references, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetch DataSourceReferences for a given project, location and resource type. + # + # @overload fetch_data_source_references_for_resource_type(request, options = nil) + # Pass arguments to `fetch_data_source_references_for_resource_type` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_data_source_references_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `fetch_data_source_references_for_resource_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @param resource_type [::String] + # Required. The type of the Google Cloud resource. + # Ex: sql.googleapis.com/Instance + # @param page_size [::Integer] + # Optional. The maximum number of DataSourceReferences to return. The service + # may return fewer than this value. If unspecified, at most 50 + # DataSourceReferences will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous call of + # `FetchDataSourceReferencesForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchDataSourceReferencesForResourceType` must match + # the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * data_source + # * data_source_gcp_resource_info.gcp_resourcename + # * data_source_backup_config_state + # * data_source_backup_count + # * data_source_backup_config_info.last_backup_state + # * data_source_gcp_resource_info.gcp_resourcename + # * data_source_gcp_resource_info.type + # * data_source_gcp_resource_info.location + # * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest.new + # + # # Call the fetch_data_source_references_for_resource_type method. + # result = client.fetch_data_source_references_for_resource_type request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSourceReference. + # p item + # end + # + def fetch_data_source_references_for_resource_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_data_source_references_for_resource_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_data_source_references_for_resource_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_data_source_references_for_resource_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :fetch_data_source_references_for_resource_type, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_data_source_references_for_resource_type, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Initializes the service related config for a project. + # + # @overload initialize_service(request, options = nil) + # Pass arguments to `initialize_service` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload initialize_service(cloud_sql_instance_initialization_config: nil, name: nil, resource_type: nil, request_id: nil, backup_plan_location: nil, validate_only: nil) + # Pass arguments to `initialize_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cloud_sql_instance_initialization_config [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceInitializationConfig, ::Hash] + # Optional. The configuration for initializing a Cloud SQL instance. + # @param name [::String] + # Required. The resource name of the serviceConfig used to initialize the + # service. The location must be the location of the BackupVault. + # Format: `projects/{project_id}/locations/{location}/serviceConfig`. + # @param resource_type [::String] + # Required. The resource type to which the default service config will be + # applied. Examples include, "compute.googleapis.com/Instance" and + # "storage.googleapis.com/Bucket". + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param backup_plan_location [::String] + # Optional. The location where the BackupPlan will be created. This field is + # required for multi-region BackupVaults and is optional for regional + # BackupVaults. It is useful when creating a Backup Vault in a multi-region, + # allowing the BackupPlan to reside in a specific region within that + # multi-region. If this field is not provided, the BackupPlan will be created + # in the same location as specified in the `name` field. + # @param validate_only [::Boolean] + # Optional. If set, validates the request and returns the result, but does + # not actually run it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::InitializeServiceRequest.new + # + # # Call the initialize_service method. + # result = client.initialize_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def initialize_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.initialize_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.initialize_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.initialize_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :initialize_service, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new AutoProtectionPolicy in a given project and location. + # + # @overload create_auto_protection_policy(request, options = nil) + # Pass arguments to `create_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_auto_protection_policy(parent: nil, auto_protection_policy_id: nil, auto_protection_policy: nil) + # Pass arguments to `create_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this policy will be created. + # Format: projects/\\{project}/locations/\\{location} + # @param auto_protection_policy_id [::String] + # Required. The ID to use for the policy. + # This will become the final component of the policy's resource name. + # @param auto_protection_policy [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy, ::Hash] + # Required. The AutoProtectionPolicy resource to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest.new + # + # # Call the create_auto_protection_policy method. + # result = client.create_auto_protection_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_auto_protection_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :create_auto_protection_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists AutoProtectionPolicies for a given project and location. + # + # @overload list_auto_protection_policies(request, options = nil) + # Pass arguments to `list_auto_protection_policies` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_auto_protection_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_auto_protection_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve the list of + # policies. Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of policies to return in a single page. + # If unspecified, a server-default value will be used. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent + # page. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The following fields are filterable: + # @param order_by [::String] + # Optional. An expression that sorts the results in the response. The + # following fields are sortable: + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest.new + # + # # Call the list_auto_protection_policies method. + # result = client.list_auto_protection_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy. + # p item + # end + # + def list_auto_protection_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_auto_protection_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_auto_protection_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_auto_protection_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_auto_protection_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_auto_protection_policies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single AutoProtectionPolicy. + # + # @overload get_auto_protection_policy(request, options = nil) + # Pass arguments to `get_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_auto_protection_policy(name: nil) + # Pass arguments to `get_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest.new + # + # # Call the get_auto_protection_policy method. + # result = client.get_auto_protection_policy request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy. + # p result + # + def get_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_auto_protection_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_auto_protection_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the parameters of a single AutoProtectionPolicy. + # + # @overload update_auto_protection_policy(request, options = nil) + # Pass arguments to `update_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_auto_protection_policy(auto_protection_policy: nil, update_mask: nil) + # Pass arguments to `update_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param auto_protection_policy [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy, ::Hash] + # Required. The policy to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # AutoProtectionPolicy resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest.new + # + # # Call the update_auto_protection_policy method. + # result = client.update_auto_protection_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.auto_protection_policy&.name + header_params["auto_protection_policy.name"] = request.auto_protection_policy.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_auto_protection_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :update_auto_protection_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single AutoProtectionPolicy. + # + # @overload delete_auto_protection_policy(request, options = nil) + # Pass arguments to `delete_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_auto_protection_policy(name: nil, etag: nil) + # Pass arguments to `delete_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy to delete. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # @param etag [::String] + # The current etag of the AutoProtectionPolicy. + # If an etag is provided and does not match the current etag of the + # connection, the request will be rejected with an ABORTED error. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest.new + # + # # Call the delete_auto_protection_policy method. + # result = client.delete_auto_protection_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_auto_protection_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :delete_auto_protection_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new AutoProtectionPolicyBinding in a given project and + # location. + # + # @overload create_auto_protection_policy_binding(request, options = nil) + # Pass arguments to `create_auto_protection_policy_binding` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_auto_protection_policy_binding(parent: nil, auto_protection_policy_binding_id: nil, auto_protection_policy_binding: nil) + # Pass arguments to `create_auto_protection_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this binding will be created. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # @param auto_protection_policy_binding_id [::String] + # Required. The ID to use for the binding. + # This will become the final component of the binding's resource name. + # @param auto_protection_policy_binding [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding, ::Hash] + # Required. The AutoProtectionPolicyBinding resource to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest.new + # + # # Call the create_auto_protection_policy_binding method. + # result = client.create_auto_protection_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_auto_protection_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_auto_protection_policy_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_auto_protection_policy_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_auto_protection_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :create_auto_protection_policy_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the auto protection policy binding read from the CCFE tables. + # + # @overload get_auto_protection_policy_binding(request, options = nil) + # Pass arguments to `get_auto_protection_policy_binding` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_auto_protection_policy_binding(name: nil) + # Pass arguments to `get_auto_protection_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the binding to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest.new + # + # # Call the get_auto_protection_policy_binding method. + # result = client.get_auto_protection_policy_binding request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding. + # p result + # + def get_auto_protection_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_auto_protection_policy_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_auto_protection_policy_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_auto_protection_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_auto_protection_policy_binding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the auto protection policy bindings read from the CCFE tables. + # + # @overload list_auto_protection_policy_bindings(request, options = nil) + # Pass arguments to `list_auto_protection_policy_bindings` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_auto_protection_policy_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_auto_protection_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve the list of + # policies. Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of policies to return in a single page. + # If unspecified, a server-default value will be used. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent + # page. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The following fields are filterable: + # @param order_by [::String] + # Optional. An expression that sorts the results in the response. The + # following fields are sortable: + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest.new + # + # # Call the list_auto_protection_policy_bindings method. + # result = client.list_auto_protection_policy_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding. + # p item + # end + # + def list_auto_protection_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_auto_protection_policy_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_auto_protection_policy_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_auto_protection_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_auto_protection_policy_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_auto_protection_policy_bindings, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists AppliedAutoProtectionPolicies in a given project and location. + # + # @overload list_applied_auto_protection_policies(request, options = nil) + # Pass arguments to `list_applied_auto_protection_policies` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_applied_auto_protection_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_applied_auto_protection_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve the list of + # applied policies. Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of applied policies to return in a single + # page. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAppliedAutoProtectionPolicies` call. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. + # @param order_by [::String] + # Optional. An expression that sorts the results in the response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest.new + # + # # Call the list_applied_auto_protection_policies method. + # result = client.list_applied_auto_protection_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy. + # p item + # end + # + def list_applied_auto_protection_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_applied_auto_protection_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_applied_auto_protection_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_applied_auto_protection_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_applied_auto_protection_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_applied_auto_protection_policies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # InitiateDeleteAutoProtectionPolicyBinding initiates delete for + # AutoProtectionPolicy Binding + # + # @overload initiate_delete_auto_protection_policy_binding(request, options = nil) + # Pass arguments to `initiate_delete_auto_protection_policy_binding` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload initiate_delete_auto_protection_policy_binding(name: nil) + # Pass arguments to `initiate_delete_auto_protection_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the binding to delete. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest.new + # + # # Call the initiate_delete_auto_protection_policy_binding method. + # result = client.initiate_delete_auto_protection_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def initiate_delete_auto_protection_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.initiate_delete_auto_protection_policy_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.initiate_delete_auto_protection_policy_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.initiate_delete_auto_protection_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :initiate_delete_auto_protection_policy_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single Binding Matching Resource. + # + # @overload get_binding_matching_resource(request, options = nil) + # Pass arguments to `get_binding_matching_resource` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_binding_matching_resource(name: nil) + # Pass arguments to `get_binding_matching_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the matching resource to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding}/matchingResources/\\{matching_resource} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::BackupDR::V1beta::BindingMatchingResource] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BindingMatchingResource] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest.new + # + # # Call the get_binding_matching_resource method. + # result = client.get_binding_matching_resource request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BindingMatchingResource. + # p result + # + def get_binding_matching_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_binding_matching_resource.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_binding_matching_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_binding_matching_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :get_binding_matching_resource, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Binding Matching Resources for a given AutoProtectionPolicyBinding. + # + # @overload list_binding_matching_resources(request, options = nil) + # Pass arguments to `list_binding_matching_resources` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_binding_matching_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_binding_matching_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project, location, auto protection policy and binding for + # which to retrieve `BindingMatchingResources` information. Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}`. + # In Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example **us-central1**. + # @param page_size [::Integer] + # Optional. The maximum number of `BindingMatchingResources` to return in a + # single response. The default page size is 100 and maximum page size is 200. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse#next_page_token next_page_token} + # received from a previous `ListBindingMatchingResources` call. Provide this + # to retrieve the subsequent page in a multi-page list of results. When + # paginating, all other parameters provided to `ListBindingMatchingResources` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. Field match expression used to filter the results. + # @param order_by [::String] + # Optional. Field by which to sort the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BindingMatchingResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BindingMatchingResource>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest.new + # + # # Call the list_binding_matching_resources method. + # result = client.list_binding_matching_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BindingMatchingResource. + # p item + # end + # + def list_binding_matching_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_binding_matching_resources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_binding_matching_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_binding_matching_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.call_rpc :list_binding_matching_resources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_binding_matching_resources, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BackupDR API. + # + # This class represents the configuration for BackupDR, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::BackupDR::V1beta::BackupDR::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_management_servers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_management_servers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_management_servers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "backupdr.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BackupDR API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_management_servers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_management_servers + ## + # RPC-specific configuration for `get_management_server` + # @return [::Gapic::Config::Method] + # + attr_reader :get_management_server + ## + # RPC-specific configuration for `create_management_server` + # @return [::Gapic::Config::Method] + # + attr_reader :create_management_server + ## + # RPC-specific configuration for `delete_management_server` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_management_server + ## + # RPC-specific configuration for `create_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_vault + ## + # RPC-specific configuration for `list_backup_vaults` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_vaults + ## + # RPC-specific configuration for `fetch_usable_backup_vaults` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_usable_backup_vaults + ## + # RPC-specific configuration for `get_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_vault + ## + # RPC-specific configuration for `update_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_vault + ## + # RPC-specific configuration for `delete_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_vault + ## + # RPC-specific configuration for `list_data_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_sources + ## + # RPC-specific configuration for `get_data_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_source + ## + # RPC-specific configuration for `update_data_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_data_source + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `fetch_backups_for_resource_type` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_backups_for_resource_type + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `update_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `restore_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_backup + ## + # RPC-specific configuration for `create_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_plan + ## + # RPC-specific configuration for `update_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_plan + ## + # RPC-specific configuration for `get_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_plan + ## + # RPC-specific configuration for `list_backup_plans` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_plans + ## + # RPC-specific configuration for `delete_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_plan + ## + # RPC-specific configuration for `get_backup_plan_revision` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_plan_revision + ## + # RPC-specific configuration for `list_backup_plan_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_plan_revisions + ## + # RPC-specific configuration for `create_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_plan_association + ## + # RPC-specific configuration for `update_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_plan_association + ## + # RPC-specific configuration for `get_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_plan_association + ## + # RPC-specific configuration for `list_backup_plan_associations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_plan_associations + ## + # RPC-specific configuration for `fetch_backup_plan_associations_for_resource_type` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_backup_plan_associations_for_resource_type + ## + # RPC-specific configuration for `delete_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_plan_association + ## + # RPC-specific configuration for `trigger_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :trigger_backup + ## + # RPC-specific configuration for `get_data_source_reference` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_source_reference + ## + # RPC-specific configuration for `list_data_source_references` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_source_references + ## + # RPC-specific configuration for `fetch_data_source_references_for_resource_type` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_data_source_references_for_resource_type + ## + # RPC-specific configuration for `initialize_service` + # @return [::Gapic::Config::Method] + # + attr_reader :initialize_service + ## + # RPC-specific configuration for `create_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_auto_protection_policy + ## + # RPC-specific configuration for `list_auto_protection_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_auto_protection_policies + ## + # RPC-specific configuration for `get_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_auto_protection_policy + ## + # RPC-specific configuration for `update_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_auto_protection_policy + ## + # RPC-specific configuration for `delete_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_auto_protection_policy + ## + # RPC-specific configuration for `create_auto_protection_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_auto_protection_policy_binding + ## + # RPC-specific configuration for `get_auto_protection_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_auto_protection_policy_binding + ## + # RPC-specific configuration for `list_auto_protection_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_auto_protection_policy_bindings + ## + # RPC-specific configuration for `list_applied_auto_protection_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_applied_auto_protection_policies + ## + # RPC-specific configuration for `initiate_delete_auto_protection_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :initiate_delete_auto_protection_policy_binding + ## + # RPC-specific configuration for `get_binding_matching_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_binding_matching_resource + ## + # RPC-specific configuration for `list_binding_matching_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_binding_matching_resources + + # @private + def initialize parent_rpcs = nil + list_management_servers_config = parent_rpcs.list_management_servers if parent_rpcs.respond_to? :list_management_servers + @list_management_servers = ::Gapic::Config::Method.new list_management_servers_config + get_management_server_config = parent_rpcs.get_management_server if parent_rpcs.respond_to? :get_management_server + @get_management_server = ::Gapic::Config::Method.new get_management_server_config + create_management_server_config = parent_rpcs.create_management_server if parent_rpcs.respond_to? :create_management_server + @create_management_server = ::Gapic::Config::Method.new create_management_server_config + delete_management_server_config = parent_rpcs.delete_management_server if parent_rpcs.respond_to? :delete_management_server + @delete_management_server = ::Gapic::Config::Method.new delete_management_server_config + create_backup_vault_config = parent_rpcs.create_backup_vault if parent_rpcs.respond_to? :create_backup_vault + @create_backup_vault = ::Gapic::Config::Method.new create_backup_vault_config + list_backup_vaults_config = parent_rpcs.list_backup_vaults if parent_rpcs.respond_to? :list_backup_vaults + @list_backup_vaults = ::Gapic::Config::Method.new list_backup_vaults_config + fetch_usable_backup_vaults_config = parent_rpcs.fetch_usable_backup_vaults if parent_rpcs.respond_to? :fetch_usable_backup_vaults + @fetch_usable_backup_vaults = ::Gapic::Config::Method.new fetch_usable_backup_vaults_config + get_backup_vault_config = parent_rpcs.get_backup_vault if parent_rpcs.respond_to? :get_backup_vault + @get_backup_vault = ::Gapic::Config::Method.new get_backup_vault_config + update_backup_vault_config = parent_rpcs.update_backup_vault if parent_rpcs.respond_to? :update_backup_vault + @update_backup_vault = ::Gapic::Config::Method.new update_backup_vault_config + delete_backup_vault_config = parent_rpcs.delete_backup_vault if parent_rpcs.respond_to? :delete_backup_vault + @delete_backup_vault = ::Gapic::Config::Method.new delete_backup_vault_config + list_data_sources_config = parent_rpcs.list_data_sources if parent_rpcs.respond_to? :list_data_sources + @list_data_sources = ::Gapic::Config::Method.new list_data_sources_config + get_data_source_config = parent_rpcs.get_data_source if parent_rpcs.respond_to? :get_data_source + @get_data_source = ::Gapic::Config::Method.new get_data_source_config + update_data_source_config = parent_rpcs.update_data_source if parent_rpcs.respond_to? :update_data_source + @update_data_source = ::Gapic::Config::Method.new update_data_source_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + fetch_backups_for_resource_type_config = parent_rpcs.fetch_backups_for_resource_type if parent_rpcs.respond_to? :fetch_backups_for_resource_type + @fetch_backups_for_resource_type = ::Gapic::Config::Method.new fetch_backups_for_resource_type_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup + @update_backup = ::Gapic::Config::Method.new update_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + restore_backup_config = parent_rpcs.restore_backup if parent_rpcs.respond_to? :restore_backup + @restore_backup = ::Gapic::Config::Method.new restore_backup_config + create_backup_plan_config = parent_rpcs.create_backup_plan if parent_rpcs.respond_to? :create_backup_plan + @create_backup_plan = ::Gapic::Config::Method.new create_backup_plan_config + update_backup_plan_config = parent_rpcs.update_backup_plan if parent_rpcs.respond_to? :update_backup_plan + @update_backup_plan = ::Gapic::Config::Method.new update_backup_plan_config + get_backup_plan_config = parent_rpcs.get_backup_plan if parent_rpcs.respond_to? :get_backup_plan + @get_backup_plan = ::Gapic::Config::Method.new get_backup_plan_config + list_backup_plans_config = parent_rpcs.list_backup_plans if parent_rpcs.respond_to? :list_backup_plans + @list_backup_plans = ::Gapic::Config::Method.new list_backup_plans_config + delete_backup_plan_config = parent_rpcs.delete_backup_plan if parent_rpcs.respond_to? :delete_backup_plan + @delete_backup_plan = ::Gapic::Config::Method.new delete_backup_plan_config + get_backup_plan_revision_config = parent_rpcs.get_backup_plan_revision if parent_rpcs.respond_to? :get_backup_plan_revision + @get_backup_plan_revision = ::Gapic::Config::Method.new get_backup_plan_revision_config + list_backup_plan_revisions_config = parent_rpcs.list_backup_plan_revisions if parent_rpcs.respond_to? :list_backup_plan_revisions + @list_backup_plan_revisions = ::Gapic::Config::Method.new list_backup_plan_revisions_config + create_backup_plan_association_config = parent_rpcs.create_backup_plan_association if parent_rpcs.respond_to? :create_backup_plan_association + @create_backup_plan_association = ::Gapic::Config::Method.new create_backup_plan_association_config + update_backup_plan_association_config = parent_rpcs.update_backup_plan_association if parent_rpcs.respond_to? :update_backup_plan_association + @update_backup_plan_association = ::Gapic::Config::Method.new update_backup_plan_association_config + get_backup_plan_association_config = parent_rpcs.get_backup_plan_association if parent_rpcs.respond_to? :get_backup_plan_association + @get_backup_plan_association = ::Gapic::Config::Method.new get_backup_plan_association_config + list_backup_plan_associations_config = parent_rpcs.list_backup_plan_associations if parent_rpcs.respond_to? :list_backup_plan_associations + @list_backup_plan_associations = ::Gapic::Config::Method.new list_backup_plan_associations_config + fetch_backup_plan_associations_for_resource_type_config = parent_rpcs.fetch_backup_plan_associations_for_resource_type if parent_rpcs.respond_to? :fetch_backup_plan_associations_for_resource_type + @fetch_backup_plan_associations_for_resource_type = ::Gapic::Config::Method.new fetch_backup_plan_associations_for_resource_type_config + delete_backup_plan_association_config = parent_rpcs.delete_backup_plan_association if parent_rpcs.respond_to? :delete_backup_plan_association + @delete_backup_plan_association = ::Gapic::Config::Method.new delete_backup_plan_association_config + trigger_backup_config = parent_rpcs.trigger_backup if parent_rpcs.respond_to? :trigger_backup + @trigger_backup = ::Gapic::Config::Method.new trigger_backup_config + get_data_source_reference_config = parent_rpcs.get_data_source_reference if parent_rpcs.respond_to? :get_data_source_reference + @get_data_source_reference = ::Gapic::Config::Method.new get_data_source_reference_config + list_data_source_references_config = parent_rpcs.list_data_source_references if parent_rpcs.respond_to? :list_data_source_references + @list_data_source_references = ::Gapic::Config::Method.new list_data_source_references_config + fetch_data_source_references_for_resource_type_config = parent_rpcs.fetch_data_source_references_for_resource_type if parent_rpcs.respond_to? :fetch_data_source_references_for_resource_type + @fetch_data_source_references_for_resource_type = ::Gapic::Config::Method.new fetch_data_source_references_for_resource_type_config + initialize_service_config = parent_rpcs.initialize_service if parent_rpcs.respond_to? :initialize_service + @initialize_service = ::Gapic::Config::Method.new initialize_service_config + create_auto_protection_policy_config = parent_rpcs.create_auto_protection_policy if parent_rpcs.respond_to? :create_auto_protection_policy + @create_auto_protection_policy = ::Gapic::Config::Method.new create_auto_protection_policy_config + list_auto_protection_policies_config = parent_rpcs.list_auto_protection_policies if parent_rpcs.respond_to? :list_auto_protection_policies + @list_auto_protection_policies = ::Gapic::Config::Method.new list_auto_protection_policies_config + get_auto_protection_policy_config = parent_rpcs.get_auto_protection_policy if parent_rpcs.respond_to? :get_auto_protection_policy + @get_auto_protection_policy = ::Gapic::Config::Method.new get_auto_protection_policy_config + update_auto_protection_policy_config = parent_rpcs.update_auto_protection_policy if parent_rpcs.respond_to? :update_auto_protection_policy + @update_auto_protection_policy = ::Gapic::Config::Method.new update_auto_protection_policy_config + delete_auto_protection_policy_config = parent_rpcs.delete_auto_protection_policy if parent_rpcs.respond_to? :delete_auto_protection_policy + @delete_auto_protection_policy = ::Gapic::Config::Method.new delete_auto_protection_policy_config + create_auto_protection_policy_binding_config = parent_rpcs.create_auto_protection_policy_binding if parent_rpcs.respond_to? :create_auto_protection_policy_binding + @create_auto_protection_policy_binding = ::Gapic::Config::Method.new create_auto_protection_policy_binding_config + get_auto_protection_policy_binding_config = parent_rpcs.get_auto_protection_policy_binding if parent_rpcs.respond_to? :get_auto_protection_policy_binding + @get_auto_protection_policy_binding = ::Gapic::Config::Method.new get_auto_protection_policy_binding_config + list_auto_protection_policy_bindings_config = parent_rpcs.list_auto_protection_policy_bindings if parent_rpcs.respond_to? :list_auto_protection_policy_bindings + @list_auto_protection_policy_bindings = ::Gapic::Config::Method.new list_auto_protection_policy_bindings_config + list_applied_auto_protection_policies_config = parent_rpcs.list_applied_auto_protection_policies if parent_rpcs.respond_to? :list_applied_auto_protection_policies + @list_applied_auto_protection_policies = ::Gapic::Config::Method.new list_applied_auto_protection_policies_config + 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 + @initiate_delete_auto_protection_policy_binding = ::Gapic::Config::Method.new initiate_delete_auto_protection_policy_binding_config + get_binding_matching_resource_config = parent_rpcs.get_binding_matching_resource if parent_rpcs.respond_to? :get_binding_matching_resource + @get_binding_matching_resource = ::Gapic::Config::Method.new get_binding_matching_resource_config + list_binding_matching_resources_config = parent_rpcs.list_binding_matching_resources if parent_rpcs.respond_to? :list_binding_matching_resources + @list_binding_matching_resources = ::Gapic::Config::Method.new list_binding_matching_resources_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/credentials.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/credentials.rb new file mode 100644 index 000000000000..5d989efb50de --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/credentials.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDR + # Credentials for the BackupDR API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-backupdr", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/operations.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/operations.rb new file mode 100644 index 000000000000..3a9056d282d2 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDR + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "backupdr.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the BackupDR Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the BackupDR Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "backupdr.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/paths.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/paths.rb new file mode 100644 index 000000000000..5d92800831fb --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/paths.rb @@ -0,0 +1,372 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDR + # Path helper methods for the BackupDR API. + module Paths + ## + # Create a fully-qualified AutoProtectionPolicy resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}` + # + # @param project [String] + # @param location [String] + # @param auto_protection_policy [String] + # + # @return [::String] + def auto_protection_policy_path project:, location:, auto_protection_policy: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/autoProtectionPolicies/#{auto_protection_policy}" + end + + ## + # Create a fully-qualified AutoProtectionPolicyBinding resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}` + # + # @param project [String] + # @param location [String] + # @param auto_protection_policy [String] + # @param binding [String] + # + # @return [::String] + def auto_protection_policy_binding_path project:, location:, auto_protection_policy:, binding: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "auto_protection_policy cannot contain /" if auto_protection_policy.to_s.include? "/" + + "projects/#{project}/locations/#{location}/autoProtectionPolicies/#{auto_protection_policy}/bindings/#{binding}" + end + + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backupvault [String] + # @param datasource [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backupvault:, datasource:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "backupvault cannot contain /" if backupvault.to_s.include? "/" + raise ::ArgumentError, "datasource cannot contain /" if datasource.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupVaults/#{backupvault}/dataSources/#{datasource}/backups/#{backup}" + end + + ## + # Create a fully-qualified BackupPlan resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + # + # @param project [String] + # @param location [String] + # @param backup_plan [String] + # + # @return [::String] + def backup_plan_path project:, location:, backup_plan: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupPlans/#{backup_plan}" + end + + ## + # Create a fully-qualified BackupPlanAssociation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}` + # + # @param project [String] + # @param location [String] + # @param backup_plan_association [String] + # + # @return [::String] + def backup_plan_association_path project:, location:, backup_plan_association: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupPlanAssociations/#{backup_plan_association}" + end + + ## + # Create a fully-qualified BackupPlanRevision resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + # + # @param project [String] + # @param location [String] + # @param backup_plan [String] + # @param revision [String] + # + # @return [::String] + def backup_plan_revision_path project:, location:, backup_plan:, revision: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "backup_plan cannot contain /" if backup_plan.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupPlans/#{backup_plan}/revisions/#{revision}" + end + + ## + # Create a fully-qualified BackupVault resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupVaults/{backupvault}` + # + # @param project [String] + # @param location [String] + # @param backupvault [String] + # + # @return [::String] + def backup_vault_path project:, location:, backupvault: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupVaults/#{backupvault}" + end + + ## + # Create a fully-qualified BindingMatchingResource resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}/matchingResources/{matching_resource}` + # + # @param project [String] + # @param location [String] + # @param auto_protection_policy [String] + # @param binding [String] + # @param matching_resource [String] + # + # @return [::String] + def binding_matching_resource_path project:, location:, auto_protection_policy:, binding:, matching_resource: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "auto_protection_policy cannot contain /" if auto_protection_policy.to_s.include? "/" + raise ::ArgumentError, "binding cannot contain /" if binding.to_s.include? "/" + + "projects/#{project}/locations/#{location}/autoProtectionPolicies/#{auto_protection_policy}/bindings/#{binding}/matchingResources/#{matching_resource}" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}` + # + # @param project [String] + # @param location [String] + # @param ring [String] + # @param key [String] + # + # @return [::String] + def crypto_key_path project:, location:, ring:, key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "ring cannot contain /" if ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{ring}/cryptoKeys/#{key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified DataSource resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}` + # + # @param project [String] + # @param location [String] + # @param backupvault [String] + # @param datasource [String] + # + # @return [::String] + def data_source_path project:, location:, backupvault:, datasource: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "backupvault cannot contain /" if backupvault.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupVaults/#{backupvault}/dataSources/#{datasource}" + end + + ## + # Create a fully-qualified DataSourceReference resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}` + # + # @param project [String] + # @param location [String] + # @param data_source_reference [String] + # + # @return [::String] + def data_source_reference_path project:, location:, data_source_reference: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataSourceReferences/#{data_source_reference}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}` + # + # @param project [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/instances/#{instance}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified ManagementServer resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/managementServers/{managementserver}` + # + # @param project [String] + # @param location [String] + # @param managementserver [String] + # + # @return [::String] + def management_server_path project:, location:, managementserver: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/managementServers/#{managementserver}" + end + + ## + # Create a fully-qualified StoragePool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/zones/{zone}/storagePools/{storage_pool}` + # + # @param project [String] + # @param zone [String] + # @param storage_pool [String] + # + # @return [::String] + def storage_pool_path project:, zone:, storage_pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project}/zones/#{zone}/storagePools/#{storage_pool}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest.rb new file mode 100644 index 000000000000..12d0f4537061 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/backupdr/v1beta/version" +require "google/cloud/backupdr/v1beta/bindings_override" + +require "google/cloud/backupdr/v1beta/backupdr/credentials" +require "google/cloud/backupdr/v1beta/backupdr/paths" +require "google/cloud/backupdr/v1beta/backupdr/rest/operations" +require "google/cloud/backupdr/v1beta/backupdr/rest/client" + +module Google + module Cloud + module BackupDR + module V1beta + ## + # The BackupDR Service + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/backupdr/v1beta/backupdr/rest" + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + module BackupDR + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/backupdr/v1beta/backupdr/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/client.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/client.rb new file mode 100644 index 000000000000..9a31cd4907a0 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/client.rb @@ -0,0 +1,5724 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/backupdr/v1beta/backupdr_pb" +require "google/cloud/backupdr/v1beta/backupdr/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDR + module Rest + ## + # REST client for the BackupDR service. + # + # The BackupDR Service + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "backupdr.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :backup_dr_stub + + ## + # Configure the BackupDR Client class. + # + # See {::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BackupDR clients + # ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "BackupDR", "V1beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_management_servers.timeout = 60.0 + default_config.rpcs.list_management_servers.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_management_server.timeout = 60.0 + default_config.rpcs.get_management_server.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_management_server.timeout = 60.0 + + default_config.rpcs.delete_management_server.timeout = 60.0 + + default_config.rpcs.create_backup_vault.timeout = 60.0 + default_config.rpcs.create_backup_vault.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_backup_vaults.timeout = 60.0 + default_config.rpcs.list_backup_vaults.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.fetch_usable_backup_vaults.timeout = 60.0 + default_config.rpcs.fetch_usable_backup_vaults.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_backup_vault.timeout = 60.0 + default_config.rpcs.get_backup_vault.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_backup_vault.timeout = 60.0 + + default_config.rpcs.delete_backup_vault.timeout = 60.0 + default_config.rpcs.delete_backup_vault.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_data_sources.timeout = 60.0 + default_config.rpcs.list_data_sources.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_data_source.timeout = 60.0 + default_config.rpcs.get_data_source.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_data_source.timeout = 60.0 + + default_config.rpcs.list_backups.timeout = 60.0 + default_config.rpcs.list_backups.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_backup.timeout = 60.0 + default_config.rpcs.get_backup.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_backup.timeout = 60.0 + + default_config.rpcs.restore_backup.timeout = 60.0 + + default_config.rpcs.initialize_service.timeout = 60.0 + default_config.rpcs.initialize_service.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BackupDR Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @backup_dr_stub.universe_domain + end + + ## + # Create a new BackupDR REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BackupDR client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @backup_dr_stub = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @backup_dr_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_dr_stub.endpoint + config.universe_domain = @backup_dr_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @backup_dr_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_dr_stub.endpoint + config.universe_domain = @backup_dr_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @backup_dr_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @backup_dr_stub.logger + end + + # Service calls + + ## + # Lists ManagementServers in a given project and location. + # + # @overload list_management_servers(request, options = nil) + # Pass arguments to `list_management_servers` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_management_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_management_servers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve management servers + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. + # In Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. To retrieve management servers for all locations, use "-" + # for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::ManagementServer>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::ManagementServer>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new + # + # # Call the list_management_servers method. + # result = client.list_management_servers request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::ManagementServer. + # p item + # end + # + def list_management_servers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_management_servers.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_management_servers.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_management_servers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_management_servers request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_management_servers, "management_servers", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single ManagementServer. + # + # @overload get_management_server(request, options = nil) + # Pass arguments to `get_management_server` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_management_server(name: nil) + # Pass arguments to `get_management_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the management server resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/managementServers/\\{resource_name}' + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ManagementServer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ManagementServer] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetManagementServerRequest.new + # + # # Call the get_management_server method. + # result = client.get_management_server request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::ManagementServer. + # p result + # + def get_management_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_management_server.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_management_server.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_management_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_management_server request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new ManagementServer in a given project and location. + # + # @overload create_management_server(request, options = nil) + # Pass arguments to `create_management_server` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_management_server(parent: nil, management_server_id: nil, management_server: nil, request_id: nil) + # Pass arguments to `create_management_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The management server project and location in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and DR + # locations map to Google Cloud regions, for example **us-central1**. + # @param management_server_id [::String] + # Required. The name of the management server to create. The name must be + # unique for the specified project and location. + # @param management_server [::Google::Cloud::BackupDR::V1beta::ManagementServer, ::Hash] + # Required. A [management server + # resource][google.cloud.backupdr.v1.ManagementServer] + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest.new + # + # # Call the create_management_server method. + # result = client.create_management_server request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_management_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_management_server.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_management_server.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_management_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.create_management_server request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single ManagementServer. + # + # @overload delete_management_server(request, options = nil) + # Pass arguments to `delete_management_server` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_management_server(name: nil, request_id: nil) + # Pass arguments to `delete_management_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest.new + # + # # Call the delete_management_server method. + # result = client.delete_management_server request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_management_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_management_server.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_management_server.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_management_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.delete_management_server request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new BackupVault in a given project and location. + # + # @overload create_backup_vault(request, options = nil) + # Pass arguments to `create_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_backup_vault(parent: nil, backup_vault_id: nil, backup_vault: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param backup_vault_id [::String] + # Required. ID of the requesting object + # If auto-generating ID server-side, remove this field and + # backup_vault_id from the method_signature of Create RPC + # @param backup_vault [::Google::Cloud::BackupDR::V1beta::BackupVault, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest.new + # + # # Call the create_backup_vault method. + # result = client.create_backup_vault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_backup_vault.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.create_backup_vault request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupVaults in a given project and location. + # + # @overload list_backup_vaults(request, options = nil) + # Pass arguments to `list_backup_vaults` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `list_backup_vaults` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backupvault stores + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. + # To retrieve backupvault stores for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @param view [::Google::Cloud::BackupDR::V1beta::BackupVaultView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # Vault. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest.new + # + # # Call the list_backup_vaults method. + # result = client.list_backup_vaults request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupVault. + # p item + # end + # + def list_backup_vaults request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backup_vaults.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_vaults.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_vaults.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_backup_vaults request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_vaults, "backup_vaults", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # FetchUsableBackupVaults lists usable BackupVaults in a given project and + # location. Usable BackupVault are the ones that user has + # backupdr.backupVaults.get permission. + # + # @overload fetch_usable_backup_vaults(request, options = nil) + # Pass arguments to `fetch_usable_backup_vaults` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_usable_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `fetch_usable_backup_vaults` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backupvault stores + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. + # To retrieve backupvault stores for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest.new + # + # # Call the fetch_usable_backup_vaults method. + # result = client.fetch_usable_backup_vaults request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupVault. + # p item + # end + # + def fetch_usable_backup_vaults request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fetch_usable_backup_vaults.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_usable_backup_vaults.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_usable_backup_vaults.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.fetch_usable_backup_vaults request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_usable_backup_vaults, "backup_vaults", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a BackupVault. + # + # @overload get_backup_vault(request, options = nil) + # Pass arguments to `get_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup_vault(name: nil, view: nil) + # Pass arguments to `get_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backupvault store resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}' + # @param view [::Google::Cloud::BackupDR::V1beta::BackupVaultView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # Vault + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupVault] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest.new + # + # # Call the get_backup_vault method. + # result = client.get_backup_vault request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupVault. + # p result + # + def get_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_vault.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_backup_vault request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the settings of a BackupVault. + # + # @overload update_backup_vault(request, options = nil) + # Pass arguments to `update_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_backup_vault(update_mask: nil, backup_vault: nil, request_id: nil, validate_only: nil, force: nil, force_update_access_restriction: nil) + # Pass arguments to `update_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # BackupVault resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @param backup_vault [::Google::Cloud::BackupDR::V1beta::BackupVault, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # @param force [::Boolean] + # Optional. If set to true, will not check plan duration against backup vault + # enforcement duration. + # @param force_update_access_restriction [::Boolean] + # Optional. If set to true, we will force update access restriction even if + # some non compliant data sources are present. The default is 'false'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest.new + # + # # Call the update_backup_vault method. + # result = client.update_backup_vault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_backup_vault.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.update_backup_vault request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a BackupVault. + # + # @overload delete_backup_vault(request, options = nil) + # Pass arguments to `delete_backup_vault` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil, ignore_backup_plan_references: nil) + # Pass arguments to `delete_backup_vault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any data source from this backup vault will also + # be deleted. + # @param etag [::String] + # The current etag of the backup vault. + # If an etag is provided and does not match the current etag of the + # connection, deletion will be blocked. + # @param validate_only [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # @param allow_missing [::Boolean] + # Optional. If true and the BackupVault is not found, the request will + # succeed but no action will be taken. + # @param ignore_backup_plan_references [::Boolean] + # Optional. If set to true, backupvault deletion will proceed even if there + # are backup plans referencing the backupvault. The default is 'false'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest.new + # + # # Call the delete_backup_vault method. + # result = client.delete_backup_vault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup_vault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_backup_vault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup_vault.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup_vault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.delete_backup_vault request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists DataSources in a given project and location. + # + # @overload list_data_sources(request, options = nil) + # Pass arguments to `list_data_sources` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_data_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_data_sources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve data + # sources information, in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and + # DR, locations map to Google Cloud regions, for example + # **us-central1**. + # To retrieve data sources for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSource>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest.new + # + # # Call the list_data_sources method. + # result = client.list_data_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSource. + # p item + # end + # + def list_data_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_data_sources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_data_sources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_data_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_data_sources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_data_sources, "data_sources", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a DataSource. + # + # @overload get_data_source(request, options = nil) + # Pass arguments to `get_data_source` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_data_source(name: nil) + # Pass arguments to `get_data_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the data source resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}/dataSource/\\{resource_name}' + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::DataSource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::DataSource] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetDataSourceRequest.new + # + # # Call the get_data_source method. + # result = client.get_data_source request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::DataSource. + # p result + # + def get_data_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_data_source.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_data_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_data_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_data_source request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the settings of a DataSource. + # + # @overload update_data_source(request, options = nil) + # Pass arguments to `update_data_source` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_data_source(update_mask: nil, data_source: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_data_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # DataSource resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @param data_source [::Google::Cloud::BackupDR::V1beta::DataSource, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # Optional. Enable upsert. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest.new + # + # # Call the update_data_source method. + # result = client.update_data_source request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_data_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_data_source.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_data_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_data_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.update_data_source request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Backups in a given project and location. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backup + # information, in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and + # DR, locations map to Google Cloud regions, for example + # **us-central1**. + # To retrieve data sources for all locations, use "-" for the + # '\\{location}' value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # @param view [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_backups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backups, "backups", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetch Backups for a given resource type. + # + # @overload fetch_backups_for_resource_type(request, options = nil) + # Pass arguments to `fetch_backups_for_resource_type` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_backups_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `fetch_backups_for_resource_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Datasources are the parent resource for the backups. + # Format: + # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupVaultId}/dataSources/\\{datasourceId} + # @param resource_type [::String] + # Required. The type of the GCP resource. + # Ex: sqladmin.googleapis.com/Instance + # @param page_size [::Integer] + # Optional. The maximum number of Backups to return. The service may + # return fewer than this value. If unspecified, at most 50 + # Backups will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous call of + # `FetchBackupsForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchBackupsForResourceType` must match + # the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * name + # * state + # * backup_type + # * create_time + # * expire_time + # * enforced_retention_end_time + # * gcp_backup_plan_info.backup_plan + # * cloud_sql_instance_backup_properties.instance_tier + # * cloud_sql_instance_backup_properties.database_installed_version + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + # @param view [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. This parameter is used to specify the view of the backup. + # If not specified, the default view is BASIC. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest.new + # + # # Call the fetch_backups_for_resource_type method. + # result = client.fetch_backups_for_resource_type request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::Backup. + # p item + # end + # + def fetch_backups_for_resource_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fetch_backups_for_resource_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_backups_for_resource_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_backups_for_resource_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.fetch_backups_for_resource_type request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_backups_for_resource_type, "backups", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a Backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup(name: nil, view: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the data source resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{backupVault}/dataSources/\\{datasource}/backups/\\{backup}' + # @param view [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_backup request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the settings of a Backup. + # + # @overload update_backup(request, options = nil) + # Pass arguments to `update_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_backup(update_mask: nil, backup: nil, request_id: nil) + # Pass arguments to `update_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Backup resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @param backup [::Google::Cloud::BackupDR::V1beta::Backup, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupRequest.new + # + # # Call the update_backup method. + # result = client.update_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.update_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.delete_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Restore from a Backup + # + # @overload restore_backup(request, options = nil) + # Pass arguments to `restore_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload restore_backup(compute_instance_target_environment: nil, disk_target_environment: nil, region_disk_target_environment: nil, compute_instance_restore_properties: nil, disk_restore_properties: nil, name: nil, request_id: nil, clear_overrides_field_mask: nil) + # Pass arguments to `restore_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param compute_instance_target_environment [::Google::Cloud::BackupDR::V1beta::ComputeInstanceTargetEnvironment, ::Hash] + # Compute Engine target environment to be used during restore. + # + # Note: The following parameters are mutually exclusive: `compute_instance_target_environment`, `disk_target_environment`, `region_disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disk_target_environment [::Google::Cloud::BackupDR::V1beta::DiskTargetEnvironment, ::Hash] + # Disk target environment to be used during restore. + # + # Note: The following parameters are mutually exclusive: `disk_target_environment`, `compute_instance_target_environment`, `region_disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param region_disk_target_environment [::Google::Cloud::BackupDR::V1beta::RegionDiskTargetEnvironment, ::Hash] + # Region disk target environment to be used during restore. + # + # Note: The following parameters are mutually exclusive: `region_disk_target_environment`, `compute_instance_target_environment`, `disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param compute_instance_restore_properties [::Google::Cloud::BackupDR::V1beta::ComputeInstanceRestoreProperties, ::Hash] + # Compute Engine instance properties to be overridden during restore. + # + # Note: The following parameters are mutually exclusive: `compute_instance_restore_properties`, `disk_restore_properties`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disk_restore_properties [::Google::Cloud::BackupDR::V1beta::DiskRestoreProperties, ::Hash] + # Disk properties to be overridden during restore. + # + # Note: The following parameters are mutually exclusive: `disk_restore_properties`, `compute_instance_restore_properties`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param name [::String] + # Required. The resource name of the Backup instance, in the format + # 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param clear_overrides_field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A field mask used to clear server-side default values + # for fields within the `instance_properties` oneof. + # + # When a field in this mask is cleared, the server will not apply its + # default logic (like inheriting a value from the source) for that field. + # + # The most common current use case is clearing default encryption keys. + # + # Examples of field mask paths: + # - Compute Instance Disks: + # `compute_instance_restore_properties.disks.*.disk_encryption_key` + # - Single Disk: `disk_restore_properties.disk_encryption_key` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::RestoreBackupRequest.new + # + # # Call the restore_backup method. + # result = client.restore_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def restore_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.restore_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.restore_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.restore_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a BackupPlan + # + # @overload create_backup_plan(request, options = nil) + # Pass arguments to `create_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_backup_plan(parent: nil, backup_plan_id: nil, backup_plan: nil, request_id: nil) + # Pass arguments to `create_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The `BackupPlan` project and location in the format + # `projects/{project}/locations/{location}`. In Google Cloud Backup and DR + # locations map to Google Cloud regions, for example **us-central1**. + # @param backup_plan_id [::String] + # Required. The name of the `BackupPlan` to create. The name must be unique + # for the specified project and location.The name must start with a lowercase + # letter followed by up to 62 lowercase letters, numbers, or hyphens. + # Pattern, /[a-z][a-z0-9-]\\{,62}/. + # @param backup_plan [::Google::Cloud::BackupDR::V1beta::BackupPlan, ::Hash] + # Required. The `BackupPlan` resource object to create. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest.new + # + # # Call the create_backup_plan method. + # result = client.create_backup_plan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_backup_plan.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.create_backup_plan request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a BackupPlan. + # + # @overload update_backup_plan(request, options = nil) + # Pass arguments to `update_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_backup_plan(backup_plan: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_plan [::Google::Cloud::BackupDR::V1beta::BackupPlan, ::Hash] + # Required. The resource being updated + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # Field mask is used to specify the fields to be overwritten in the + # BackupPlan resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # Currently, these fields are supported in update: description, schedules, + # retention period, adding and removing Backup Rules. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest.new + # + # # Call the update_backup_plan method. + # result = client.update_backup_plan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_backup_plan.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.update_backup_plan request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single BackupPlan. + # + # @overload get_backup_plan(request, options = nil) + # Pass arguments to `get_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup_plan(name: nil) + # Pass arguments to `get_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the `BackupPlan` to retrieve. + # + # Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest.new + # + # # Call the get_backup_plan method. + # result = client.get_backup_plan request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlan. + # p result + # + def get_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_plan.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_backup_plan request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupPlans in a given project and location. + # + # @overload list_backup_plans(request, options = nil) + # Pass arguments to `list_backup_plans` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_backup_plans` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve `BackupPlans` + # information. Format: `projects/{project}/locations/{location}`. In Google + # Cloud Backup and DR, locations map to Google Cloud regions, for e.g. + # **us-central1**. To retrieve backup plans for all locations, use "-" for + # the + # `{location}` value. + # @param page_size [::Integer] + # Optional. The maximum number of `BackupPlans` to return in a single + # response. If not specified, a default value will be chosen by the service. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # received from a previous `ListBackupPlans` call. + # Provide this to retrieve the subsequent page in a multi-page list of + # results. When paginating, all other parameters provided to + # `ListBackupPlans` must match the call that provided the page token. + # @param filter [::String] + # Optional. Field match expression used to filter the results. + # @param order_by [::String] + # Optional. Field by which to sort the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlan>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlan>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest.new + # + # # Call the list_backup_plans method. + # result = client.list_backup_plans request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlan. + # p item + # end + # + def list_backup_plans request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backup_plans.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_plans.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_plans.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_backup_plans request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plans, "backup_plans", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single BackupPlan. + # + # @overload delete_backup_plan(request, options = nil) + # Pass arguments to `delete_backup_plan` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup_plan(name: nil, request_id: nil) + # Pass arguments to `delete_backup_plan` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the `BackupPlan` to delete. + # + # Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest.new + # + # # Call the delete_backup_plan method. + # result = client.delete_backup_plan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup_plan request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_backup_plan.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup_plan.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup_plan.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.delete_backup_plan request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single BackupPlanRevision. + # + # @overload get_backup_plan_revision(request, options = nil) + # Pass arguments to `get_backup_plan_revision` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup_plan_revision(name: nil) + # Pass arguments to `get_backup_plan_revision` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the `BackupPlanRevision` to retrieve. + # + # Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupPlanRevision] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanRevision] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest.new + # + # # Call the get_backup_plan_revision method. + # result = client.get_backup_plan_revision request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlanRevision. + # p result + # + def get_backup_plan_revision request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup_plan_revision.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_plan_revision.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_plan_revision.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_backup_plan_revision request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupPlanRevisions in a given project and location. + # + # @overload list_backup_plan_revisions(request, options = nil) + # Pass arguments to `list_backup_plan_revisions` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backup_plan_revisions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_plan_revisions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve + # `BackupPlanRevisions` information. Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for e.g. + # **us-central1**. + # @param page_size [::Integer] + # Optional. The maximum number of `BackupPlans` to return in a single + # response. If not specified, a default value will be chosen by the service. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # received from a previous `ListBackupPlans` call. + # Provide this to retrieve the subsequent page in a multi-page list of + # results. When paginating, all other parameters provided to + # `ListBackupPlans` must match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanRevision>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanRevision>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest.new + # + # # Call the list_backup_plan_revisions method. + # result = client.list_backup_plan_revisions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanRevision. + # p item + # end + # + def list_backup_plan_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backup_plan_revisions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_plan_revisions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_plan_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_backup_plan_revisions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_revisions, "backup_plan_revisions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a BackupPlanAssociation + # + # @overload create_backup_plan_association(request, options = nil) + # Pass arguments to `create_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_backup_plan_association(parent: nil, backup_plan_association_id: nil, backup_plan_association: nil, request_id: nil) + # Pass arguments to `create_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The backup plan association project and location in the format + # `projects/{project_id}/locations/{location}`. In Backup and DR locations + # map to Google Cloud regions, for example **us-central1**. + # @param backup_plan_association_id [::String] + # Required. The name of the backup plan association to create. The name must + # be unique for the specified project and location. + # @param backup_plan_association [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest.new + # + # # Call the create_backup_plan_association method. + # result = client.create_backup_plan_association request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_backup_plan_association.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.create_backup_plan_association request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a BackupPlanAssociation. + # + # @overload update_backup_plan_association(request, options = nil) + # Pass arguments to `update_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_backup_plan_association(backup_plan_association: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_plan_association [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation, ::Hash] + # Required. The resource being updated + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # Field mask is used to specify the fields to be overwritten in the + # BackupPlanAssociation resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # Currently backup_plan_association.backup_plan is the only supported field. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest.new + # + # # Call the update_backup_plan_association method. + # result = client.update_backup_plan_association request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_backup_plan_association.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.update_backup_plan_association request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single BackupPlanAssociation. + # + # @overload get_backup_plan_association(request, options = nil) + # Pass arguments to `get_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup_plan_association(name: nil) + # Pass arguments to `get_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest.new + # + # # Call the get_backup_plan_association method. + # result = client.get_backup_plan_association request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + # p result + # + def get_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_plan_association.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_backup_plan_association request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BackupPlanAssociations in a given project and location. + # + # @overload list_backup_plan_associations(request, options = nil) + # Pass arguments to `list_backup_plan_associations` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backup_plan_associations(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_backup_plan_associations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve backup Plan + # Associations information, in the format + # `projects/{project_id}/locations/{location}`. In Backup and DR, locations + # map to Google Cloud regions, for example **us-central1**. To retrieve + # backup plan associations for all locations, use "-" for the + # `{location}` value. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest.new + # + # # Call the list_backup_plan_associations method. + # result = client.list_backup_plan_associations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + # p item + # end + # + def list_backup_plan_associations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backup_plan_associations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_plan_associations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_plan_associations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_backup_plan_associations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_associations, "backup_plan_associations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List BackupPlanAssociations for a given resource type. + # + # @overload fetch_backup_plan_associations_for_resource_type(request, options = nil) + # Pass arguments to `fetch_backup_plan_associations_for_resource_type` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_backup_plan_associations_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `fetch_backup_plan_associations_for_resource_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @param resource_type [::String] + # Required. The type of the Google Cloud resource. + # Ex: sql.googleapis.com/Instance + # @param page_size [::Integer] + # Optional. The maximum number of BackupPlanAssociations to return. The + # service may return fewer than this value. If unspecified, at most 50 + # BackupPlanAssociations will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous call of + # `FetchBackupPlanAssociationsForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchBackupPlanAssociationsForResourceType` must match + # the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * resource + # * backup_plan + # * state + # * data_source + # * cloud_sql_instance_backup_plan_association_properties.instance_create_time + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest.new + # + # # Call the fetch_backup_plan_associations_for_resource_type method. + # result = client.fetch_backup_plan_associations_for_resource_type request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + # p item + # end + # + def fetch_backup_plan_associations_for_resource_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fetch_backup_plan_associations_for_resource_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_backup_plan_associations_for_resource_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_backup_plan_associations_for_resource_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.fetch_backup_plan_associations_for_resource_type request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_backup_plan_associations_for_resource_type, "backup_plan_associations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single BackupPlanAssociation. + # + # @overload delete_backup_plan_association(request, options = nil) + # Pass arguments to `delete_backup_plan_association` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup_plan_association(name: nil, request_id: nil, auto_protection_policy_binding: nil) + # Pass arguments to `delete_backup_plan_association` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param auto_protection_policy_binding [::String] + # Optional. This field is exclusively used by Backup and DR's auto-protection + # feature. The resource name of the `AutoProtectionPolicyBinding` that + # triggered the deletion of this association. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{policy}/bindings/{binding}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest.new + # + # # Call the delete_backup_plan_association method. + # result = client.delete_backup_plan_association request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup_plan_association request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_backup_plan_association.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup_plan_association.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup_plan_association.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.delete_backup_plan_association request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Triggers a new Backup. + # + # @overload trigger_backup(request, options = nil) + # Pass arguments to `trigger_backup` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload trigger_backup(name: nil, rule_id: nil, request_id: nil, custom_retention_days: nil, labels: nil) + # Pass arguments to `trigger_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # @param rule_id [::String] + # Optional. backup rule_id for which a backup needs to be triggered. + # If not specified, on-demand backup with custom retention will be triggered. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param custom_retention_days [::Integer] + # Optional. The duration for which backup data will be kept, while taking an + # on-demand backup with custom retention. It is defined in "days". + # It is mutually exclusive with rule_id. This field is required if + # rule_id is not provided. + # @param labels [::Hash{::String => ::String}] + # Optional. Labels to be applied on the backup. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::TriggerBackupRequest.new + # + # # Call the trigger_backup method. + # result = client.trigger_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def trigger_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.trigger_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.trigger_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.trigger_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.trigger_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single DataSourceReference. + # + # @overload get_data_source_reference(request, options = nil) + # Pass arguments to `get_data_source_reference` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_data_source_reference(name: nil) + # Pass arguments to `get_data_source_reference` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataSourceReference to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/dataSourceReferences/\\{data_source_reference} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::DataSourceReference] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::DataSourceReference] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest.new + # + # # Call the get_data_source_reference method. + # result = client.get_data_source_reference request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::DataSourceReference. + # p result + # + def get_data_source_reference request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_data_source_reference.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_data_source_reference.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_data_source_reference.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_data_source_reference request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists DataSourceReferences for a given project and location. + # + # @overload list_data_source_references(request, options = nil) + # Pass arguments to `list_data_source_references` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_data_source_references(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_data_source_references` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of DataSourceReferences to return. The service + # may return fewer than this value. If unspecified, at most 50 + # DataSourceReferences will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDataSourceReferences` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDataSourceReferences` must match the call that provided the page + # token. + # @param filter [::String] + # Optional. A filter expression that filters the results listed in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. + # + # The following field and operator combinations are supported: + # + # * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + # * data_source_gcp_resource_info.type with `=`, `!=` + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # + # * data_source + # * data_source_gcp_resource_info.gcp_resourcename + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest.new + # + # # Call the list_data_source_references method. + # result = client.list_data_source_references request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSourceReference. + # p item + # end + # + def list_data_source_references request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_data_source_references.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_data_source_references.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_data_source_references.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_data_source_references request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_data_source_references, "data_source_references", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetch DataSourceReferences for a given project, location and resource type. + # + # @overload fetch_data_source_references_for_resource_type(request, options = nil) + # Pass arguments to `fetch_data_source_references_for_resource_type` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_data_source_references_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `fetch_data_source_references_for_resource_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @param resource_type [::String] + # Required. The type of the Google Cloud resource. + # Ex: sql.googleapis.com/Instance + # @param page_size [::Integer] + # Optional. The maximum number of DataSourceReferences to return. The service + # may return fewer than this value. If unspecified, at most 50 + # DataSourceReferences will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @param page_token [::String] + # Optional. A page token, received from a previous call of + # `FetchDataSourceReferencesForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchDataSourceReferencesForResourceType` must match + # the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * data_source + # * data_source_gcp_resource_info.gcp_resourcename + # * data_source_backup_config_state + # * data_source_backup_count + # * data_source_backup_config_info.last_backup_state + # * data_source_gcp_resource_info.gcp_resourcename + # * data_source_gcp_resource_info.type + # * data_source_gcp_resource_info.location + # * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest.new + # + # # Call the fetch_data_source_references_for_resource_type method. + # result = client.fetch_data_source_references_for_resource_type request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSourceReference. + # p item + # end + # + def fetch_data_source_references_for_resource_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fetch_data_source_references_for_resource_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_data_source_references_for_resource_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_data_source_references_for_resource_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.fetch_data_source_references_for_resource_type request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_data_source_references_for_resource_type, "data_source_references", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Initializes the service related config for a project. + # + # @overload initialize_service(request, options = nil) + # Pass arguments to `initialize_service` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload initialize_service(cloud_sql_instance_initialization_config: nil, name: nil, resource_type: nil, request_id: nil, backup_plan_location: nil, validate_only: nil) + # Pass arguments to `initialize_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cloud_sql_instance_initialization_config [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceInitializationConfig, ::Hash] + # Optional. The configuration for initializing a Cloud SQL instance. + # @param name [::String] + # Required. The resource name of the serviceConfig used to initialize the + # service. The location must be the location of the BackupVault. + # Format: `projects/{project_id}/locations/{location}/serviceConfig`. + # @param resource_type [::String] + # Required. The resource type to which the default service config will be + # applied. Examples include, "compute.googleapis.com/Instance" and + # "storage.googleapis.com/Bucket". + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param backup_plan_location [::String] + # Optional. The location where the BackupPlan will be created. This field is + # required for multi-region BackupVaults and is optional for regional + # BackupVaults. It is useful when creating a Backup Vault in a multi-region, + # allowing the BackupPlan to reside in a specific region within that + # multi-region. If this field is not provided, the BackupPlan will be created + # in the same location as specified in the `name` field. + # @param validate_only [::Boolean] + # Optional. If set, validates the request and returns the result, but does + # not actually run it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::InitializeServiceRequest.new + # + # # Call the initialize_service method. + # result = client.initialize_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def initialize_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.initialize_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.initialize_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.initialize_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.initialize_service request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new AutoProtectionPolicy in a given project and location. + # + # @overload create_auto_protection_policy(request, options = nil) + # Pass arguments to `create_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_auto_protection_policy(parent: nil, auto_protection_policy_id: nil, auto_protection_policy: nil) + # Pass arguments to `create_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this policy will be created. + # Format: projects/\\{project}/locations/\\{location} + # @param auto_protection_policy_id [::String] + # Required. The ID to use for the policy. + # This will become the final component of the policy's resource name. + # @param auto_protection_policy [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy, ::Hash] + # Required. The AutoProtectionPolicy resource to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest.new + # + # # Call the create_auto_protection_policy method. + # result = client.create_auto_protection_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_auto_protection_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.create_auto_protection_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists AutoProtectionPolicies for a given project and location. + # + # @overload list_auto_protection_policies(request, options = nil) + # Pass arguments to `list_auto_protection_policies` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_auto_protection_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_auto_protection_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve the list of + # policies. Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of policies to return in a single page. + # If unspecified, a server-default value will be used. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent + # page. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The following fields are filterable: + # @param order_by [::String] + # Optional. An expression that sorts the results in the response. The + # following fields are sortable: + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest.new + # + # # Call the list_auto_protection_policies method. + # result = client.list_auto_protection_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy. + # p item + # end + # + def list_auto_protection_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_auto_protection_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_auto_protection_policies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_auto_protection_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_auto_protection_policies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_auto_protection_policies, "auto_protection_policies", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single AutoProtectionPolicy. + # + # @overload get_auto_protection_policy(request, options = nil) + # Pass arguments to `get_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_auto_protection_policy(name: nil) + # Pass arguments to `get_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest.new + # + # # Call the get_auto_protection_policy method. + # result = client.get_auto_protection_policy request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy. + # p result + # + def get_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_auto_protection_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_auto_protection_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the parameters of a single AutoProtectionPolicy. + # + # @overload update_auto_protection_policy(request, options = nil) + # Pass arguments to `update_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_auto_protection_policy(auto_protection_policy: nil, update_mask: nil) + # Pass arguments to `update_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param auto_protection_policy [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy, ::Hash] + # Required. The policy to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # AutoProtectionPolicy resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest.new + # + # # Call the update_auto_protection_policy method. + # result = client.update_auto_protection_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_auto_protection_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.update_auto_protection_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single AutoProtectionPolicy. + # + # @overload delete_auto_protection_policy(request, options = nil) + # Pass arguments to `delete_auto_protection_policy` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_auto_protection_policy(name: nil, etag: nil) + # Pass arguments to `delete_auto_protection_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy to delete. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # @param etag [::String] + # The current etag of the AutoProtectionPolicy. + # If an etag is provided and does not match the current etag of the + # connection, the request will be rejected with an ABORTED error. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest.new + # + # # Call the delete_auto_protection_policy method. + # result = client.delete_auto_protection_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_auto_protection_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_auto_protection_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_auto_protection_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_auto_protection_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.delete_auto_protection_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new AutoProtectionPolicyBinding in a given project and + # location. + # + # @overload create_auto_protection_policy_binding(request, options = nil) + # Pass arguments to `create_auto_protection_policy_binding` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_auto_protection_policy_binding(parent: nil, auto_protection_policy_binding_id: nil, auto_protection_policy_binding: nil) + # Pass arguments to `create_auto_protection_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this binding will be created. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # @param auto_protection_policy_binding_id [::String] + # Required. The ID to use for the binding. + # This will become the final component of the binding's resource name. + # @param auto_protection_policy_binding [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding, ::Hash] + # Required. The AutoProtectionPolicyBinding resource to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest.new + # + # # Call the create_auto_protection_policy_binding method. + # result = client.create_auto_protection_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_auto_protection_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_auto_protection_policy_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_auto_protection_policy_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_auto_protection_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.create_auto_protection_policy_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the auto protection policy binding read from the CCFE tables. + # + # @overload get_auto_protection_policy_binding(request, options = nil) + # Pass arguments to `get_auto_protection_policy_binding` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_auto_protection_policy_binding(name: nil) + # Pass arguments to `get_auto_protection_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the binding to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest.new + # + # # Call the get_auto_protection_policy_binding method. + # result = client.get_auto_protection_policy_binding request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding. + # p result + # + def get_auto_protection_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_auto_protection_policy_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_auto_protection_policy_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_auto_protection_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_auto_protection_policy_binding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the auto protection policy bindings read from the CCFE tables. + # + # @overload list_auto_protection_policy_bindings(request, options = nil) + # Pass arguments to `list_auto_protection_policy_bindings` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_auto_protection_policy_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_auto_protection_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve the list of + # policies. Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of policies to return in a single page. + # If unspecified, a server-default value will be used. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent + # page. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The following fields are filterable: + # @param order_by [::String] + # Optional. An expression that sorts the results in the response. The + # following fields are sortable: + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest.new + # + # # Call the list_auto_protection_policy_bindings method. + # result = client.list_auto_protection_policy_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding. + # p item + # end + # + def list_auto_protection_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_auto_protection_policy_bindings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_auto_protection_policy_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_auto_protection_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_auto_protection_policy_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_auto_protection_policy_bindings, "auto_protection_policy_bindings", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists AppliedAutoProtectionPolicies in a given project and location. + # + # @overload list_applied_auto_protection_policies(request, options = nil) + # Pass arguments to `list_applied_auto_protection_policies` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_applied_auto_protection_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_applied_auto_protection_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location for which to retrieve the list of + # applied policies. Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. The maximum number of applied policies to return in a single + # page. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAppliedAutoProtectionPolicies` call. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. + # @param order_by [::String] + # Optional. An expression that sorts the results in the response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest.new + # + # # Call the list_applied_auto_protection_policies method. + # result = client.list_applied_auto_protection_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy. + # p item + # end + # + def list_applied_auto_protection_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_applied_auto_protection_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_applied_auto_protection_policies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_applied_auto_protection_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_applied_auto_protection_policies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_applied_auto_protection_policies, "applied_auto_protection_policies", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # InitiateDeleteAutoProtectionPolicyBinding initiates delete for + # AutoProtectionPolicy Binding + # + # @overload initiate_delete_auto_protection_policy_binding(request, options = nil) + # Pass arguments to `initiate_delete_auto_protection_policy_binding` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload initiate_delete_auto_protection_policy_binding(name: nil) + # Pass arguments to `initiate_delete_auto_protection_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the binding to delete. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest.new + # + # # Call the initiate_delete_auto_protection_policy_binding method. + # result = client.initiate_delete_auto_protection_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def initiate_delete_auto_protection_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.initiate_delete_auto_protection_policy_binding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.initiate_delete_auto_protection_policy_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.initiate_delete_auto_protection_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.initiate_delete_auto_protection_policy_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single Binding Matching Resource. + # + # @overload get_binding_matching_resource(request, options = nil) + # Pass arguments to `get_binding_matching_resource` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_binding_matching_resource(name: nil) + # Pass arguments to `get_binding_matching_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the matching resource to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding}/matchingResources/\\{matching_resource} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BindingMatchingResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BindingMatchingResource] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest.new + # + # # Call the get_binding_matching_resource method. + # result = client.get_binding_matching_resource request + # + # # The returned object is of type Google::Cloud::BackupDR::V1beta::BindingMatchingResource. + # p result + # + def get_binding_matching_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_binding_matching_resource.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_binding_matching_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_binding_matching_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.get_binding_matching_resource request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Binding Matching Resources for a given AutoProtectionPolicyBinding. + # + # @overload list_binding_matching_resources(request, options = nil) + # Pass arguments to `list_binding_matching_resources` via a request object, either of type + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_binding_matching_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_binding_matching_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project, location, auto protection policy and binding for + # which to retrieve `BindingMatchingResources` information. Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}`. + # In Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example **us-central1**. + # @param page_size [::Integer] + # Optional. The maximum number of `BindingMatchingResources` to return in a + # single response. The default page size is 100 and maximum page size is 200. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse#next_page_token next_page_token} + # received from a previous `ListBindingMatchingResources` call. Provide this + # to retrieve the subsequent page in a multi-page list of results. When + # paginating, all other parameters provided to `ListBindingMatchingResources` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. Field match expression used to filter the results. + # @param order_by [::String] + # Optional. Field by which to sort the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BindingMatchingResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1beta::BindingMatchingResource>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/backupdr/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest.new + # + # # Call the list_binding_matching_resources method. + # result = client.list_binding_matching_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::BackupDR::V1beta::BindingMatchingResource. + # p item + # end + # + def list_binding_matching_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_binding_matching_resources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_binding_matching_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_binding_matching_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @backup_dr_stub.list_binding_matching_resources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_binding_matching_resources, "matching_resources", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BackupDR REST API. + # + # This class represents the configuration for BackupDR REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_management_servers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_management_servers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_management_servers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "backupdr.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the BackupDR API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_management_servers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_management_servers + ## + # RPC-specific configuration for `get_management_server` + # @return [::Gapic::Config::Method] + # + attr_reader :get_management_server + ## + # RPC-specific configuration for `create_management_server` + # @return [::Gapic::Config::Method] + # + attr_reader :create_management_server + ## + # RPC-specific configuration for `delete_management_server` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_management_server + ## + # RPC-specific configuration for `create_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_vault + ## + # RPC-specific configuration for `list_backup_vaults` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_vaults + ## + # RPC-specific configuration for `fetch_usable_backup_vaults` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_usable_backup_vaults + ## + # RPC-specific configuration for `get_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_vault + ## + # RPC-specific configuration for `update_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_vault + ## + # RPC-specific configuration for `delete_backup_vault` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_vault + ## + # RPC-specific configuration for `list_data_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_sources + ## + # RPC-specific configuration for `get_data_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_source + ## + # RPC-specific configuration for `update_data_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_data_source + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `fetch_backups_for_resource_type` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_backups_for_resource_type + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `update_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `restore_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_backup + ## + # RPC-specific configuration for `create_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_plan + ## + # RPC-specific configuration for `update_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_plan + ## + # RPC-specific configuration for `get_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_plan + ## + # RPC-specific configuration for `list_backup_plans` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_plans + ## + # RPC-specific configuration for `delete_backup_plan` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_plan + ## + # RPC-specific configuration for `get_backup_plan_revision` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_plan_revision + ## + # RPC-specific configuration for `list_backup_plan_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_plan_revisions + ## + # RPC-specific configuration for `create_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_plan_association + ## + # RPC-specific configuration for `update_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_plan_association + ## + # RPC-specific configuration for `get_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_plan_association + ## + # RPC-specific configuration for `list_backup_plan_associations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_plan_associations + ## + # RPC-specific configuration for `fetch_backup_plan_associations_for_resource_type` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_backup_plan_associations_for_resource_type + ## + # RPC-specific configuration for `delete_backup_plan_association` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_plan_association + ## + # RPC-specific configuration for `trigger_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :trigger_backup + ## + # RPC-specific configuration for `get_data_source_reference` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_source_reference + ## + # RPC-specific configuration for `list_data_source_references` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_source_references + ## + # RPC-specific configuration for `fetch_data_source_references_for_resource_type` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_data_source_references_for_resource_type + ## + # RPC-specific configuration for `initialize_service` + # @return [::Gapic::Config::Method] + # + attr_reader :initialize_service + ## + # RPC-specific configuration for `create_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_auto_protection_policy + ## + # RPC-specific configuration for `list_auto_protection_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_auto_protection_policies + ## + # RPC-specific configuration for `get_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_auto_protection_policy + ## + # RPC-specific configuration for `update_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_auto_protection_policy + ## + # RPC-specific configuration for `delete_auto_protection_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_auto_protection_policy + ## + # RPC-specific configuration for `create_auto_protection_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_auto_protection_policy_binding + ## + # RPC-specific configuration for `get_auto_protection_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_auto_protection_policy_binding + ## + # RPC-specific configuration for `list_auto_protection_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_auto_protection_policy_bindings + ## + # RPC-specific configuration for `list_applied_auto_protection_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_applied_auto_protection_policies + ## + # RPC-specific configuration for `initiate_delete_auto_protection_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :initiate_delete_auto_protection_policy_binding + ## + # RPC-specific configuration for `get_binding_matching_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_binding_matching_resource + ## + # RPC-specific configuration for `list_binding_matching_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_binding_matching_resources + + # @private + def initialize parent_rpcs = nil + list_management_servers_config = parent_rpcs.list_management_servers if parent_rpcs.respond_to? :list_management_servers + @list_management_servers = ::Gapic::Config::Method.new list_management_servers_config + get_management_server_config = parent_rpcs.get_management_server if parent_rpcs.respond_to? :get_management_server + @get_management_server = ::Gapic::Config::Method.new get_management_server_config + create_management_server_config = parent_rpcs.create_management_server if parent_rpcs.respond_to? :create_management_server + @create_management_server = ::Gapic::Config::Method.new create_management_server_config + delete_management_server_config = parent_rpcs.delete_management_server if parent_rpcs.respond_to? :delete_management_server + @delete_management_server = ::Gapic::Config::Method.new delete_management_server_config + create_backup_vault_config = parent_rpcs.create_backup_vault if parent_rpcs.respond_to? :create_backup_vault + @create_backup_vault = ::Gapic::Config::Method.new create_backup_vault_config + list_backup_vaults_config = parent_rpcs.list_backup_vaults if parent_rpcs.respond_to? :list_backup_vaults + @list_backup_vaults = ::Gapic::Config::Method.new list_backup_vaults_config + fetch_usable_backup_vaults_config = parent_rpcs.fetch_usable_backup_vaults if parent_rpcs.respond_to? :fetch_usable_backup_vaults + @fetch_usable_backup_vaults = ::Gapic::Config::Method.new fetch_usable_backup_vaults_config + get_backup_vault_config = parent_rpcs.get_backup_vault if parent_rpcs.respond_to? :get_backup_vault + @get_backup_vault = ::Gapic::Config::Method.new get_backup_vault_config + update_backup_vault_config = parent_rpcs.update_backup_vault if parent_rpcs.respond_to? :update_backup_vault + @update_backup_vault = ::Gapic::Config::Method.new update_backup_vault_config + delete_backup_vault_config = parent_rpcs.delete_backup_vault if parent_rpcs.respond_to? :delete_backup_vault + @delete_backup_vault = ::Gapic::Config::Method.new delete_backup_vault_config + list_data_sources_config = parent_rpcs.list_data_sources if parent_rpcs.respond_to? :list_data_sources + @list_data_sources = ::Gapic::Config::Method.new list_data_sources_config + get_data_source_config = parent_rpcs.get_data_source if parent_rpcs.respond_to? :get_data_source + @get_data_source = ::Gapic::Config::Method.new get_data_source_config + update_data_source_config = parent_rpcs.update_data_source if parent_rpcs.respond_to? :update_data_source + @update_data_source = ::Gapic::Config::Method.new update_data_source_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + fetch_backups_for_resource_type_config = parent_rpcs.fetch_backups_for_resource_type if parent_rpcs.respond_to? :fetch_backups_for_resource_type + @fetch_backups_for_resource_type = ::Gapic::Config::Method.new fetch_backups_for_resource_type_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup + @update_backup = ::Gapic::Config::Method.new update_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + restore_backup_config = parent_rpcs.restore_backup if parent_rpcs.respond_to? :restore_backup + @restore_backup = ::Gapic::Config::Method.new restore_backup_config + create_backup_plan_config = parent_rpcs.create_backup_plan if parent_rpcs.respond_to? :create_backup_plan + @create_backup_plan = ::Gapic::Config::Method.new create_backup_plan_config + update_backup_plan_config = parent_rpcs.update_backup_plan if parent_rpcs.respond_to? :update_backup_plan + @update_backup_plan = ::Gapic::Config::Method.new update_backup_plan_config + get_backup_plan_config = parent_rpcs.get_backup_plan if parent_rpcs.respond_to? :get_backup_plan + @get_backup_plan = ::Gapic::Config::Method.new get_backup_plan_config + list_backup_plans_config = parent_rpcs.list_backup_plans if parent_rpcs.respond_to? :list_backup_plans + @list_backup_plans = ::Gapic::Config::Method.new list_backup_plans_config + delete_backup_plan_config = parent_rpcs.delete_backup_plan if parent_rpcs.respond_to? :delete_backup_plan + @delete_backup_plan = ::Gapic::Config::Method.new delete_backup_plan_config + get_backup_plan_revision_config = parent_rpcs.get_backup_plan_revision if parent_rpcs.respond_to? :get_backup_plan_revision + @get_backup_plan_revision = ::Gapic::Config::Method.new get_backup_plan_revision_config + list_backup_plan_revisions_config = parent_rpcs.list_backup_plan_revisions if parent_rpcs.respond_to? :list_backup_plan_revisions + @list_backup_plan_revisions = ::Gapic::Config::Method.new list_backup_plan_revisions_config + create_backup_plan_association_config = parent_rpcs.create_backup_plan_association if parent_rpcs.respond_to? :create_backup_plan_association + @create_backup_plan_association = ::Gapic::Config::Method.new create_backup_plan_association_config + update_backup_plan_association_config = parent_rpcs.update_backup_plan_association if parent_rpcs.respond_to? :update_backup_plan_association + @update_backup_plan_association = ::Gapic::Config::Method.new update_backup_plan_association_config + get_backup_plan_association_config = parent_rpcs.get_backup_plan_association if parent_rpcs.respond_to? :get_backup_plan_association + @get_backup_plan_association = ::Gapic::Config::Method.new get_backup_plan_association_config + list_backup_plan_associations_config = parent_rpcs.list_backup_plan_associations if parent_rpcs.respond_to? :list_backup_plan_associations + @list_backup_plan_associations = ::Gapic::Config::Method.new list_backup_plan_associations_config + fetch_backup_plan_associations_for_resource_type_config = parent_rpcs.fetch_backup_plan_associations_for_resource_type if parent_rpcs.respond_to? :fetch_backup_plan_associations_for_resource_type + @fetch_backup_plan_associations_for_resource_type = ::Gapic::Config::Method.new fetch_backup_plan_associations_for_resource_type_config + delete_backup_plan_association_config = parent_rpcs.delete_backup_plan_association if parent_rpcs.respond_to? :delete_backup_plan_association + @delete_backup_plan_association = ::Gapic::Config::Method.new delete_backup_plan_association_config + trigger_backup_config = parent_rpcs.trigger_backup if parent_rpcs.respond_to? :trigger_backup + @trigger_backup = ::Gapic::Config::Method.new trigger_backup_config + get_data_source_reference_config = parent_rpcs.get_data_source_reference if parent_rpcs.respond_to? :get_data_source_reference + @get_data_source_reference = ::Gapic::Config::Method.new get_data_source_reference_config + list_data_source_references_config = parent_rpcs.list_data_source_references if parent_rpcs.respond_to? :list_data_source_references + @list_data_source_references = ::Gapic::Config::Method.new list_data_source_references_config + fetch_data_source_references_for_resource_type_config = parent_rpcs.fetch_data_source_references_for_resource_type if parent_rpcs.respond_to? :fetch_data_source_references_for_resource_type + @fetch_data_source_references_for_resource_type = ::Gapic::Config::Method.new fetch_data_source_references_for_resource_type_config + initialize_service_config = parent_rpcs.initialize_service if parent_rpcs.respond_to? :initialize_service + @initialize_service = ::Gapic::Config::Method.new initialize_service_config + create_auto_protection_policy_config = parent_rpcs.create_auto_protection_policy if parent_rpcs.respond_to? :create_auto_protection_policy + @create_auto_protection_policy = ::Gapic::Config::Method.new create_auto_protection_policy_config + list_auto_protection_policies_config = parent_rpcs.list_auto_protection_policies if parent_rpcs.respond_to? :list_auto_protection_policies + @list_auto_protection_policies = ::Gapic::Config::Method.new list_auto_protection_policies_config + get_auto_protection_policy_config = parent_rpcs.get_auto_protection_policy if parent_rpcs.respond_to? :get_auto_protection_policy + @get_auto_protection_policy = ::Gapic::Config::Method.new get_auto_protection_policy_config + update_auto_protection_policy_config = parent_rpcs.update_auto_protection_policy if parent_rpcs.respond_to? :update_auto_protection_policy + @update_auto_protection_policy = ::Gapic::Config::Method.new update_auto_protection_policy_config + delete_auto_protection_policy_config = parent_rpcs.delete_auto_protection_policy if parent_rpcs.respond_to? :delete_auto_protection_policy + @delete_auto_protection_policy = ::Gapic::Config::Method.new delete_auto_protection_policy_config + create_auto_protection_policy_binding_config = parent_rpcs.create_auto_protection_policy_binding if parent_rpcs.respond_to? :create_auto_protection_policy_binding + @create_auto_protection_policy_binding = ::Gapic::Config::Method.new create_auto_protection_policy_binding_config + get_auto_protection_policy_binding_config = parent_rpcs.get_auto_protection_policy_binding if parent_rpcs.respond_to? :get_auto_protection_policy_binding + @get_auto_protection_policy_binding = ::Gapic::Config::Method.new get_auto_protection_policy_binding_config + list_auto_protection_policy_bindings_config = parent_rpcs.list_auto_protection_policy_bindings if parent_rpcs.respond_to? :list_auto_protection_policy_bindings + @list_auto_protection_policy_bindings = ::Gapic::Config::Method.new list_auto_protection_policy_bindings_config + list_applied_auto_protection_policies_config = parent_rpcs.list_applied_auto_protection_policies if parent_rpcs.respond_to? :list_applied_auto_protection_policies + @list_applied_auto_protection_policies = ::Gapic::Config::Method.new list_applied_auto_protection_policies_config + 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 + @initiate_delete_auto_protection_policy_binding = ::Gapic::Config::Method.new initiate_delete_auto_protection_policy_binding_config + get_binding_matching_resource_config = parent_rpcs.get_binding_matching_resource if parent_rpcs.respond_to? :get_binding_matching_resource + @get_binding_matching_resource = ::Gapic::Config::Method.new get_binding_matching_resource_config + list_binding_matching_resources_config = parent_rpcs.list_binding_matching_resources if parent_rpcs.respond_to? :list_binding_matching_resources + @list_binding_matching_resources = ::Gapic::Config::Method.new list_binding_matching_resources_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/operations.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/operations.rb new file mode 100644 index 000000000000..452c6568b9b8 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/operations.rb @@ -0,0 +1,927 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDR + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "backupdr.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the BackupDR Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the BackupDR Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::BackupDR::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "backupdr.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/service_stub.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/service_stub.rb new file mode 100644 index 000000000000..7d50feabe70f --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr/rest/service_stub.rb @@ -0,0 +1,3086 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/backupdr/v1beta/backupdr_pb" + +module Google + module Cloud + module BackupDR + module V1beta + module BackupDR + module Rest + ## + # REST service stub for the BackupDR service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_management_servers REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListManagementServersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListManagementServersResponse] + # A result object deserialized from the server's reply + def list_management_servers request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_management_servers_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_management_servers", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListManagementServersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_management_server REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ManagementServer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ManagementServer] + # A result object deserialized from the server's reply + def get_management_server request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_management_server_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_management_server", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ManagementServer.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_management_server REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_management_server request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_management_server_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_management_server", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_management_server REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_management_server request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_management_server_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_management_server", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_backup_vault request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_vault_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_backup_vault", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_vaults REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListBackupVaultsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListBackupVaultsResponse] + # A result object deserialized from the server's reply + def list_backup_vaults request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_vaults_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backup_vaults", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_usable_backup_vaults REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsResponse] + # A result object deserialized from the server's reply + def fetch_usable_backup_vaults request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_usable_backup_vaults_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "fetch_usable_backup_vaults", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupVault] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault] + # A result object deserialized from the server's reply + def get_backup_vault request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_vault_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup_vault", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::BackupVault.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_backup_vault request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_vault_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_backup_vault", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup_vault request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_vault_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup_vault", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_data_sources REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListDataSourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListDataSourcesResponse] + # A result object deserialized from the server's reply + def list_data_sources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_data_sources_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_data_sources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListDataSourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_data_source REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::DataSource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::DataSource] + # A result object deserialized from the server's reply + def get_data_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_data_source_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_data_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::DataSource.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_data_source REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_data_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_data_source_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_data_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backups REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListBackupsResponse] + # A result object deserialized from the server's reply + def list_backups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_backups_for_resource_type REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeResponse] + # A result object deserialized from the server's reply + def fetch_backups_for_resource_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_backups_for_resource_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "fetch_backups_for_resource_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::Backup] + # A result object deserialized from the server's reply + def get_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::Backup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the restore_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def restore_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "restore_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_backup_plan request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_plan_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_backup_plan", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_backup_plan request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_plan_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_backup_plan", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # A result object deserialized from the server's reply + def get_backup_plan request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_plan_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup_plan", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::BackupPlan.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_plans REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse] + # A result object deserialized from the server's reply + def list_backup_plans request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_plans_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backup_plans", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup_plan request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_plan_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup_plan", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup_plan_revision REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupPlanRevision] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanRevision] + # A result object deserialized from the server's reply + def get_backup_plan_revision request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_plan_revision_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup_plan_revision", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::BackupPlanRevision.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_plan_revisions REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsResponse] + # A result object deserialized from the server's reply + def list_backup_plan_revisions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_plan_revisions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backup_plan_revisions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_backup_plan_association request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_plan_association_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_backup_plan_association", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_backup_plan_association request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_plan_association_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_backup_plan_association", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # A result object deserialized from the server's reply + def get_backup_plan_association request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_plan_association_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup_plan_association", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_plan_associations REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsResponse] + # A result object deserialized from the server's reply + def list_backup_plan_associations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_plan_associations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backup_plan_associations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_backup_plan_associations_for_resource_type REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeResponse] + # A result object deserialized from the server's reply + def fetch_backup_plan_associations_for_resource_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_backup_plan_associations_for_resource_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "fetch_backup_plan_associations_for_resource_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup_plan_association request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_plan_association_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup_plan_association", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the trigger_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def trigger_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_trigger_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "trigger_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_data_source_reference REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::DataSourceReference] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::DataSourceReference] + # A result object deserialized from the server's reply + def get_data_source_reference request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_data_source_reference_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_data_source_reference", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::DataSourceReference.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_data_source_references REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesResponse] + # A result object deserialized from the server's reply + def list_data_source_references request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_data_source_references_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_data_source_references", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_data_source_references_for_resource_type REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeResponse] + # A result object deserialized from the server's reply + def fetch_data_source_references_for_resource_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_data_source_references_for_resource_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "fetch_data_source_references_for_resource_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the initialize_service REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def initialize_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_initialize_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "initialize_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_auto_protection_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_auto_protection_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_auto_protection_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_auto_protection_policies REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesResponse] + # A result object deserialized from the server's reply + def list_auto_protection_policies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_auto_protection_policies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_auto_protection_policies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # A result object deserialized from the server's reply + def get_auto_protection_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_auto_protection_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_auto_protection_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_auto_protection_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_auto_protection_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_auto_protection_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_auto_protection_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_auto_protection_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_auto_protection_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_auto_protection_policy_binding REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_auto_protection_policy_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_auto_protection_policy_binding_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_auto_protection_policy_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_auto_protection_policy_binding REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding] + # A result object deserialized from the server's reply + def get_auto_protection_policy_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_auto_protection_policy_binding_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_auto_protection_policy_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_auto_protection_policy_bindings REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsResponse] + # A result object deserialized from the server's reply + def list_auto_protection_policy_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_auto_protection_policy_bindings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_auto_protection_policy_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_applied_auto_protection_policies REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesResponse] + # A result object deserialized from the server's reply + def list_applied_auto_protection_policies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_applied_auto_protection_policies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_applied_auto_protection_policies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the initiate_delete_auto_protection_policy_binding REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def initiate_delete_auto_protection_policy_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_initiate_delete_auto_protection_policy_binding_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "initiate_delete_auto_protection_policy_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_binding_matching_resource REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::BindingMatchingResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::BindingMatchingResource] + # A result object deserialized from the server's reply + def get_binding_matching_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_binding_matching_resource_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_binding_matching_resource", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::BindingMatchingResource.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_binding_matching_resources REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse] + # A result object deserialized from the server's reply + def list_binding_matching_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_binding_matching_resources_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_binding_matching_resources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_management_servers REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_management_servers_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/managementServers", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_management_server REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_management_server_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/managementServers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_management_server REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_management_server_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/managementServers", + body: "management_server", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_management_server REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_management_server_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/managementServers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_backup_vault_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/backupVaults", + body: "backup_vault", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_vaults REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backup_vaults_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backupVaults", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_usable_backup_vaults REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_usable_backup_vaults_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backupVaults:fetchUsable", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_vault_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_backup_vault_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{backup_vault.name}", + body: "backup_vault", + matches: [ + ["backup_vault.name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup_vault REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_backup_vault_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_data_sources REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_data_sources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/dataSources", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_data_source REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_data_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_data_source REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_data_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{data_source.name}", + body: "data_source", + matches: [ + ["data_source.name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backups REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_backups_for_resource_type REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_backups_for_resource_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backups:fetchForResourceType", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{backup.name}", + body: "backup", + matches: [ + ["backup.name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restore_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:restore", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupVaults/[^/]+/dataSources/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_backup_plan_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/backupPlans", + body: "backup_plan", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_backup_plan_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{backup_plan.name}", + body: "backup_plan", + matches: [ + ["backup_plan.name", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_plan_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_plans REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backup_plans_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backupPlans", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup_plan REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_backup_plan_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_plan_revision REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_plan_revision_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/revisions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_plan_revisions REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backup_plan_revisions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/revisions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_backup_plan_association_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/backupPlanAssociations", + body: "backup_plan_association", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_backup_plan_association_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{backup_plan_association.name}", + body: "backup_plan_association", + matches: [ + ["backup_plan_association.name", %r{^projects/[^/]+/locations/[^/]+/backupPlanAssociations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_plan_association_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupPlanAssociations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_plan_associations REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backup_plan_associations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backupPlanAssociations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_backup_plan_associations_for_resource_type REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_backup_plan_associations_for_resource_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backupPlanAssociations:fetchForResourceType", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup_plan_association REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_backup_plan_association_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupPlanAssociations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the trigger_backup REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_trigger_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:triggerBackup", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupPlanAssociations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_data_source_reference REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_data_source_reference_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataSourceReferences/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_data_source_references REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_data_source_references_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/dataSourceReferences", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_data_source_references_for_resource_type REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_data_source_references_for_resource_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/dataSourceReferences:fetchForResourceType", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the initialize_service REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_initialize_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:initialize", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/serviceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_auto_protection_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/autoProtectionPolicies", + body: "auto_protection_policy", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_auto_protection_policies REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_auto_protection_policies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/autoProtectionPolicies", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_auto_protection_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_auto_protection_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{auto_protection_policy.name}", + body: "auto_protection_policy", + matches: [ + ["auto_protection_policy.name", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_auto_protection_policy REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_auto_protection_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_auto_protection_policy_binding REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_auto_protection_policy_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/bindings", + body: "auto_protection_policy_binding", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_auto_protection_policy_binding REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_auto_protection_policy_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/bindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_auto_protection_policy_bindings REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_auto_protection_policy_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/bindings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_applied_auto_protection_policies REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_applied_auto_protection_policies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/appliedAutoProtectionPolicies", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the initiate_delete_auto_protection_policy_binding REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_initiate_delete_auto_protection_policy_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:initiateDelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/bindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_binding_matching_resource REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_binding_matching_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/bindings/[^/]+/matchingResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_binding_matching_resources REST call + # + # @param request_pb [::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_binding_matching_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/matchingResources", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/autoProtectionPolicies/[^/]+/bindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr_pb.rb b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr_pb.rb new file mode 100644 index 000000000000..01897f0f0889 --- /dev/null +++ b/google-cloud-backupdr-v1beta/lib/google/cloud/backupdr/v1beta/backupdr_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/backupdr/v1beta/backupdr.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/backupdr/v1beta/appliedautoprotectionpolicy_pb' +require 'google/cloud/backupdr/v1beta/autoprotectionpolicy_pb' +require 'google/cloud/backupdr/v1beta/autoprotectionpolicybinding_pb' +require 'google/cloud/backupdr/v1beta/backupplan_pb' +require 'google/cloud/backupdr/v1beta/backupplanassociation_pb' +require 'google/cloud/backupdr/v1beta/backupvault_pb' +require 'google/cloud/backupdr/v1beta/backupvault_cloudsql_pb' +require 'google/cloud/backupdr/v1beta/bindingmatchingresource_pb' +require 'google/cloud/backupdr/v1beta/datasourcereference_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n+google/cloud/backupdr/v1beta/backupdr.proto\x12\x1cgoogle.cloud.backupdr.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a>google/cloud/backupdr/v1beta/appliedautoprotectionpolicy.proto\x1a\x37google/cloud/backupdr/v1beta/autoprotectionpolicy.proto\x1a>google/cloud/backupdr/v1beta/autoprotectionpolicybinding.proto\x1a-google/cloud/backupdr/v1beta/backupplan.proto\x1a\x38google/cloud/backupdr/v1beta/backupplanassociation.proto\x1a.google/cloud/backupdr/v1beta/backupvault.proto\x1a\x37google/cloud/backupdr/v1beta/backupvault_cloudsql.proto\x1a:google/cloud/backupdr/v1beta/bindingmatchingresource.proto\x1a\x36google/cloud/backupdr/v1beta/datasourcereference.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xc2\x01\n\rNetworkConfig\x12\x14\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12R\n\x0cpeering_mode\x18\x02 \x01(\x0e\x32\x37.google.cloud.backupdr.v1beta.NetworkConfig.PeeringModeB\x03\xe0\x41\x01\"G\n\x0bPeeringMode\x12\x1c\n\x18PEERING_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x01\"6\n\rManagementURI\x12\x13\n\x06web_ui\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03\x61pi\x18\x02 \x01(\tB\x03\xe0\x41\x03\"w\n#WorkforceIdentityBasedManagementURI\x12\'\n\x1a\x66irst_party_management_uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\'\n\x1athird_party_management_uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\"|\n$WorkforceIdentityBasedOAuth2ClientID\x12)\n\x1c\x66irst_party_oauth2_client_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12)\n\x1cthird_party_oauth2_client_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xed\n\n\x10ManagementServer\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x18\n\x0b\x64\x65scription\x18\t \x01(\tB\x03\xe0\x41\x01\x12O\n\x06labels\x18\x04 \x03(\x0b\x32:.google.cloud.backupdr.v1beta.ManagementServer.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x04type\x18\x0e \x01(\x0e\x32;.google.cloud.backupdr.v1beta.ManagementServer.InstanceTypeB\x03\xe0\x41\x01\x12H\n\x0emanagement_uri\x18\x0b \x01(\x0b\x32+.google.cloud.backupdr.v1beta.ManagementURIB\x03\xe0\x41\x03\x12w\n\'workforce_identity_based_management_uri\x18\x10 \x01(\x0b\x32\x41.google.cloud.backupdr.v1beta.WorkforceIdentityBasedManagementURIB\x03\xe0\x41\x03\x12P\n\x05state\x18\x07 \x01(\x0e\x32<.google.cloud.backupdr.v1beta.ManagementServer.InstanceStateB\x03\xe0\x41\x03\x12\x42\n\x08networks\x18\x08 \x03(\x0b\x32+.google.cloud.backupdr.v1beta.NetworkConfigB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10oauth2_client_id\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12z\n)workforce_identity_based_oauth2_client_id\x18\x11 \x01(\x0b\x32\x42.google.cloud.backupdr.v1beta.WorkforceIdentityBasedOAuth2ClientIDB\x03\xe0\x41\x03\x12\x19\n\x0c\x62\x61_proxy_uri\x18\x12 \x03(\tB\x03\xe0\x41\x03\x12\x36\n\rsatisfies_pzs\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x14 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"A\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x42\x41\x43KUP_RESTORE\x10\x01\"\x8f\x01\n\rInstanceState\x12\x1e\n\x1aINSTANCE_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\t\n\x05\x45RROR\x10\x07:\xa1\x01\xea\x41\x9d\x01\n(backupdr.googleapis.com/ManagementServer\x12Lprojects/{project}/locations/{location}/managementServers/{managementserver}*\x11managementServers2\x10managementServer\"\xdf\x01\n\x1cListManagementServersRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(backupdr.googleapis.com/ManagementServer\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1a\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\t\n\x07_filterB\x0b\n\t_order_by\"\x99\x01\n\x1dListManagementServersResponse\x12J\n\x12management_servers\x18\x01 \x03(\x0b\x32..google.cloud.backupdr.v1beta.ManagementServer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\\\n\x1aGetManagementServerRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(backupdr.googleapis.com/ManagementServer\"\xed\x01\n\x1d\x43reateManagementServerRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(backupdr.googleapis.com/ManagementServer\x12!\n\x14management_server_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x11management_server\x18\x03 \x01(\x0b\x32..google.cloud.backupdr.v1beta.ManagementServerB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"x\n\x1d\x44\x65leteManagementServerRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(backupdr.googleapis.com/ManagementServer\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xbf\x02\n\x18InitializeServiceRequest\x12{\n(cloud_sql_instance_initialization_config\x18\x04 \x01(\x0b\x32\x42.google.cloud.backupdr.v1beta.CloudSqlInstanceInitializationConfigB\x03\xe0\x41\x01H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rresource_type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12!\n\x14\x62\x61\x63kup_plan_location\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x42\x17\n\x15initialization_config\"P\n\x19InitializeServiceResponse\x12\x19\n\x11\x62\x61\x63kup_vault_name\x18\x01 \x01(\t\x12\x18\n\x10\x62\x61\x63kup_plan_name\x18\x02 \x01(\t\"\x9a\x03\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x61\n\x0f\x61\x64\x64itional_info\x18\x08 \x03(\x0b\x32\x43.google.cloud.backupdr.v1beta.OperationMetadata.AdditionalInfoEntryB\x03\xe0\x41\x03\x1a\x35\n\x13\x41\x64\x64itionalInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\xc9\x61\n\x08\x42\x61\x63kupDR\x12\xdc\x01\n\x15ListManagementServers\x12:.google.cloud.backupdr.v1beta.ListManagementServersRequest\x1a;.google.cloud.backupdr.v1beta.ListManagementServersResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1beta/{parent=projects/*/locations/*}/managementServers\x12\xc9\x01\n\x13GetManagementServer\x12\x38.google.cloud.backupdr.v1beta.GetManagementServerRequest\x1a..google.cloud.backupdr.v1beta.ManagementServer\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1beta/{name=projects/*/locations/*/managementServers/*}\x12\xa3\x02\n\x16\x43reateManagementServer\x12;.google.cloud.backupdr.v1beta.CreateManagementServerRequest\x1a\x1d.google.longrunning.Operation\"\xac\x01\xca\x41%\n\x10ManagementServer\x12\x11OperationMetadata\xda\x41-parent,management_server,management_server_id\x82\xd3\xe4\x93\x02N\"9/v1beta/{parent=projects/*/locations/*}/managementServers:\x11management_server\x12\xeb\x01\n\x16\x44\x65leteManagementServer\x12;.google.cloud.backupdr.v1beta.DeleteManagementServerRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1beta/{name=projects/*/locations/*/managementServers/*}\x12\x80\x02\n\x11\x43reateBackupVault\x12\x36.google.cloud.backupdr.v1beta.CreateBackupVaultRequest\x1a\x1d.google.longrunning.Operation\"\x93\x01\xca\x41 \n\x0b\x42\x61\x63kupVault\x12\x11OperationMetadata\xda\x41#parent,backup_vault,backup_vault_id\x82\xd3\xe4\x93\x02\x44\"4/v1beta/{parent=projects/*/locations/*}/backupVaults:\x0c\x62\x61\x63kup_vault\x12\xc8\x01\n\x10ListBackupVaults\x12\x35.google.cloud.backupdr.v1beta.ListBackupVaultsRequest\x1a\x36.google.cloud.backupdr.v1beta.ListBackupVaultsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1beta/{parent=projects/*/locations/*}/backupVaults\x12\xe9\x01\n\x17\x46\x65tchUsableBackupVaults\x12<.google.cloud.backupdr.v1beta.FetchUsableBackupVaultsRequest\x1a=.google.cloud.backupdr.v1beta.FetchUsableBackupVaultsResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v1beta/{parent=projects/*/locations/*}/backupVaults:fetchUsable\x12\xb5\x01\n\x0eGetBackupVault\x12\x33.google.cloud.backupdr.v1beta.GetBackupVaultRequest\x1a).google.cloud.backupdr.v1beta.BackupVault\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1beta/{name=projects/*/locations/*/backupVaults/*}\x12\x82\x02\n\x11UpdateBackupVault\x12\x36.google.cloud.backupdr.v1beta.UpdateBackupVaultRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41 \n\x0b\x42\x61\x63kupVault\x12\x11OperationMetadata\xda\x41\x18\x62\x61\x63kup_vault,update_mask\x82\xd3\xe4\x93\x02Q2A/v1beta/{backup_vault.name=projects/*/locations/*/backupVaults/*}:\x0c\x62\x61\x63kup_vault\x12\xdc\x01\n\x11\x44\x65leteBackupVault\x12\x36.google.cloud.backupdr.v1beta.DeleteBackupVaultRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1beta/{name=projects/*/locations/*/backupVaults/*}\x12\xd3\x01\n\x0fListDataSources\x12\x34.google.cloud.backupdr.v1beta.ListDataSourcesRequest\x1a\x35.google.cloud.backupdr.v1beta.ListDataSourcesResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v1beta/{parent=projects/*/locations/*/backupVaults/*}/dataSources\x12\xc0\x01\n\rGetDataSource\x12\x32.google.cloud.backupdr.v1beta.GetDataSourceRequest\x1a(.google.cloud.backupdr.v1beta.DataSource\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1beta/{name=projects/*/locations/*/backupVaults/*/dataSources/*}\x12\x8a\x02\n\x10UpdateDataSource\x12\x35.google.cloud.backupdr.v1beta.UpdateDataSourceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x1f\n\nDataSource\x12\x11OperationMetadata\xda\x41\x17\x64\x61ta_source,update_mask\x82\xd3\xe4\x93\x02]2N/v1beta/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}:\x0b\x64\x61ta_source\x12\xd1\x01\n\x0bListBackups\x12\x30.google.cloud.backupdr.v1beta.ListBackupsRequest\x1a\x31.google.cloud.backupdr.v1beta.ListBackupsResponse\"]\xda\x41\x06parent\x82\xd3\xe4\x93\x02N\x12L/v1beta/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups\x12\xa5\x02\n\x1b\x46\x65tchBackupsForResourceType\x12@.google.cloud.backupdr.v1beta.FetchBackupsForResourceTypeRequest\x1a\x41.google.cloud.backupdr.v1beta.FetchBackupsForResourceTypeResponse\"\x80\x01\xda\x41\x14parent,resource_type\x82\xd3\xe4\x93\x02\x63\x12\x61/v1beta/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType\x12\xbe\x01\n\tGetBackup\x12..google.cloud.backupdr.v1beta.GetBackupRequest\x1a$.google.cloud.backupdr.v1beta.Backup\"[\xda\x41\x04name\x82\xd3\xe4\x93\x02N\x12L/v1beta/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}\x12\xf9\x01\n\x0cUpdateBackup\x12\x31.google.cloud.backupdr.v1beta.UpdateBackupRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\xda\x41\x12\x62\x61\x63kup,update_mask\x82\xd3\xe4\x93\x02]2S/v1beta/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:\x06\x62\x61\x63kup\x12\xdb\x01\n\x0c\x44\x65leteBackup\x12\x31.google.cloud.backupdr.v1beta.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02N*L/v1beta/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}\x12\xf8\x01\n\rRestoreBackup\x12\x32.google.cloud.backupdr.v1beta.RestoreBackupRequest\x1a\x1d.google.longrunning.Operation\"\x93\x01\xca\x41*\n\x15RestoreBackupResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02Y\"T/v1beta/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore:\x01*\x12\xf9\x01\n\x10\x43reateBackupPlan\x12\x35.google.cloud.backupdr.v1beta.CreateBackupPlanRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x01\xca\x41\x1f\n\nBackupPlan\x12\x11OperationMetadata\xda\x41!parent,backup_plan,backup_plan_id\x82\xd3\xe4\x93\x02\x42\"3/v1beta/{parent=projects/*/locations/*}/backupPlans:\x0b\x62\x61\x63kup_plan\x12\xfb\x01\n\x10UpdateBackupPlan\x12\x35.google.cloud.backupdr.v1beta.UpdateBackupPlanRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41\x1f\n\nBackupPlan\x12\x11OperationMetadata\xda\x41\x17\x62\x61\x63kup_plan,update_mask\x82\xd3\xe4\x93\x02N2?/v1beta/{backup_plan.name=projects/*/locations/*/backupPlans/*}:\x0b\x62\x61\x63kup_plan\x12\xb1\x01\n\rGetBackupPlan\x12\x32.google.cloud.backupdr.v1beta.GetBackupPlanRequest\x1a(.google.cloud.backupdr.v1beta.BackupPlan\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1beta/{name=projects/*/locations/*/backupPlans/*}\x12\xc4\x01\n\x0fListBackupPlans\x12\x34.google.cloud.backupdr.v1beta.ListBackupPlansRequest\x1a\x35.google.cloud.backupdr.v1beta.ListBackupPlansResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1beta/{parent=projects/*/locations/*}/backupPlans\x12\xd9\x01\n\x10\x44\x65leteBackupPlan\x12\x35.google.cloud.backupdr.v1beta.DeleteBackupPlanRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1beta/{name=projects/*/locations/*/backupPlans/*}\x12\xd5\x01\n\x15GetBackupPlanRevision\x12:.google.cloud.backupdr.v1beta.GetBackupPlanRevisionRequest\x1a\x30.google.cloud.backupdr.v1beta.BackupPlanRevision\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1beta/{name=projects/*/locations/*/backupPlans/*/revisions/*}\x12\xe8\x01\n\x17ListBackupPlanRevisions\x12<.google.cloud.backupdr.v1beta.ListBackupPlanRevisionsRequest\x1a=.google.cloud.backupdr.v1beta.ListBackupPlanRevisionsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1beta/{parent=projects/*/locations/*/backupPlans/*}/revisions\x12\xc9\x02\n\x1b\x43reateBackupPlanAssociation\x12@.google.cloud.backupdr.v1beta.CreateBackupPlanAssociationRequest\x1a\x1d.google.longrunning.Operation\"\xc8\x01\xca\x41*\n\x15\x42\x61\x63kupPlanAssociation\x12\x11OperationMetadata\xda\x41\x39parent,backup_plan_association,backup_plan_association_id\x82\xd3\xe4\x93\x02Y\">/v1beta/{parent=projects/*/locations/*}/backupPlanAssociations:\x17\x62\x61\x63kup_plan_association\x12\xcb\x02\n\x1bUpdateBackupPlanAssociation\x12@.google.cloud.backupdr.v1beta.UpdateBackupPlanAssociationRequest\x1a\x1d.google.longrunning.Operation\"\xca\x01\xca\x41*\n\x15\x42\x61\x63kupPlanAssociation\x12\x11OperationMetadata\xda\x41#backup_plan_association,update_mask\x82\xd3\xe4\x93\x02q2V/v1beta/{backup_plan_association.name=projects/*/locations/*/backupPlanAssociations/*}:\x17\x62\x61\x63kup_plan_association\x12\xdd\x01\n\x18GetBackupPlanAssociation\x12=.google.cloud.backupdr.v1beta.GetBackupPlanAssociationRequest\x1a\x33.google.cloud.backupdr.v1beta.BackupPlanAssociation\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1beta/{name=projects/*/locations/*/backupPlanAssociations/*}\x12\xf0\x01\n\x1aListBackupPlanAssociations\x12?.google.cloud.backupdr.v1beta.ListBackupPlanAssociationsRequest\x1a@.google.cloud.backupdr.v1beta.ListBackupPlanAssociationsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta/{parent=projects/*/locations/*}/backupPlanAssociations\x12\xc3\x02\n*FetchBackupPlanAssociationsForResourceType\x12O.google.cloud.backupdr.v1beta.FetchBackupPlanAssociationsForResourceTypeRequest\x1aP.google.cloud.backupdr.v1beta.FetchBackupPlanAssociationsForResourceTypeResponse\"r\xda\x41\x14parent,resource_type\x82\xd3\xe4\x93\x02U\x12S/v1beta/{parent=projects/*/locations/*}/backupPlanAssociations:fetchForResourceType\x12\xfa\x01\n\x1b\x44\x65leteBackupPlanAssociation\x12@.google.cloud.backupdr.v1beta.DeleteBackupPlanAssociationRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1beta/{name=projects/*/locations/*/backupPlanAssociations/*}\x12\xf8\x01\n\rTriggerBackup\x12\x32.google.cloud.backupdr.v1beta.TriggerBackupRequest\x1a\x1d.google.longrunning.Operation\"\x93\x01\xca\x41*\n\x15\x42\x61\x63kupPlanAssociation\x12\x11OperationMetadata\xda\x41\x0cname,rule_id\x82\xd3\xe4\x93\x02Q\"L/v1beta/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup:\x01*\x12\xd5\x01\n\x16GetDataSourceReference\x12;.google.cloud.backupdr.v1beta.GetDataSourceReferenceRequest\x1a\x31.google.cloud.backupdr.v1beta.DataSourceReference\"K\xda\x41\x04name\x82\xd3\xe4\x93\x02>\x12.google.cloud.backupdr.v1beta.ListDataSourceReferencesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12/v1beta/{name=projects/*/locations/*/serviceConfig}:initialize:\x01*\x12\xc3\x02\n\x1a\x43reateAutoProtectionPolicy\x12?.google.cloud.backupdr.v1beta.CreateAutoProtectionPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41)\n\x14\x41utoProtectionPolicy\x12\x11OperationMetadata\xda\x41\x37parent,auto_protection_policy,auto_protection_policy_id\x82\xd3\xe4\x93\x02X\">/v1beta/{parent=projects/*/locations/*}/autoProtectionPolicies:\x16\x61uto_protection_policy\x12\xf0\x01\n\x1aListAutoProtectionPolicies\x12?.google.cloud.backupdr.v1beta.ListAutoProtectionPoliciesRequest\x1a@.google.cloud.backupdr.v1beta.ListAutoProtectionPoliciesResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta/{parent=projects/*/locations/*}/autoProtectionPolicies\x12\xda\x01\n\x17GetAutoProtectionPolicy\x12<.google.cloud.backupdr.v1beta.GetAutoProtectionPolicyRequest\x1a\x32.google.cloud.backupdr.v1beta.AutoProtectionPolicy\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1beta/{name=projects/*/locations/*/autoProtectionPolicies/*}\x12\xc5\x02\n\x1aUpdateAutoProtectionPolicy\x12?.google.cloud.backupdr.v1beta.UpdateAutoProtectionPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xc6\x01\xca\x41)\n\x14\x41utoProtectionPolicy\x12\x11OperationMetadata\xda\x41\"auto_protection_policy,update_mask\x82\xd3\xe4\x93\x02o2U/v1beta/{auto_protection_policy.name=projects/*/locations/*/autoProtectionPolicies/*}:\x16\x61uto_protection_policy\x12\xf8\x01\n\x1a\x44\x65leteAutoProtectionPolicy\x12?.google.cloud.backupdr.v1beta.DeleteAutoProtectionPolicyRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1beta/{name=projects/*/locations/*/autoProtectionPolicies/*}\x12\xfb\x02\n!CreateAutoProtectionPolicyBinding\x12\x46.google.cloud.backupdr.v1beta.CreateAutoProtectionPolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xee\x01\xca\x41\x30\n\x1b\x41utoProtectionPolicyBinding\x12\x11OperationMetadata\xda\x41Gparent,auto_protection_policy_binding,auto_protection_policy_binding_id\x82\xd3\xe4\x93\x02k\"I/v1beta/{parent=projects/*/locations/*/autoProtectionPolicies/*}/bindings:\x1e\x61uto_protection_policy_binding\x12\xfa\x01\n\x1eGetAutoProtectionPolicyBinding\x12\x43.google.cloud.backupdr.v1beta.GetAutoProtectionPolicyBindingRequest\x1a\x39.google.cloud.backupdr.v1beta.AutoProtectionPolicyBinding\"X\xda\x41\x04name\x82\xd3\xe4\x93\x02K\x12I/v1beta/{name=projects/*/locations/*/autoProtectionPolicies/*/bindings/*}\x12\x8d\x02\n ListAutoProtectionPolicyBindings\x12\x45.google.cloud.backupdr.v1beta.ListAutoProtectionPolicyBindingsRequest\x1a\x46.google.cloud.backupdr.v1beta.ListAutoProtectionPolicyBindingsResponse\"Z\xda\x41\x06parent\x82\xd3\xe4\x93\x02K\x12I/v1beta/{parent=projects/*/locations/*/autoProtectionPolicies/*}/bindings\x12\x8c\x02\n!ListAppliedAutoProtectionPolicies\x12\x46.google.cloud.backupdr.v1beta.ListAppliedAutoProtectionPoliciesRequest\x1aG.google.cloud.backupdr.v1beta.ListAppliedAutoProtectionPoliciesResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1beta/{parent=projects/*/locations/*}/appliedAutoProtectionPolicies\x12\xba\x02\n)InitiateDeleteAutoProtectionPolicyBinding\x12N.google.cloud.backupdr.v1beta.InitiateDeleteAutoProtectionPolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\x9d\x01\xca\x41\x30\n\x1b\x41utoProtectionPolicyBinding\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02]\"X/v1beta/{name=projects/*/locations/*/autoProtectionPolicies/*/bindings/*}:initiateDelete:\x01*\x12\x82\x02\n\x1aGetBindingMatchingResource\x12?.google.cloud.backupdr.v1beta.GetBindingMatchingResourceRequest\x1a\x35.google.cloud.backupdr.v1beta.BindingMatchingResource\"l\xda\x41\x04name\x82\xd3\xe4\x93\x02_\x12]/v1beta/{name=projects/*/locations/*/autoProtectionPolicies/*/bindings/*/matchingResources/*}\x12\x95\x02\n\x1cListBindingMatchingResources\x12\x41.google.cloud.backupdr.v1beta.ListBindingMatchingResourcesRequest\x1a\x42.google.cloud.backupdr.v1beta.ListBindingMatchingResourcesResponse\"n\xda\x41\x06parent\x82\xd3\xe4\x93\x02_\x12]/v1beta/{parent=projects/*/locations/*/autoProtectionPolicies/*/bindings/*}/matchingResources\x1az\xca\x41\x17\x62\x61\x63kupdr.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-backupdr,https://www.googleapis.com/auth/cloud-platformB\xd1\x01\n com.google.cloud.backupdr.v1betaB\rBackupDRProtoP\x01Z\n\x0c\x62\x61\x63kup_plans\x18\x01 \x03(\x0b\x32(.google.cloud.backupdr.v1beta.BackupPlan\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"P\n\x14GetBackupPlanRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"backupdr.googleapis.com/BackupPlan\"t\n\x17\x44\x65leteBackupPlanRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"backupdr.googleapis.com/BackupPlan\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xb4\x01\n\x17UpdateBackupPlanRequest\x12\x42\n\x0b\x62\x61\x63kup_plan\x18\x01 \x01(\x0b\x32(.google.cloud.backupdr.v1beta.BackupPlanB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x98\x04\n\x12\x42\x61\x63kupPlanRevision\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x18\n\x0brevision_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12J\n\x05state\x18\x03 \x01(\x0e\x32\x36.google.cloud.backupdr.v1beta.BackupPlanRevision.StateB\x03\xe0\x41\x03\x12\x46\n\x14\x62\x61\x63kup_plan_snapshot\x18\x04 \x01(\x0b\x32(.google.cloud.backupdr.v1beta.BackupPlan\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0c\n\x08INACTIVE\x10\x04:\xb1\x01\xea\x41\xad\x01\n*backupdr.googleapis.com/BackupPlanRevision\x12Vprojects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}*\x13\x62\x61\x63kupPlanRevisions2\x12\x62\x61\x63kupPlanRevision\"`\n\x1cGetBackupPlanRevisionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*backupdr.googleapis.com/BackupPlanRevision\"\x95\x01\n\x1eListBackupPlanRevisionsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*backupdr.googleapis.com/BackupPlanRevision\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x1fListBackupPlanRevisionsResponse\x12O\n\x15\x62\x61\x63kup_plan_revisions\x18\x01 \x03(\x0b\x32\x30.google.cloud.backupdr.v1beta.BackupPlanRevision\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"4\n\x18\x44iskBackupPlanProperties\x12\x18\n\x0bguest_flush\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"?\n#ComputeInstanceBackupPlanProperties\x12\x18\n\x0bguest_flush\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x42\xd3\x01\n com.google.cloud.backupdr.v1betaB\x0f\x42\x61\x63kupPlanProtoP\x01Z.google.cloud.backupdr.v1beta.TriggerBackupRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\xde\x01\n com.google.cloud.backupdr.v1betaB\x1a\x42\x61\x63kupPlanAssociationProtoP\x01Z.google.cloud.backupdr.v1beta.DiskRestoreProperties.AccessModeB\x03\xe0\x41\x01H\n\x88\x01\x01\x12`\n\x0c\x61rchitecture\x18\x0e \x01(\x0e\x32@.google.cloud.backupdr.v1beta.DiskRestoreProperties.ArchitectureB\x03\xe0\x41\x01H\x0b\x88\x01\x01\x12\x1c\n\x0fresource_policy\x18\x0f \x03(\tB\x03\xe0\x41\x01\x12\x16\n\x04type\x18\x10 \x01(\tB\x03\xe0\x41\x02H\x0c\x88\x01\x01\x12T\n\x06labels\x18\x11 \x03(\x0b\x32?.google.cloud.backupdr.v1beta.DiskRestoreProperties.LabelsEntryB\x03\xe0\x41\x01\x12p\n\x15resource_manager_tags\x18\x12 \x03(\x0b\x32L.google.cloud.backupdr.v1beta.DiskRestoreProperties.ResourceManagerTagsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a:\n\x18ResourceManagerTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"L\n\nAccessMode\x12\x15\n\x11READ_WRITE_SINGLE\x10\x00\x12\x13\n\x0fREAD_WRITE_MANY\x10\x01\x12\x12\n\x0eREAD_ONLY_MANY\x10\x02\"C\n\x0c\x41rchitecture\x12\x1c\n\x18\x41RCHITECTURE_UNSPECIFIED\x10\x00\x12\n\n\x06X86_64\x10\x01\x12\t\n\x05\x41RM64\x10\x02\x42\x10\n\x0esource_optionsB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\n\n\x08_size_gbB\x16\n\x14_disk_encryption_keyB\x1c\n\x1a_physical_block_size_bytesB\x13\n\x11_provisioned_iopsB\x19\n\x17_provisioned_throughputB\x1e\n\x1c_enable_confidential_computeB\x0f\n\r_storage_poolB\x0e\n\x0c_access_modeB\x0f\n\r_architectureB\x07\n\x05_type\"b\n\x1eRestoreDiskFromInstanceOptions\x12\x1c\n\x12source_device_name\x18\x01 \x01(\tH\x00\x12\x13\n\tboot_disk\x18\x02 \x01(\x08H\x00\x42\r\n\x0bsource_disk\"\xfa\x07\n\x14\x44iskBackupProperties\x12\x18\n\x0b\x64\x65scription\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08licenses\x18\x02 \x03(\t\x12\x46\n\x10guest_os_feature\x18\x03 \x03(\x0b\x32,.google.cloud.backupdr.v1beta.GuestOsFeature\x12Z\n\x0c\x61rchitecture\x18\x04 \x01(\x0e\x32?.google.cloud.backupdr.v1beta.DiskBackupProperties.ArchitectureH\x01\x88\x01\x01\x12\x11\n\x04type\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x14\n\x07size_gb\x18\x06 \x01(\x03H\x03\x88\x01\x01\x12\x13\n\x06region\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x11\n\x04zone\x18\x08 \x01(\tH\x05\x88\x01\x01\x12\x15\n\rreplica_zones\x18\t \x03(\t\x12\x18\n\x0bsource_disk\x18\n \x01(\tH\x06\x88\x01\x01\x12\x18\n\x0b\x61\x63\x63\x65ss_mode\x18\x0b \x01(\tH\x07\x88\x01\x01\x12\x1d\n\x10provisioned_iops\x18\x0c \x01(\x03H\x08\x88\x01\x01\x12#\n\x16provisioned_throughput\x18\r \x01(\x03H\t\x88\x01\x01\x12&\n\x19physical_block_size_bytes\x18\x0e \x01(\x03H\n\x88\x01\x01\x12(\n\x1b\x65nable_confidential_compute\x18\x0f \x01(\x08H\x0b\x88\x01\x01\x12\x19\n\x0cstorage_pool\x18\x10 \x01(\tH\x0c\x88\x01\x01\x12N\n\x06labels\x18\x11 \x03(\x0b\x32>.google.cloud.backupdr.v1beta.DiskBackupProperties.LabelsEntry\x12\x18\n\x0bguest_flush\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"C\n\x0c\x41rchitecture\x12\x1c\n\x18\x41RCHITECTURE_UNSPECIFIED\x10\x00\x12\n\n\x06X86_64\x10\x01\x12\t\n\x05\x41RM64\x10\x02\x42\x0e\n\x0c_descriptionB\x0f\n\r_architectureB\x07\n\x05_typeB\n\n\x08_size_gbB\t\n\x07_regionB\x07\n\x05_zoneB\x0e\n\x0c_source_diskB\x0e\n\x0c_access_modeB\x13\n\x11_provisioned_iopsB\x19\n\x17_provisioned_throughputB\x1c\n\x1a_physical_block_size_bytesB\x1e\n\x1c_enable_confidential_computeB\x0f\n\r_storage_pool\"\\\n\x18\x44iskDataSourceProperties\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x0f\n\x07size_gb\x18\x04 \x01(\x03\x42\xbc\x02\n com.google.cloud.backupdr.v1betaB\x14\x42\x61\x63kupvaultDiskProtoP\x01Z\n\x05\x64isks\x18\x07 \x03(\x0b\x32*.google.cloud.backupdr.v1beta.AttachedDiskB\x03\xe0\x41\x01\x12M\n\x0e\x64isplay_device\x18\x08 \x01(\x0b\x32+.google.cloud.backupdr.v1beta.DisplayDeviceB\x03\xe0\x41\x01H\x06\x88\x01\x01\x12P\n\x12guest_accelerators\x18\t \x03(\x0b\x32/.google.cloud.backupdr.v1beta.AcceleratorConfigB\x03\xe0\x41\x01\x12\x1a\n\x08hostname\x18\n \x01(\tB\x03\xe0\x41\x01H\x07\x88\x01\x01\x12^\n\x17instance_encryption_key\x18\x0b \x01(\x0b\x32\x33.google.cloud.backupdr.v1beta.CustomerEncryptionKeyB\x03\xe0\x41\x01H\x08\x88\x01\x01\x12\x63\n\x1akey_revocation_action_type\x18\x0c \x01(\x0e\x32\x35.google.cloud.backupdr.v1beta.KeyRevocationActionTypeB\x03\xe0\x41\x01H\t\x88\x01\x01\x12_\n\x06labels\x18\r \x03(\x0b\x32J.google.cloud.backupdr.v1beta.ComputeInstanceRestoreProperties.LabelsEntryB\x03\xe0\x41\x01\x12\x1e\n\x0cmachine_type\x18\x0e \x01(\tB\x03\xe0\x41\x01H\n\x88\x01\x01\x12\x42\n\x08metadata\x18\x0f \x01(\x0b\x32&.google.cloud.backupdr.v1beta.MetadataB\x03\xe0\x41\x01H\x0b\x88\x01\x01\x12\"\n\x10min_cpu_platform\x18\x10 \x01(\tB\x03\xe0\x41\x01H\x0c\x88\x01\x01\x12O\n\x12network_interfaces\x18\x11 \x03(\x0b\x32..google.cloud.backupdr.v1beta.NetworkInterfaceB\x03\xe0\x41\x01\x12\x64\n\x1anetwork_performance_config\x18\x12 \x01(\x0b\x32\x36.google.cloud.backupdr.v1beta.NetworkPerformanceConfigB\x03\xe0\x41\x01H\r\x88\x01\x01\x12\x46\n\x06params\x18\x13 \x01(\x0b\x32,.google.cloud.backupdr.v1beta.InstanceParamsB\x03\xe0\x41\x04H\x0e\x88\x01\x01\x12\x8c\x01\n\x1aprivate_ipv6_google_access\x18\x14 \x01(\x0e\x32^.google.cloud.backupdr.v1beta.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccessB\x03\xe0\x41\x01H\x0f\x88\x01\x01\x12l\n\x13\x61llocation_affinity\x18\x15 \x01(\x0b\x32\x30.google.cloud.backupdr.v1beta.AllocationAffinityB\x03\xe0\x41\x01H\x10R\x13reservationAffinity\x88\x01\x01\x12\x1e\n\x11resource_policies\x18\x16 \x03(\tB\x03\xe0\x41\x01\x12\x46\n\nscheduling\x18\x17 \x01(\x0b\x32(.google.cloud.backupdr.v1beta.SchedulingB\x03\xe0\x41\x01H\x11\x88\x01\x01\x12K\n\x10service_accounts\x18\x18 \x03(\x0b\x32,.google.cloud.backupdr.v1beta.ServiceAccountB\x03\xe0\x41\x01\x12:\n\x04tags\x18\x1a \x01(\x0b\x32\".google.cloud.backupdr.v1beta.TagsB\x03\xe0\x41\x01H\x12\x88\x01\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\x1fInstancePrivateIpv6GoogleAccess\x12\x33\n/INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED\x10\x00\x12\x1b\n\x17INHERIT_FROM_SUBNETWORK\x10\x01\x12\'\n#ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE\x10\x02\x12)\n%ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE\x10\x03\x42\x07\n\x05_nameB\x1c\n\x1a_advanced_machine_featuresB\x11\n\x0f_can_ip_forwardB\x1f\n\x1d_confidential_instance_configB\x16\n\x14_deletion_protectionB\x0e\n\x0c_descriptionB\x11\n\x0f_display_deviceB\x0b\n\t_hostnameB\x1a\n\x18_instance_encryption_keyB\x1d\n\x1b_key_revocation_action_typeB\x0f\n\r_machine_typeB\x0b\n\t_metadataB\x13\n\x11_min_cpu_platformB\x1d\n\x1b_network_performance_configB\t\n\x07_paramsB\x1d\n\x1b_private_ipv6_google_accessB\x16\n\x14_allocation_affinityB\r\n\x0b_schedulingB\x07\n\x05_tags\"\x9a\x01\n ComputeInstanceTargetEnvironment\x12\x14\n\x07project\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12-\n\x1buse_project_service_account\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x1e\n\x1c_use_project_service_account\"\x94\x01\n#ComputeInstanceDataSourceProperties\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cmachine_type\x18\x03 \x01(\t\x12\x18\n\x10total_disk_count\x18\x04 \x01(\x03\x12\x1a\n\x12total_disk_size_gb\x18\x05 \x01(\x03\"\xa5\x02\n\x17\x41\x64vancedMachineFeatures\x12.\n\x1c\x65nable_nested_virtualization\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\"\n\x10threads_per_core\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12$\n\x12visible_core_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12(\n\x16\x65nable_uefi_networking\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x42\x1f\n\x1d_enable_nested_virtualizationB\x13\n\x11_threads_per_coreB\x15\n\x13_visible_core_countB\x19\n\x17_enable_uefi_networking\"k\n\x1a\x43onfidentialInstanceConfig\x12-\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x1e\n\x1c_enable_confidential_compute\"D\n\rDisplayDevice\x12 \n\x0e\x65nable_display\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x11\n\x0f_enable_display\"\xdd\x01\n\x18NetworkPerformanceConfig\x12j\n\x1btotal_egress_bandwidth_tier\x18\x01 \x01(\x0e\x32;.google.cloud.backupdr.v1beta.NetworkPerformanceConfig.TierB\x03\xe0\x41\x01H\x00\x88\x01\x01\"5\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\n\n\x06TIER_1\x10\x02\x42\x1e\n\x1c_total_egress_bandwidth_tier\"\xb7\x01\n\x0eInstanceParams\x12i\n\x15resource_manager_tags\x18\x01 \x03(\x0b\x32\x45.google.cloud.backupdr.v1beta.InstanceParams.ResourceManagerTagsEntryB\x03\xe0\x41\x01\x1a:\n\x18ResourceManagerTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb9\x03\n\x0eGuestOsFeature\x12K\n\x04type\x18\x01 \x01(\x0e\x32\x38.google.cloud.backupdr.v1beta.GuestOsFeature.FeatureTypeH\x00\x88\x01\x01\"\xd0\x02\n\x0b\x46\x65\x61tureType\x12\x1c\n\x18\x46\x45\x41TURE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16VIRTIO_SCSI_MULTIQUEUE\x10\x01\x12\x0b\n\x07WINDOWS\x10\x02\x12\x13\n\x0fMULTI_IP_SUBNET\x10\x03\x12\x13\n\x0fUEFI_COMPATIBLE\x10\x04\x12\x0f\n\x0bSECURE_BOOT\x10\x05\x12\t\n\x05GVNIC\x10\x06\x12\x0f\n\x0bSEV_CAPABLE\x10\x07\x12\x1f\n\x1b\x42\x41RE_METAL_LINUX_COMPATIBLE\x10\x08\x12\x1d\n\x19SUSPEND_RESUME_COMPATIBLE\x10\t\x12\x17\n\x13SEV_LIVE_MIGRATABLE\x10\n\x12\x13\n\x0fSEV_SNP_CAPABLE\x10\x0b\x12\x0f\n\x0bTDX_CAPABLE\x10\x0c\x12\x08\n\x04IDPF\x10\r\x12\x1a\n\x16SEV_LIVE_MIGRATABLE_V2\x10\x0e\x42\x07\n\x05_type\"\xbf\x02\n\x12\x41llocationAffinity\x12x\n\x17\x63onsume_allocation_type\x18\x01 \x01(\x0e\x32\x35.google.cloud.backupdr.v1beta.AllocationAffinity.TypeB\x03\xe0\x41\x01H\x00R\x16\x63onsumeReservationType\x88\x01\x01\x12\x15\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x13\n\x06values\x18\x03 \x03(\tB\x03\xe0\x41\x01\"_\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eNO_RESERVATION\x10\x01\x12\x13\n\x0f\x41NY_RESERVATION\x10\x02\x12\x18\n\x14SPECIFIC_RESERVATION\x10\x03\x42\x1a\n\x18_consume_allocation_typeB\x06\n\x04_key\"\x87\x01\n\x11\x41\x63\x63\x65leratorConfig\x12\"\n\x10\x61\x63\x63\x65lerator_type\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12#\n\x11\x61\x63\x63\x65lerator_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x13\n\x11_accelerator_typeB\x14\n\x12_accelerator_count\"\xbc\x01\n\x15\x43ustomerEncryptionKey\x12\x16\n\x07raw_key\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12 \n\x11rsa_encrypted_key\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x1b\n\x0ckms_key_name\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12)\n\x17kms_key_service_account\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x05\n\x03keyB\x1a\n\x18_kms_key_service_account\"I\n\x05\x45ntry\x12\x15\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x17\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x06\n\x04_keyB\x08\n\x06_value\"C\n\x08Metadata\x12\x37\n\x05items\x18\x01 \x03(\x0b\x32#.google.cloud.backupdr.v1beta.EntryB\x03\xe0\x41\x01\"\xae\t\n\x10NetworkInterface\x12\x19\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1c\n\nsubnetwork\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12/\n\nip_address\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x02H\x02R\tnetworkIP\x88\x01\x01\x12&\n\x0cipv6_address\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x03H\x03\x88\x01\x01\x12-\n\x1binternal_ipv6_prefix_length\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x16\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03H\x05\x88\x01\x01\x12G\n\x0e\x61\x63\x63\x65ss_configs\x18\x07 \x03(\x0b\x32*.google.cloud.backupdr.v1beta.AccessConfigB\x03\xe0\x41\x01\x12L\n\x13ipv6_access_configs\x18\x08 \x03(\x0b\x32*.google.cloud.backupdr.v1beta.AccessConfigB\x03\xe0\x41\x01\x12H\n\x0f\x61lias_ip_ranges\x18\t \x03(\x0b\x32*.google.cloud.backupdr.v1beta.AliasIpRangeB\x03\xe0\x41\x01\x12Q\n\nstack_type\x18\n \x01(\x0e\x32\x38.google.cloud.backupdr.v1beta.NetworkInterface.StackTypeH\x06\x88\x01\x01\x12\x61\n\x10ipv6_access_type\x18\x0b \x01(\x0e\x32=.google.cloud.backupdr.v1beta.NetworkInterface.Ipv6AccessTypeB\x03\xe0\x41\x01H\x07\x88\x01\x01\x12\x1d\n\x0bqueue_count\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01H\x08\x88\x01\x01\x12R\n\x08nic_type\x18\r \x01(\x0e\x32\x36.google.cloud.backupdr.v1beta.NetworkInterface.NicTypeB\x03\xe0\x41\x01H\t\x88\x01\x01\x12$\n\x12network_attachment\x18\x0e \x01(\tB\x03\xe0\x41\x01H\n\x88\x01\x01\"E\n\tStackType\x12\x1a\n\x16STACK_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIPV4_ONLY\x10\x01\x12\r\n\tIPV4_IPV6\x10\x02\"N\n\x0eIpv6AccessType\x12 \n\x1cUNSPECIFIED_IPV6_ACCESS_TYPE\x10\x00\x12\x0c\n\x08INTERNAL\x10\x01\x12\x0c\n\x08\x45XTERNAL\x10\x02\">\n\x07NicType\x12\x18\n\x14NIC_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nVIRTIO_NET\x10\x01\x12\t\n\x05GVNIC\x10\x02\x42\n\n\x08_networkB\r\n\x0b_subnetworkB\r\n\x0b_ip_addressB\x0f\n\r_ipv6_addressB\x1e\n\x1c_internal_ipv6_prefix_lengthB\x07\n\x05_nameB\r\n\x0b_stack_typeB\x13\n\x11_ipv6_access_typeB\x0e\n\x0c_queue_countB\x0b\n\t_nic_typeB\x15\n\x13_network_attachment\"\xba\x05\n\x0c\x41\x63\x63\x65ssConfig\x12M\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.backupdr.v1beta.AccessConfig.AccessTypeB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x16\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12$\n\x0b\x65xternal_ip\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02R\x05natIP\x88\x01\x01\x12\x1f\n\rexternal_ipv6\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12-\n\x1b\x65xternal_ipv6_prefix_length\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12 \n\x0eset_public_ptr\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12(\n\x16public_ptr_domain_name\x18\x07 \x01(\tB\x03\xe0\x41\x01H\x06\x88\x01\x01\x12V\n\x0cnetwork_tier\x18\x08 \x01(\x0e\x32\x36.google.cloud.backupdr.v1beta.AccessConfig.NetworkTierB\x03\xe0\x41\x01H\x07\x88\x01\x01\"N\n\nAccessType\x12\x1b\n\x17\x41\x43\x43\x45SS_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eONE_TO_ONE_NAT\x10\x01\x12\x0f\n\x0b\x44IRECT_IPV6\x10\x02\"F\n\x0bNetworkTier\x12\x1c\n\x18NETWORK_TIER_UNSPECIFIED\x10\x00\x12\x0b\n\x07PREMIUM\x10\x01\x12\x0c\n\x08STANDARD\x10\x02\x42\x07\n\x05_typeB\x07\n\x05_nameB\x0e\n\x0c_external_ipB\x10\n\x0e_external_ipv6B\x1e\n\x1c_external_ipv6_prefix_lengthB\x11\n\x0f_set_public_ptrB\x19\n\x17_public_ptr_domain_nameB\x0f\n\r_network_tier\"\x84\x01\n\x0c\x41liasIpRange\x12\x1f\n\rip_cidr_range\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\'\n\x15subnetwork_range_name\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x10\n\x0e_ip_cidr_rangeB\x18\n\x16_subnetwork_range_name\"\xf4\t\n\nScheduling\x12\x61\n\x13on_host_maintenance\x18\x01 \x01(\x0e\x32:.google.cloud.backupdr.v1beta.Scheduling.OnHostMaintenanceB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12#\n\x11\x61utomatic_restart\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x1d\n\x0bpreemptible\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12S\n\x0fnode_affinities\x18\x04 \x03(\x0b\x32\x35.google.cloud.backupdr.v1beta.Scheduling.NodeAffinityB\x03\xe0\x41\x01\x12\x1f\n\rmin_node_cpus\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12`\n\x12provisioning_model\x18\x06 \x01(\x0e\x32:.google.cloud.backupdr.v1beta.Scheduling.ProvisioningModelB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12q\n\x1binstance_termination_action\x18\x07 \x01(\x0e\x32\x42.google.cloud.backupdr.v1beta.Scheduling.InstanceTerminationActionB\x03\xe0\x41\x01H\x05\x88\x01\x01\x12^\n\x1alocal_ssd_recovery_timeout\x18\n \x01(\x0b\x32\x30.google.cloud.backupdr.v1beta.SchedulingDurationB\x03\xe0\x41\x01H\x06\x88\x01\x01\x1a\xe5\x01\n\x0cNodeAffinity\x12\x15\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12Z\n\x08operator\x18\x02 \x01(\x0e\x32>.google.cloud.backupdr.v1beta.Scheduling.NodeAffinity.OperatorB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x13\n\x06values\x18\x03 \x03(\tB\x03\xe0\x41\x01\"8\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x06\n\x02IN\x10\x01\x12\n\n\x06NOT_IN\x10\x02\x42\x06\n\x04_keyB\x0b\n\t_operator\"U\n\x11OnHostMaintenance\x12#\n\x1fON_HOST_MAINTENANCE_UNSPECIFIED\x10\x00\x12\r\n\tTERMINATE\x10\x01\x12\x0c\n\x07MIGRATE\x10\xe8\x07\"O\n\x11ProvisioningModel\x12\"\n\x1ePROVISIONING_MODEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x08\n\x04SPOT\x10\x02\"^\n\x19InstanceTerminationAction\x12+\n\'INSTANCE_TERMINATION_ACTION_UNSPECIFIED\x10\x00\x12\n\n\x06\x44\x45LETE\x10\x01\x12\x08\n\x04STOP\x10\x02\x42\x16\n\x14_on_host_maintenanceB\x14\n\x12_automatic_restartB\x0e\n\x0c_preemptibleB\x10\n\x0e_min_node_cpusB\x15\n\x13_provisioning_modelB\x1e\n\x1c_instance_termination_actionB\x1d\n\x1b_local_ssd_recovery_timeout\"^\n\x12SchedulingDuration\x12\x19\n\x07seconds\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x17\n\x05nanos\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\n\n\x08_secondsB\x08\n\x06_nanos\"H\n\x0eServiceAccount\x12\x17\n\x05\x65mail\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x13\n\x06scopes\x18\x02 \x03(\tB\x03\xe0\x41\x01\x42\x08\n\x06_email\"\x1a\n\x04Tags\x12\x12\n\x05items\x18\x01 \x03(\tB\x03\xe0\x41\x01\"\xb1\x0c\n\x0c\x41ttachedDisk\x12`\n\x11initialize_params\x18\x01 \x01(\x0b\x32;.google.cloud.backupdr.v1beta.AttachedDisk.InitializeParamsB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1d\n\x0b\x64\x65vice_name\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x16\n\x04kind\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12Z\n\x14\x64isk_type_deprecated\x18\x06 \x01(\x0e\x32\x33.google.cloud.backupdr.v1beta.AttachedDisk.DiskTypeB\x02\x18\x01H\x03\x88\x01\x01\x12K\n\x04mode\x18\x07 \x01(\x0e\x32\x33.google.cloud.backupdr.v1beta.AttachedDisk.DiskModeB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x18\n\x06source\x18\x08 \x01(\tB\x03\xe0\x41\x01H\x05\x88\x01\x01\x12\x17\n\x05index\x18\t \x01(\x03\x42\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x16\n\x04\x62oot\x18\n \x01(\x08\x42\x03\xe0\x41\x01H\x07\x88\x01\x01\x12\x1d\n\x0b\x61uto_delete\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01H\x08\x88\x01\x01\x12\x14\n\x07license\x18\x0c \x03(\tB\x03\xe0\x41\x01\x12Z\n\x0e\x64isk_interface\x18\r \x01(\x0e\x32\x38.google.cloud.backupdr.v1beta.AttachedDisk.DiskInterfaceB\x03\xe0\x41\x01H\t\x88\x01\x01\x12K\n\x10guest_os_feature\x18\x0e \x03(\x0b\x32,.google.cloud.backupdr.v1beta.GuestOsFeatureB\x03\xe0\x41\x01\x12Z\n\x13\x64isk_encryption_key\x18\x0f \x01(\x0b\x32\x33.google.cloud.backupdr.v1beta.CustomerEncryptionKeyB\x03\xe0\x41\x01H\n\x88\x01\x01\x12\x1e\n\x0c\x64isk_size_gb\x18\x10 \x01(\x03\x42\x03\xe0\x41\x01H\x0b\x88\x01\x01\x12[\n\x0bsaved_state\x18\x11 \x01(\x0e\x32\x39.google.cloud.backupdr.v1beta.AttachedDisk.DiskSavedStateB\x06\xe0\x41\x01\xe0\x41\x03H\x0c\x88\x01\x01\x12\x1e\n\tdisk_type\x18\x12 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x03H\r\x88\x01\x01\x12K\n\x04type\x18\x13 \x01(\x0e\x32\x33.google.cloud.backupdr.v1beta.AttachedDisk.DiskTypeB\x03\xe0\x41\x01H\x0e\x88\x01\x01\x1aY\n\x10InitializeParams\x12\x1b\n\tdisk_name\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1a\n\rreplica_zones\x18\x02 \x03(\tB\x03\xe0\x41\x01\x42\x0c\n\n_disk_name\"B\n\x08\x44iskType\x12\x19\n\x15\x44ISK_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SCRATCH\x10\x01\x12\x0e\n\nPERSISTENT\x10\x02\"P\n\x08\x44iskMode\x12\x19\n\x15\x44ISK_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\n\n\x06LOCKED\x10\x03\"Z\n\rDiskInterface\x12\x1e\n\x1a\x44ISK_INTERFACE_UNSPECIFIED\x10\x00\x12\x08\n\x04SCSI\x10\x01\x12\x08\n\x04NVME\x10\x02\x12\n\n\x06NVDIMM\x10\x03\x12\t\n\x05ISCSI\x10\x04\"A\n\x0e\x44iskSavedState\x12 \n\x1c\x44ISK_SAVED_STATE_UNSPECIFIED\x10\x00\x12\r\n\tPRESERVED\x10\x01\x42\x14\n\x12_initialize_paramsB\x0e\n\x0c_device_nameB\x07\n\x05_kindB\x17\n\x15_disk_type_deprecatedB\x07\n\x05_modeB\t\n\x07_sourceB\x08\n\x06_indexB\x07\n\x05_bootB\x0e\n\x0c_auto_deleteB\x11\n\x0f_disk_interfaceB\x16\n\x14_disk_encryption_keyB\x0f\n\r_disk_size_gbB\x0e\n\x0c_saved_stateB\x0c\n\n_disk_typeB\x07\n\x05_type*Y\n\x17KeyRevocationActionType\x12*\n&KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x08\n\x04STOP\x10\x02\x42\xd7\x01\n com.google.cloud.backupdr.v1betaB\x13\x42\x61\x63kupvaultGceProtoP\x01Z.google.cloud.backupdr.v1beta.BackupConfigInfo.LastBackupStateB\x03\xe0\x41\x03\x12P\n\'last_successful_backup_consistency_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x32\n\x11last_backup_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\"\x80\x01\n\x0fLastBackupState\x12!\n\x1dLAST_BACKUP_STATE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x46IRST_BACKUP_PENDING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x15\n\x11PERMISSION_DENIED\x10\x04\x42\x0f\n\rbackup_config\"\x89\x03\n\x0fGcpBackupConfig\x12<\n\x0b\x62\x61\x63kup_plan\x18\x01 \x01(\tB\'\xfa\x41$\n\"backupdr.googleapis.com/BackupPlan\x12\x1f\n\x17\x62\x61\x63kup_plan_description\x18\x02 \x01(\t\x12S\n\x17\x62\x61\x63kup_plan_association\x18\x03 \x01(\tB2\xfa\x41/\n-backupdr.googleapis.com/BackupPlanAssociation\x12\x19\n\x11\x62\x61\x63kup_plan_rules\x18\x04 \x03(\t\x12!\n\x19\x62\x61\x63kup_plan_revision_name\x18\x05 \x01(\t\x12\x1f\n\x17\x62\x61\x63kup_plan_revision_id\x18\x06 \x01(\t\x12\x63\n\x1e\x61uto_protection_policy_binding\x18\x07 \x01(\tB;\xe0\x41\x03\xfa\x41\x35\n3backupdr.googleapis.com/AutoProtectionPolicyBinding\"\xba\x01\n\x1b\x42\x61\x63kupApplianceBackupConfig\x12\x1d\n\x15\x62\x61\x63kup_appliance_name\x18\x01 \x01(\t\x12\x1b\n\x13\x62\x61\x63kup_appliance_id\x18\x02 \x01(\x03\x12\x0e\n\x06sla_id\x18\x03 \x01(\x03\x12\x18\n\x10\x61pplication_name\x18\x04 \x01(\t\x12\x11\n\thost_name\x18\x05 \x01(\t\x12\x10\n\x08slt_name\x18\x06 \x01(\t\x12\x10\n\x08slp_name\x18\x07 \x01(\t\"\xba\x04\n\x15\x44\x61taSourceGcpResource\x12s\n&compute_instance_datasource_properties\x18\x04 \x01(\x0b\x32\x41.google.cloud.backupdr.v1beta.ComputeInstanceDataSourcePropertiesH\x00\x12{\n(cloud_sql_instance_datasource_properties\x18\x05 \x01(\x0b\x32\x42.google.cloud.backupdr.v1beta.CloudSqlInstanceDataSourcePropertiesB\x03\xe0\x41\x03H\x00\x12w\n&alloy_db_cluster_datasource_properties\x18\x06 \x01(\x0b\x32@.google.cloud.backupdr.v1beta.AlloyDBClusterDataSourcePropertiesB\x03\xe0\x41\x03H\x00\x12\\\n\x1a\x64isk_datasource_properties\x18\x07 \x01(\x0b\x32\x36.google.cloud.backupdr.v1beta.DiskDataSourcePropertiesH\x00\x12\x1d\n\x10gcp_resourcename\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x08location\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\tB\x19\n\x17gcp_resource_properties\"\xb9\x01\n$DataSourceBackupApplianceApplication\x12\x18\n\x10\x61pplication_name\x18\x01 \x01(\t\x12\x18\n\x10\x62\x61\x63kup_appliance\x18\x02 \x01(\t\x12\x14\n\x0c\x61ppliance_id\x18\x03 \x01(\x03\x12\x0c\n\x04type\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x08 \x01(\x03\x12\x10\n\x08hostname\x18\x06 \x01(\t\x12\x0f\n\x07host_id\x18\x07 \x01(\x03\")\n\x0fServiceLockInfo\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xc6\x01\n\x17\x42\x61\x63kupApplianceLockInfo\x12\x12\n\x08job_name\x18\x06 \x01(\tH\x00\x12\x16\n\x0c\x62\x61\x63kup_image\x18\x07 \x01(\tH\x00\x12\x10\n\x06sla_id\x18\x08 \x01(\x03H\x00\x12 \n\x13\x62\x61\x63kup_appliance_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\"\n\x15\x62\x61\x63kup_appliance_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0block_reason\x18\x05 \x01(\tB\x03\xe0\x41\x02\x42\r\n\x0block_source\"\x86\x02\n\nBackupLock\x12[\n\x1a\x62\x61\x63kup_appliance_lock_info\x18\x03 \x01(\x0b\x32\x35.google.cloud.backupdr.v1beta.BackupApplianceLockInfoH\x00\x12O\n\x11service_lock_info\x18\x04 \x01(\x0b\x32-.google.cloud.backupdr.v1beta.ServiceLockInfoB\x03\xe0\x41\x03H\x00\x12\x38\n\x0flock_until_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x42\x10\n\x0e\x43lientLockInfo\"\xb7\x14\n\x06\x42\x61\x63kup\x12p\n\"compute_instance_backup_properties\x18\x13 \x01(\x0b\x32=.google.cloud.backupdr.v1beta.ComputeInstanceBackupPropertiesB\x03\xe0\x41\x03H\x00\x12s\n$cloud_sql_instance_backup_properties\x18\x1a \x01(\x0b\x32>.google.cloud.backupdr.v1beta.CloudSqlInstanceBackupPropertiesB\x03\xe0\x41\x03H\x00\x12p\n\"backup_appliance_backup_properties\x18\x15 \x01(\x0b\x32=.google.cloud.backupdr.v1beta.BackupApplianceBackupPropertiesB\x03\xe0\x41\x03H\x00\x12g\n\x1a\x61lloy_db_backup_properties\x18\x1b \x01(\x0b\x32<.google.cloud.backupdr.v1beta.AlloyDbClusterBackupPropertiesB\x03\xe0\x41\x03H\x00\x12Y\n\x16\x64isk_backup_properties\x18\x1c \x01(\x0b\x32\x32.google.cloud.backupdr.v1beta.DiskBackupPropertiesB\x03\xe0\x41\x03H\x00\x12[\n\x14gcp_backup_plan_info\x18\x16 \x01(\x0b\x32\x36.google.cloud.backupdr.v1beta.Backup.GCPBackupPlanInfoB\x03\xe0\x41\x03H\x01\x12L\n\x0cgcp_resource\x18\x1f \x01(\x0b\x32/.google.cloud.backupdr.v1beta.BackupGcpResourceB\x03\xe0\x41\x03H\x02\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x1d\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x39\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x39\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03H\x05\x88\x01\x01\x12\x45\n\x06labels\x18\x05 \x03(\x0b\x32\x30.google.cloud.backupdr.v1beta.Backup.LabelsEntryB\x03\xe0\x41\x01\x12I\n\x1b\x65nforced_retention_end_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x06\x88\x01\x01\x12t\n\x1c\x62\x61\x63kup_retention_inheritance\x18\x1e \x01(\x0e\x32\x44.google.cloud.backupdr.v1beta.BackupVault.BackupRetentionInheritanceB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12\x39\n\x0b\x65xpire_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x08\x88\x01\x01\x12>\n\x10\x63onsistency_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03H\t\x88\x01\x01\x12\x16\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x01H\n\x88\x01\x01\x12>\n\x05state\x18\x0f \x01(\x0e\x32*.google.cloud.backupdr.v1beta.Backup.StateB\x03\xe0\x41\x03\x12\x44\n\rservice_locks\x18\x11 \x03(\x0b\x32(.google.cloud.backupdr.v1beta.BackupLockB\x03\xe0\x41\x03\x12M\n\x16\x62\x61\x63kup_appliance_locks\x18\x12 \x03(\x0b\x32(.google.cloud.backupdr.v1beta.BackupLockB\x03\xe0\x41\x01\x12I\n\x0b\x62\x61\x63kup_type\x18\x14 \x01(\x0e\x32/.google.cloud.backupdr.v1beta.Backup.BackupTypeB\x03\xe0\x41\x03\x12 \n\x13resource_size_bytes\x18\x17 \x01(\x03\x42\x03\xe0\x41\x03\x12\"\n\rsatisfies_pzs\x18\x18 \x01(\x08\x42\x06\xe0\x41\x03\xe0\x41\x01H\x0b\x88\x01\x01\x12\"\n\rsatisfies_pzi\x18\x19 \x01(\x08\x42\x06\xe0\x41\x03\xe0\x41\x01H\x0c\x88\x01\x01\x12M\n\x10kms_key_versions\x18! \x03(\tB3\xe0\x41\x01\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\xb2\x01\n\x11GCPBackupPlanInfo\x12<\n\x0b\x62\x61\x63kup_plan\x18\x01 \x01(\tB\'\xfa\x41$\n\"backupdr.googleapis.com/BackupPlan\x12\x1b\n\x13\x62\x61\x63kup_plan_rule_id\x18\x02 \x01(\t\x12!\n\x19\x62\x61\x63kup_plan_revision_name\x18\x03 \x01(\t\x12\x1f\n\x17\x62\x61\x63kup_plan_revision_id\x18\x04 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\t\n\x05\x45RROR\x10\x04\x12\r\n\tUPLOADING\x10\x05\"b\n\nBackupType\x12\x1b\n\x17\x42\x41\x43KUP_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSCHEDULED\x10\x01\x12\r\n\tON_DEMAND\x10\x02\x12\x19\n\x15ON_DEMAND_OPERATIONAL\x10\x03:\xa3\x01\xea\x41\x9f\x01\n\x1e\x62\x61\x63kupdr.googleapis.com/Backup\x12lprojects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kupB\x13\n\x11\x62\x61\x63kup_propertiesB\x0b\n\tplan_infoB\x11\n\x0fsource_resourceB\x0e\n\x0c_descriptionB\x0e\n\x0c_create_timeB\x0e\n\x0c_update_timeB\x1e\n\x1c_enforced_retention_end_timeB\x1f\n\x1d_backup_retention_inheritanceB\x0e\n\x0c_expire_timeB\x13\n\x11_consistency_timeB\x07\n\x05_etagB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"\xf8\x01\n\x18\x43reateBackupVaultRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#backupdr.googleapis.com/BackupVault\x12\x1c\n\x0f\x62\x61\x63kup_vault_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x0c\x62\x61\x63kup_vault\x18\x03 \x01(\x0b\x32).google.cloud.backupdr.v1beta.BackupVaultB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xf5\x01\n\x17ListBackupVaultsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#backupdr.googleapis.com/BackupVault\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12@\n\x04view\x18\x06 \x01(\x0e\x32-.google.cloud.backupdr.v1beta.BackupVaultViewB\x03\xe0\x41\x01\"\x8a\x01\n\x18ListBackupVaultsResponse\x12@\n\rbackup_vaults\x18\x01 \x03(\x0b\x32).google.cloud.backupdr.v1beta.BackupVault\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xba\x01\n\x1e\x46\x65tchUsableBackupVaultsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#backupdr.googleapis.com/BackupVault\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x1f\x46\x65tchUsableBackupVaultsResponse\x12@\n\rbackup_vaults\x18\x01 \x03(\x0b\x32).google.cloud.backupdr.v1beta.BackupVault\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x92\x02\n\"FetchBackupsForResourceTypeRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x62\x61\x63kupdr.googleapis.com/Backup\x12\x1a\n\rresource_type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12;\n\x04view\x18\x07 \x01(\x0e\x32(.google.cloud.backupdr.v1beta.BackupViewB\x03\xe0\x41\x01\"u\n#FetchBackupsForResourceTypeResponse\x12\x35\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32$.google.cloud.backupdr.v1beta.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x94\x01\n\x15GetBackupVaultRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#backupdr.googleapis.com/BackupVault\x12@\n\x04view\x18\x02 \x01(\x0e\x32-.google.cloud.backupdr.v1beta.BackupVaultViewB\x03\xe0\x41\x01\"\x95\x02\n\x18UpdateBackupVaultRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x44\n\x0c\x62\x61\x63kup_vault\x18\x02 \x01(\x0b\x32).google.cloud.backupdr.v1beta.BackupVaultB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12,\n\x1f\x66orce_update_access_restriction\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xfc\x01\n\x18\x44\x65leteBackupVaultRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#backupdr.googleapis.com/BackupVault\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12*\n\x1dignore_backup_plan_references\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\"\xb1\x01\n\x16ListDataSourcesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"backupdr.googleapis.com/DataSource\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n\x17ListDataSourcesResponse\x12>\n\x0c\x64\x61ta_sources\x18\x01 \x03(\x0b\x32(.google.cloud.backupdr.v1beta.DataSource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"P\n\x14GetDataSourceRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"backupdr.googleapis.com/DataSource\"\xd0\x01\n\x17UpdateDataSourceRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x42\n\x0b\x64\x61ta_source\x18\x02 \x01(\x0b\x32(.google.cloud.backupdr.v1beta.DataSourceB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe6\x01\n\x12ListBackupsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x62\x61\x63kupdr.googleapis.com/Backup\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12;\n\x04view\x18\x06 \x01(\x0e\x32(.google.cloud.backupdr.v1beta.BackupViewB\x03\xe0\x41\x01\"z\n\x13ListBackupsResponse\x12\x35\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32$.google.cloud.backupdr.v1beta.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x85\x01\n\x10GetBackupRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x62\x61\x63kupdr.googleapis.com/Backup\x12;\n\x04view\x18\x02 \x01(\x0e\x32(.google.cloud.backupdr.v1beta.BackupViewB\x03\xe0\x41\x01\"\xa7\x01\n\x13UpdateBackupRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x06\x62\x61\x63kup\x18\x02 \x01(\x0b\x32$.google.cloud.backupdr.v1beta.BackupB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"l\n\x13\x44\x65leteBackupRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x62\x61\x63kupdr.googleapis.com/Backup\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xf6\x05\n\x14RestoreBackupRequest\x12m\n#compute_instance_target_environment\x18\x03 \x01(\x0b\x32>.google.cloud.backupdr.v1beta.ComputeInstanceTargetEnvironmentH\x00\x12V\n\x17\x64isk_target_environment\x18\x05 \x01(\x0b\x32\x33.google.cloud.backupdr.v1beta.DiskTargetEnvironmentH\x00\x12\x63\n\x1eregion_disk_target_environment\x18\x06 \x01(\x0b\x32\x39.google.cloud.backupdr.v1beta.RegionDiskTargetEnvironmentH\x00\x12m\n#compute_instance_restore_properties\x18\x04 \x01(\x0b\x32>.google.cloud.backupdr.v1beta.ComputeInstanceRestorePropertiesH\x01\x12V\n\x17\x64isk_restore_properties\x18\x07 \x01(\x0b\x32\x33.google.cloud.backupdr.v1beta.DiskRestorePropertiesH\x01\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x62\x61\x63kupdr.googleapis.com/Backup\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12H\n\x1a\x63lear_overrides_field_mask\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x14\n\x12target_environmentB\x15\n\x13instance_propertiesB\x1d\n\x1b_clear_overrides_field_mask\"^\n\x15RestoreBackupResponse\x12\x45\n\x0ftarget_resource\x18\x01 \x01(\x0b\x32,.google.cloud.backupdr.v1beta.TargetResource\"k\n\x0eTargetResource\x12\x41\n\x0cgcp_resource\x18\x01 \x01(\x0b\x32).google.cloud.backupdr.v1beta.GcpResourceH\x00\x42\x16\n\x14target_resource_info\"G\n\x0bGcpResource\x12\x18\n\x10gcp_resourcename\x18\x01 \x01(\t\x12\x10\n\x08location\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\"M\n\x11\x42\x61\x63kupGcpResource\x12\x18\n\x10gcp_resourcename\x18\x01 \x01(\t\x12\x10\n\x08location\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t*Q\n\x11\x42\x61\x63kupConfigState\x12#\n\x1f\x42\x41\x43KUP_CONFIG_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0b\n\x07PASSIVE\x10\x02*V\n\nBackupView\x12\x1b\n\x17\x42\x41\x43KUP_VIEW_UNSPECIFIED\x10\x00\x12\x15\n\x11\x42\x41\x43KUP_VIEW_BASIC\x10\x01\x12\x14\n\x10\x42\x41\x43KUP_VIEW_FULL\x10\x02*m\n\x0f\x42\x61\x63kupVaultView\x12!\n\x1d\x42\x41\x43KUP_VAULT_VIEW_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x42\x41\x43KUP_VAULT_VIEW_BASIC\x10\x01\x12\x1a\n\x16\x42\x41\x43KUP_VAULT_VIEW_FULL\x10\x02\x42\xee\x03\n com.google.cloud.backupdr.v1betaB\x10\x42\x61\x63kupVaultProtoP\x01Z.google.cloud.backupdr.v1beta.BackupConfigInfo.LastBackupStateB\x03\xe0\x41\x03\x12P\n\'last_successful_backup_consistency_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xed\x02\n\x19\x44\x61taSourceGcpResourceInfo\x12y\n\x1d\x63loud_sql_instance_properties\x18\x04 \x01(\x0b\x32K.google.cloud.backupdr.v1beta.CloudSqlInstanceDataSourceReferencePropertiesB\x03\xe0\x41\x03H\x00\x12u\n\x1b\x61lloy_db_cluster_properties\x18\x06 \x01(\x0b\x32I.google.cloud.backupdr.v1beta.AlloyDBClusterDataSourceReferencePropertiesB\x03\xe0\x41\x03H\x00\x12\x1d\n\x10gcp_resourcename\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08location\x18\x03 \x01(\tB\x03\xe0\x41\x03\x42\x15\n\x13resource_properties\"b\n\x1dGetDataSourceReferenceRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+backupdr.googleapis.com/DataSourceReference\"\xc3\x01\n\x1fListDataSourceReferencesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+backupdr.googleapis.com/DataSourceReference\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xa3\x01\n ListDataSourceReferencesResponse\x12Q\n\x16\x64\x61ta_source_references\x18\x01 \x03(\x0b\x32\x31.google.cloud.backupdr.v1beta.DataSourceReference\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xef\x01\n/FetchDataSourceReferencesForResourceTypeRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+backupdr.googleapis.com/DataSourceReference\x12\x1a\n\rresource_type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n0FetchDataSourceReferencesForResourceTypeResponse\x12Q\n\x16\x64\x61ta_source_references\x18\x01 \x03(\x0b\x32\x31.google.cloud.backupdr.v1beta.DataSourceReference\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\tB\xdc\x01\n com.google.cloud.backupdr.v1betaB\x18\x44\x61taSourceReferenceProtoP\x01Z.google.cloud.backupdr.v1beta.ListResourceBackupConfigsRequest\x1a?.google.cloud.backupdr.v1beta.ListResourceBackupConfigsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1beta/{parent=projects/*/locations/*}/resourceBackupConfigs\x1az\xca\x41\x17\x62\x61\x63kupdr.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-backupdr,https://www.googleapis.com/auth/cloud-platformB\xda\x01\n com.google.cloud.backupdr.v1betaB\x16ProtectionSummaryProtoP\x01Z] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # + # Note: This feature should not be used in most cases. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/api/field_behavior.rb b/google-cloud-backupdr-v1beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/api/field_info.rb b/google-cloud-backupdr-v1beta/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/api/launch_stage.rb b/google-cloud-backupdr-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/api/resource.rb b/google-cloud-backupdr-v1beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy.rb new file mode 100644 index 000000000000..24364d9a8b15 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/appliedautoprotectionpolicy.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # AppliedAutoProtectionPolicy is a read-only view of AutoProtectionPolicy + # and AutoProtectionPolicyBinding resources that apply to a given workload + # project. + # @!attribute [rw] name + # @return [::String] + # Identifier. Canonical resource name. + # Format: + # projects/\\{workload-project-number}/locations/\\{location}/appliedAutoProtectionPolicies/\\{id}. + # @!attribute [r] source_binding + # @return [::String] + # Output only. The full resource name of the AutoProtectionPolicyBinding that + # applies the source policy to a scope including this workload project. e.g., + # projects/\\{admin-project}/locations/\\{location}/autoProtectionPolicies/\\{policy_id}/autoProtectionPolicyBindings/\\{binding_id}. + # @!attribute [r] criteria + # @return [::Google::Cloud::BackupDR::V1beta::Criteria] + # Output only. The criteria resources must meet for this rule to apply. From + # AutoProtectionPolicy.criteria. + # @!attribute [r] backup_plan_details + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupPlanDetail>] + # Output only. The set of backup plan configurations, mirroring the + # backup_plan_details from the source AutoProtectionPolicy. Each element + # specifies a backup plan for a given resource type. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp indicating when the binding was last modified. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp indicating when the binding was last created. + # @!attribute [r] binding_evaluation_summary + # @return [::Google::Cloud::BackupDR::V1beta::BindingEvaluationSummary] + # Output only. The summary of the last policy application when the job has + # run. + # @!attribute [r] status + # @return [::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy::State] + # Output only. The status of the applied auto protection policy. + class AppliedAutoProtectionPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the various states an applied auto protection policy can be in. + module State + # State is not specified. + STATE_UNSPECIFIED = 0 + + # The policy is in the process of being applied. + CREATING = 1 + + # The policy has been applied and is active. + ACTIVE = 2 + + # The policy is in the process of being removed. + DELETION_INITIATED = 3 + end + end + + # Request message for listing AppliedAutoProtectionPolicies. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve the list of + # applied policies. Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of applied policies to return in a single + # page. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `ListAppliedAutoProtectionPolicies` call. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters resources listed in the + # response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. An expression that sorts the results in the response. + class ListAppliedAutoProtectionPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListAppliedAutoProtectionPolicies. + # @!attribute [rw] applied_auto_protection_policies + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy>] + # A list of the AppliedAutoProtectionPolicy resources found. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Locations that could not be reached. + class ListAppliedAutoProtectionPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicy.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicy.rb new file mode 100644 index 000000000000..5e5ab3a8042c --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicy.rb @@ -0,0 +1,277 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # An AutoprotectionPolicy is a policy resource designed to automate backup + # management, moving from manual per-resource protection to a bulk approach. + # The policy dynamically discovers and applies a specified backup plan to all + # eligible resources that match its defined scope and criteria. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the AutoprotectionPolicy. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}` + # @!attribute [rw] description + # @return [::String] + # Optional. A description of the policy. + # @!attribute [rw] backup_plan_details + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupPlanDetail>] + # Required. The backup plan details for matching resources. + # @!attribute [rw] criteria + # @return [::Google::Cloud::BackupDR::V1beta::Criteria] + # Required. The criteria for matching resources. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy::State] + # Output only. The current state of the AutoprotectionPolicy. + # @!attribute [rw] etag + # @return [::String] + # Output only. The etag for the policy. + # If this is provided on update, it must match the server's etag, otherwise + # the request will be rejected with an ABORTED error. + # @!attribute [r] binding_summary + # @return [::Google::Cloud::BackupDR::V1beta::BindingSummary] + # Output only. Summary of total count of different containers covered through + # this policy. + # @!attribute [r] policy_evaluation_summary + # @return [::Google::Cloud::BackupDR::V1beta::PolicyEvaluationSummary] + # Output only. Summary of last policy application when job was run per + # workload type. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the policy was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the policy was last updated. + class AutoProtectionPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of an AutoprotectionPolicy. + module State + # The state of the policy is unspecified. + STATE_UNSPECIFIED = 0 + + # The policy is being created. + CREATING = 1 + + # The policy is active and protecting matching resources. + ACTIVE = 2 + + # The policy is being updated. + UPDATING = 3 + + # The policy is being deleted. + DELETING = 4 + end + end + + # BackupPlanDetail defines configuration of protection. + # @!attribute [rw] resource_type + # @return [::String] + # Required. The type of resource that this policy will automatically protect. + # For MVP, `compute.googleapis.com/Instance` and + # `compute.googleapis.com/Disk` are supported. + # @!attribute [rw] backup_plan + # @return [::String] + # Required. The resource name of the BackupPlan to apply to resources that + # match the policy's criteria. This backup plan must be in the same location + # as AutoProtectionPolicy. Format: + # projects/\\{project}/locations/\\{location}/backupPlans/\\{backupPlanId} + class BackupPlanDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Criteria specifies a set of criteria for matching resources. + # @!attribute [rw] matching_conditions + # @return [::Array<::Google::Cloud::BackupDR::V1beta::MatchingCondition>] + # Required. A list of matching conditions that a resource must meet to be + # protected by the policy. + class Criteria + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # MatchingCondition specifies a set of conditions for matching resources. + # @!attribute [rw] label_condition + # @return [::Google::Cloud::BackupDR::V1beta::KeyValuePair] + # Optional. A condition that matches resources based on their labels. + # For MVP, this is limited to a single label match. + class MatchingCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PolicyEvaluationSummary contains the summary of the last run of job that + # applies policy to matching resources. + # @!attribute [r] matching_resource_count + # @return [::Integer] + # Output only. The number of resources that currently match the policy's + # criteria. + # @!attribute [r] protected_resource_count + # @return [::Integer] + # Output only. The number of matching resources that are successfully + # protected. + # @!attribute [r] failed_resource_count + # @return [::Integer] + # Output only. The number of matching resources whose protection failed + # during job run. + class PolicyEvaluationSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BindingSummary contains count of different containers covered through this + # policy. + # @!attribute [r] project_count + # @return [::Integer] + # Output only. Total count of Projects protected with this policy. + class BindingSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # KeyValuePair defines a key-value pair for matching resource labels. + # @!attribute [rw] key + # @return [::String] + # Required. The key of the label to match. + # This must be in the format `{label_key}`. + # The key must match the regex + # Format:`[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + # @!attribute [rw] values + # @return [::Array<::String>] + # Required. The values of the label to match. + # There will be explicit “OR” between values of array. + # Each value must be in the format `{label_value}`. + # The value must match the regex + # Format: `[\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}`. + class KeyValuePair + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating an AutoProtectionPolicy. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this policy will be created. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] auto_protection_policy_id + # @return [::String] + # Required. The ID to use for the policy. + # This will become the final component of the policy's resource name. + # @!attribute [rw] auto_protection_policy + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # Required. The AutoProtectionPolicy resource to create. + class CreateAutoProtectionPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting an AutoProtectionPolicy. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the policy to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + class GetAutoProtectionPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating an AutoProtectionPolicy. + # @!attribute [rw] auto_protection_policy + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy] + # Required. The policy to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # AutoProtectionPolicy resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + class UpdateAutoProtectionPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting an AutoProtectionPolicy. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the policy to delete. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # @!attribute [rw] etag + # @return [::String] + # The current etag of the AutoProtectionPolicy. + # If an etag is provided and does not match the current etag of the + # connection, the request will be rejected with an ABORTED error. + class DeleteAutoProtectionPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListAutoProtectionPolicies. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve the list of + # policies. Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of policies to return in a single page. + # If unspecified, a server-default value will be used. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent + # page. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters resources listed in the + # response. The following fields are filterable: + # @!attribute [rw] order_by + # @return [::String] + # Optional. An expression that sorts the results in the response. The + # following fields are sortable: + class ListAutoProtectionPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListAutoProtectionPolicies. + # @!attribute [rw] auto_protection_policies + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy>] + # A list of the AutoProtectionPolicy resources found. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListAutoProtectionPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicybinding.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicybinding.rb new file mode 100644 index 000000000000..399e457fe4fa --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/autoprotectionpolicybinding.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # An AutoprotectionPolicyBinding (APPA) acts as the bridge between an + # AutoprotectionPolicy and the scope (Project, Folder, or Organization) where + # the policy should be applied. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the AutoProtectionPolicyBinding. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}` + # @!attribute [rw] description + # @return [::String] + # Optional. A description of the binding. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding::State] + # Output only. The current state of the AutoProtectionPolicyBinding. + # @!attribute [rw] scope + # @return [::String] + # Required. Immutable. Resource Id of target container on which policy will + # be applied. Format: projects/\\{project_id} + # @!attribute [r] binding_evaluation_summary + # @return [::Google::Cloud::BackupDR::V1beta::BindingEvaluationSummary] + # Output only. Summaries of the last policy application when the job has run, + # with one entry per resource type specified in the AutoProtectionPolicy. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the binding was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the binding was last updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Output only. The etag for the binding. + # If this is provided on update, it must match the server's etag. + class AutoProtectionPolicyBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of an AutoProtectionPolicyBinding. + module State + # The state of the binding is unspecified. + STATE_UNSPECIFIED = 0 + + # The binding is being created. + CREATING = 1 + + # The binding is active. + ACTIVE = 2 + + # The binding deletion is initiated. + DELETION_INITIATED = 3 + end + end + + # BindingEvaluationSummary contains the summary of the last run of job + # that applies policy to matching resources for a given binding. + # @!attribute [r] matching_resource_count + # @return [::Integer] + # Output only. The number of resources that currently match the policy's + # criteria. + # @!attribute [r] protected_resource_count + # @return [::Integer] + # Output only. The number of matching resources that are successfully + # protected. + # @!attribute [r] failed_resource_count + # @return [::Integer] + # Output only. The number of matching resources whose protection failed + # during job run. + class BindingEvaluationSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating an AutoProtectionPolicyBinding. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this binding will be created. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy} + # @!attribute [rw] auto_protection_policy_binding_id + # @return [::String] + # Required. The ID to use for the binding. + # This will become the final component of the binding's resource name. + # @!attribute [rw] auto_protection_policy_binding + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding] + # Required. The AutoProtectionPolicyBinding resource to create. + class CreateAutoProtectionPolicyBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting an AutoProtectionPolicyBinding. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the binding to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding} + class GetAutoProtectionPolicyBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListAutoProtectionPolicyBindings. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve the list of + # policies. Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of policies to return in a single page. + # If unspecified, a server-default value will be used. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `ListAutoProtectionPolicies` call. Provide this to retrieve the subsequent + # page. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters resources listed in the + # response. The following fields are filterable: + # @!attribute [rw] order_by + # @return [::String] + # Optional. An expression that sorts the results in the response. The + # following fields are sortable: + class ListAutoProtectionPolicyBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListAutoProtectionPolicyBindings. + # @!attribute [rw] auto_protection_policy_bindings + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding>] + # A list of the AutoProtectionPolicyBindings resources found. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Locations that could not be reached. + class ListAutoProtectionPolicyBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for initiating delete of an AutoProtectionPolicyBinding. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the binding to delete. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding} + class InitiateDeleteAutoProtectionPolicyBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupdr.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupdr.rb new file mode 100644 index 000000000000..646fc5a16793 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupdr.rb @@ -0,0 +1,428 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # Network configuration for ManagementServer instance. + # @!attribute [rw] network + # @return [::String] + # Optional. The resource name of the Google Compute Engine VPC network to + # which the ManagementServer instance is connected. + # @!attribute [rw] peering_mode + # @return [::Google::Cloud::BackupDR::V1beta::NetworkConfig::PeeringMode] + # Optional. The network connect mode of the ManagementServer instance. For + # this version, only PRIVATE_SERVICE_ACCESS is supported. + class NetworkConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # VPC peering modes supported by Google Cloud Backup and DR. + module PeeringMode + # Peering mode not set. + PEERING_MODE_UNSPECIFIED = 0 + + # Connect using Private Service Access to the Management Server. Private + # services access provides an IP address range for multiple Google Cloud + # services, including Google Cloud Backup and DR. + PRIVATE_SERVICE_ACCESS = 1 + end + end + + # ManagementURI for the Management Server resource. + # @!attribute [r] web_ui + # @return [::String] + # Output only. The ManagementServer AGM/RD WebUI URL. + # @!attribute [r] api + # @return [::String] + # Output only. The ManagementServer AGM/RD API URL. + class ManagementURI + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ManagementURI depending on the Workforce Identity i.e. either 1p or 3p. + # @!attribute [r] first_party_management_uri + # @return [::String] + # Output only. First party Management URI for Google Identities. + # @!attribute [r] third_party_management_uri + # @return [::String] + # Output only. Third party Management URI for External Identity Providers. + class WorkforceIdentityBasedManagementURI + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # OAuth Client ID depending on the Workforce Identity i.e. either 1p or 3p, + # @!attribute [r] first_party_oauth2_client_id + # @return [::String] + # Output only. First party OAuth Client ID for Google Identities. + # @!attribute [r] third_party_oauth2_client_id + # @return [::String] + # Output only. Third party OAuth Client ID for External Identity Providers. + class WorkforceIdentityBasedOAuth2ClientID + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ManagementServer describes a single BackupDR ManagementServer instance. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the ManagementServer instance (2048 characters + # or less). + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource labels to represent user provided metadata. + # Labels currently defined: + # 1. migrate_from_go= + # If set to true, the MS is created in migration ready mode. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was updated. + # @!attribute [rw] type + # @return [::Google::Cloud::BackupDR::V1beta::ManagementServer::InstanceType] + # Optional. The type of the ManagementServer resource. + # @!attribute [r] management_uri + # @return [::Google::Cloud::BackupDR::V1beta::ManagementURI] + # Output only. The hostname or ip address of the exposed AGM endpoints, used + # by clients to connect to AGM/RD graphical user interface and APIs. + # @!attribute [r] workforce_identity_based_management_uri + # @return [::Google::Cloud::BackupDR::V1beta::WorkforceIdentityBasedManagementURI] + # Output only. The hostnames of the exposed AGM endpoints for both types of + # user i.e. 1p and 3p, used to connect AGM/RM UI. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::ManagementServer::InstanceState] + # Output only. The ManagementServer state. + # @!attribute [rw] networks + # @return [::Array<::Google::Cloud::BackupDR::V1beta::NetworkConfig>] + # Optional. VPC networks to which the ManagementServer instance is connected. + # For this version, only a single network is supported. This field is + # optional if MS is created without PSA + # @!attribute [rw] etag + # @return [::String] + # Optional. Server specified ETag for the ManagementServer resource to + # prevent simultaneous updates from overwiting each other. + # @!attribute [r] oauth2_client_id + # @return [::String] + # Output only. The OAuth 2.0 client id is required to make API calls to the + # Backup and DR instance API of this ManagementServer. This is the value that + # should be provided in the 'aud' field of the OIDC ID Token (see openid + # specification + # https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + # @!attribute [r] workforce_identity_based_oauth2_client_id + # @return [::Google::Cloud::BackupDR::V1beta::WorkforceIdentityBasedOAuth2ClientID] + # Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + # @!attribute [r] ba_proxy_uri + # @return [::Array<::String>] + # Output only. The hostname or ip address of the exposed AGM endpoints, used + # by BAs to connect to BA proxy. + # @!attribute [r] satisfies_pzs + # @return [::Google::Protobuf::BoolValue] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class ManagementServer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Type of backup service resource. + module InstanceType + # Instance type is not mentioned. + INSTANCE_TYPE_UNSPECIFIED = 0 + + # Instance for backup and restore management (i.e., AGM). + BACKUP_RESTORE = 1 + end + + # State of Management server instance. + module InstanceState + # State not set. + INSTANCE_STATE_UNSPECIFIED = 0 + + # The instance is being created. + CREATING = 1 + + # The instance has been created and is fully usable. + READY = 2 + + # The instance configuration is being updated. Certain kinds of updates + # may cause the instance to become unusable while the update is in + # progress. + UPDATING = 3 + + # The instance is being deleted. + DELETING = 4 + + # The instance is being repaired and may be unstable. + REPAIRING = 5 + + # Maintenance is being performed on this instance. + MAINTENANCE = 6 + + # The instance is experiencing an issue and might be unusable. You can get + # further details from the statusMessage field of Instance resource. + ERROR = 7 + end + end + + # Request message for listing management servers. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve management servers + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. + # In Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. To retrieve management servers for all locations, use "-" + # for the + # '\\{location}' value. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results. + class ListManagementServersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing management servers. + # @!attribute [rw] management_servers + # @return [::Array<::Google::Cloud::BackupDR::V1beta::ManagementServer>] + # The list of ManagementServer instances in the project for the specified + # location. + # + # If the '\\{location}' value in the request is "-", the response contains a + # list of instances from all locations. In case any location is unreachable, + # the response will only return management servers in reachable locations and + # the 'unreachable' field will be populated with a list of unreachable + # locations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListManagementServersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a management server instance. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the management server resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/managementServers/\\{resource_name}' + class GetManagementServerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a management server instance. + # @!attribute [rw] parent + # @return [::String] + # Required. The management server project and location in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and DR + # locations map to Google Cloud regions, for example **us-central1**. + # @!attribute [rw] management_server_id + # @return [::String] + # Required. The name of the management server to create. The name must be + # unique for the specified project and location. + # @!attribute [rw] management_server + # @return [::Google::Cloud::BackupDR::V1beta::ManagementServer] + # Required. A [management server + # resource][google.cloud.backupdr.v1.ManagementServer] + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateManagementServerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a management server instance. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteManagementServerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for initializing the service. + # @!attribute [rw] cloud_sql_instance_initialization_config + # @return [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceInitializationConfig] + # Optional. The configuration for initializing a Cloud SQL instance. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the serviceConfig used to initialize the + # service. The location must be the location of the BackupVault. + # Format: `projects/{project_id}/locations/{location}/serviceConfig`. + # @!attribute [rw] resource_type + # @return [::String] + # Required. The resource type to which the default service config will be + # applied. Examples include, "compute.googleapis.com/Instance" and + # "storage.googleapis.com/Bucket". + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] backup_plan_location + # @return [::String] + # Optional. The location where the BackupPlan will be created. This field is + # required for multi-region BackupVaults and is optional for regional + # BackupVaults. It is useful when creating a Backup Vault in a multi-region, + # allowing the BackupPlan to reside in a specific region within that + # multi-region. If this field is not provided, the BackupPlan will be created + # in the same location as specified in the `name` field. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validates the request and returns the result, but does + # not actually run it. + class InitializeServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for initializing the service. + # @!attribute [rw] backup_vault_name + # @return [::String] + # The resource name of the default `BackupVault` created. + # Format: + # `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`. + # @!attribute [rw] backup_plan_name + # @return [::String] + # The resource name of the default `BackupPlan` created. + # Format: + # `projects/{project_id}/locations/{location}/backupPlans/{backup_plan_id}`. + class InitializeServiceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have + # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to 'Code.CANCELLED'. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + # @!attribute [r] additional_info + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. AdditionalInfo contains additional Info related to backup plan + # association resource. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AdditionalInfoEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplan.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplan.rb new file mode 100644 index 000000000000..15761179e512 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplan.rb @@ -0,0 +1,637 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # A `BackupPlan` specifies some common fields, such as `description` as well + # as one or more `BackupRule` messages. Each `BackupRule` has a retention + # policy and defines a schedule by which the system is to perform backup + # workloads. + # @!attribute [rw] disk_backup_plan_properties + # @return [::Google::Cloud::BackupDR::V1beta::DiskBackupPlanProperties] + # Optional. Defines optional properties specific to backups of disk-based + # resources, such as Compute Engine Persistent Disks. This includes + # settings like whether to perform a guest flush. + # + # Note: The following fields are mutually exclusive: `disk_backup_plan_properties`, `compute_instance_backup_plan_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] compute_instance_backup_plan_properties + # @return [::Google::Cloud::BackupDR::V1beta::ComputeInstanceBackupPlanProperties] + # Optional. Defines optional properties specific to backups of compute + # instance based resources, such as Compute Engine Instances. This includes + # settings like whether to perform a guest flush. + # + # Note: The following fields are mutually exclusive: `compute_instance_backup_plan_properties`, `disk_backup_plan_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the `BackupPlan`. + # + # Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the `BackupPlan` resource. + # + # The description allows for additional details about `BackupPlan` and its + # use cases to be provided. An example description is the following: "This + # is a backup plan that performs a daily backup at 6pm and retains data for 3 + # months". The description must be at most 2048 characters. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. This collection of key/value pairs allows for custom labels to be + # supplied by the user. Example, \\{"tag": "Weekly"}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the `BackupPlan` was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the `BackupPlan` was last updated. + # @!attribute [rw] backup_rules + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupRule>] + # Optional. The backup rules for this `BackupPlan`. + # @!attribute [rw] max_custom_on_demand_retention_days + # @return [::Integer] + # Optional. Optional field to configure the maximum number of days for which + # a backup can be retained. This field is only applicable for on-demand + # backups taken with custom retention value. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlan::State] + # Output only. The `State` for the `BackupPlan`. + # @!attribute [rw] resource_type + # @return [::String] + # Required. The resource type to which the `BackupPlan` will be applied. + # Examples include, "compute.googleapis.com/Instance", + # "sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster", + # "compute.googleapis.com/Disk". + # @!attribute [rw] etag + # @return [::String] + # Optional. `etag` is returned from the service in the response. As a user of + # the service, you may provide an etag value in this field to prevent stale + # resources. + # @!attribute [rw] backup_vault + # @return [::String] + # Required. Resource name of backup vault which will be used as storage + # location for backups. Format: + # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupvault} + # @!attribute [r] backup_vault_service_account + # @return [::String] + # Output only. The Google Cloud service account to be used by the BackupVault + # for taking backups. Specify the email address of the Backup Vault Service + # Account. + # @!attribute [rw] log_retention_days + # @return [::Integer] + # Optional. Applicable only for Cloud SQL resource_type. + # + # Configures how long logs will be stored. It is defined in “days”. This + # value should be greater than or equal to minimum enforced log retention + # duration of the backup vault. + # @!attribute [r] supported_resource_types + # @return [::Array<::String>] + # Output only. All resource types to which backupPlan can be applied. + # @!attribute [r] revision_id + # @return [::String] + # Output only. The user friendly revision ID of the `BackupPlanRevision`. + # + # Example: v0, v1, v2, etc. + # @!attribute [r] revision_name + # @return [::String] + # Output only. The resource id of the `BackupPlanRevision`. + # + # Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}` + class BackupPlan + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `State` enumerates the possible states for a `BackupPlan`. + module State + # State not set. + STATE_UNSPECIFIED = 0 + + # The resource is being created. + CREATING = 1 + + # The resource has been created and is fully usable. + ACTIVE = 2 + + # The resource is being deleted. + DELETING = 3 + + # The resource has been created but is not usable. + INACTIVE = 4 + + # The resource is being updated. + UPDATING = 5 + end + end + + # `BackupRule` binds the backup schedule to a retention policy. + # @!attribute [rw] standard_schedule + # @return [::Google::Cloud::BackupDR::V1beta::StandardSchedule] + # Optional. Defines a schedule that runs within the confines of a defined + # window of time. + # @!attribute [rw] rule_id + # @return [::String] + # Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + # unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + # followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + # /[a-z][a-z0-9-]\\{,62}/. + # @!attribute [rw] backup_retention_days + # @return [::Integer] + # Required. Configures the duration for which backup data will be kept. It is + # defined in “days”. The value should be greater than or equal to minimum + # enforced retention of the backup vault. + # + # Minimum value is 1 and maximum value is 36159 for custom retention + # on-demand backup. + # Minimum and maximum values are workload specific for all other rules. + # Note: Longer retention can lead to higher storage costs post introductory + # trial. We recommend starting with a short duration of 3 days or less. + class BackupRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StandardSchedule` defines a schedule that run within the confines of a + # defined window of days. We can define recurrence type for schedule as + # HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY. + # @!attribute [rw] recurrence_type + # @return [::Google::Cloud::BackupDR::V1beta::StandardSchedule::RecurrenceType] + # Required. Specifies the `RecurrenceType` for the schedule. + # @!attribute [rw] hourly_frequency + # @return [::Integer] + # Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + # means jobs will run every 2 hours from start time till end time defined. + # + # This is required for `recurrence_type`, `HOURLY` and is not applicable + # otherwise. A validation error will occur if a value is supplied and + # `recurrence_type` is not `HOURLY`. + # + # The supported values for each resource type are as follows: + # + # * `compute.googleapis.com/Instance`: 1-23 + # * `compute.googleapis.com/Disk`: 1-23 + # * `sqladmin.googleapis.com/Instance`: 6-23 + # * `alloydb.googleapis.com/Cluster`: 1-23 + # * `file.googleapis.com/Instance`: 1-23 + # + # Refer to link + # https://cloud.google.com/backup-disaster-recovery/docs/concepts/cloud_best_practices + # for more details. + # @!attribute [rw] days_of_week + # @return [::Array<::Google::Type::DayOfWeek>] + # Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + # will run. + # + # This is required for `recurrence_type`, `WEEKLY` and is not applicable + # otherwise. A validation error will occur if a value is supplied and + # `recurrence_type` is not `WEEKLY`. + # @!attribute [rw] days_of_month + # @return [::Array<::Integer>] + # Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + # + # Values for `days_of_month` are only applicable for `recurrence_type`, + # `MONTHLY` and `YEARLY`. A validation error will occur if other values are + # supplied. + # @!attribute [rw] week_day_of_month + # @return [::Google::Cloud::BackupDR::V1beta::WeekDayOfMonth] + # Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + # MONDAY, on which jobs will run. This will be specified by two fields in + # `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + # e.g. `LAST`. + # + # This field is only applicable for `recurrence_type`, `MONTHLY` and + # `YEARLY`. A validation error will occur if other values are supplied. + # @!attribute [rw] months + # @return [::Array<::Google::Type::Month>] + # Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + # which jobs will run. + # + # This field is only applicable when `recurrence_type` is `YEARLY`. A + # validation error will occur if other values are supplied. + # @!attribute [rw] backup_window + # @return [::Google::Cloud::BackupDR::V1beta::BackupWindow] + # Required. A BackupWindow defines the window of day during which backup jobs + # will run. Jobs are queued at the beginning of the window and will be marked + # as `NOT_RUN` if they do not start by the end of the window. + # + # Note: running jobs will not be cancelled at the end of the window. + # @!attribute [rw] time_zone + # @return [::String] + # Required. The time zone to be used when interpreting the schedule. + # The value of this field must be a time zone name from the IANA tz database. + # See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + # list of valid timezone names. For e.g., Europe/Paris. + class StandardSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # `RecurrenceTypes` enumerates the applicable periodicity for the schedule. + module RecurrenceType + # recurrence type not set + RECURRENCE_TYPE_UNSPECIFIED = 0 + + # The `BackupRule` is to be applied hourly. + HOURLY = 1 + + # The `BackupRule` is to be applied daily. + DAILY = 2 + + # The `BackupRule` is to be applied weekly. + WEEKLY = 3 + + # The `BackupRule` is to be applied monthly. + MONTHLY = 4 + + # The `BackupRule` is to be applied yearly. + YEARLY = 5 + end + end + + # `BackupWindow` defines a window of the day during which backup jobs will run. + # @!attribute [rw] start_hour_of_day + # @return [::Integer] + # Required. The hour of day (0-23) when the window starts for e.g. if value + # of start hour of day is 6 that mean backup window start at 6:00. + # @!attribute [rw] end_hour_of_day + # @return [::Integer] + # Required. The hour of day (1-24) when the window end for e.g. if value of + # end hour of day is 10 that mean backup window end time is 10:00. + # + # End hour of day should be greater than start hour of day. + # 0 <= start_hour_of_day < end_hour_of_day <= 24 + # + # End hour of day is not include in backup window that mean if + # end_hour_of_day= 10 jobs should start before 10:00. + class BackupWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `WeekDayOfMonth` defines the week day of the month on which the backups will + # run. The message combines a `WeekOfMonth` and `DayOfWeek` to produce values + # like `FIRST`/`MONDAY` or `LAST`/`FRIDAY`. + # @!attribute [rw] week_of_month + # @return [::Google::Cloud::BackupDR::V1beta::WeekDayOfMonth::WeekOfMonth] + # Required. Specifies the week of the month. + # @!attribute [rw] day_of_week + # @return [::Google::Type::DayOfWeek] + # Required. Specifies the day of the week. + class WeekDayOfMonth + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # `WeekOfMonth` enumerates possible weeks in the month, e.g. the first, + # third, or last week of the month. + module WeekOfMonth + # The zero value. Do not use. + WEEK_OF_MONTH_UNSPECIFIED = 0 + + # The first week of the month. + FIRST = 1 + + # The second week of the month. + SECOND = 2 + + # The third week of the month. + THIRD = 3 + + # The fourth week of the month. + FOURTH = 4 + + # The last week of the month. + LAST = 5 + end + end + + # The request message for creating a `BackupPlan`. + # @!attribute [rw] parent + # @return [::String] + # Required. The `BackupPlan` project and location in the format + # `projects/{project}/locations/{location}`. In Google Cloud Backup and DR + # locations map to Google Cloud regions, for example **us-central1**. + # @!attribute [rw] backup_plan_id + # @return [::String] + # Required. The name of the `BackupPlan` to create. The name must be unique + # for the specified project and location.The name must start with a lowercase + # letter followed by up to 62 lowercase letters, numbers, or hyphens. + # Pattern, /[a-z][a-z0-9-]\\{,62}/. + # @!attribute [rw] backup_plan + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # Required. The `BackupPlan` resource object to create. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateBackupPlanRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for getting a list `BackupPlan`. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve `BackupPlans` + # information. Format: `projects/{project}/locations/{location}`. In Google + # Cloud Backup and DR, locations map to Google Cloud regions, for e.g. + # **us-central1**. To retrieve backup plans for all locations, use "-" for + # the + # `{location}` value. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of `BackupPlans` to return in a single + # response. If not specified, a default value will be chosen by the service. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # received from a previous `ListBackupPlans` call. + # Provide this to retrieve the subsequent page in a multi-page list of + # results. When paginating, all other parameters provided to + # `ListBackupPlans` must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. Field match expression used to filter the results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Field by which to sort the results. + class ListBackupPlansRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for getting a list of `BackupPlan`. + # @!attribute [rw] backup_plans + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupPlan>] + # The list of `BackupPlans` in the project for the specified + # location. + # + # If the `{location}` value in the request is "-", the response contains a + # list of resources from all locations. In case any location is unreachable, + # the response will only return backup plans in reachable locations and + # the 'unreachable' field will be populated with a list of unreachable + # locations. + # BackupPlan + # @!attribute [rw] next_page_token + # @return [::String] + # A token which may be sent as + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest#page_token page_token} + # in a subsequent `ListBackupPlans` call to retrieve the next page of + # results. If this field is omitted or empty, then there are no more results + # to return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupPlansResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for getting a `BackupPlan`. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the `BackupPlan` to retrieve. + # + # Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + class GetBackupPlanRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for deleting a `BackupPlan`. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the `BackupPlan` to delete. + # + # Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteBackupPlanRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a backup plan. + # @!attribute [rw] backup_plan + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # Required. The resource being updated + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. + # Field mask is used to specify the fields to be overwritten in the + # BackupPlan resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # Currently, these fields are supported in update: description, schedules, + # retention period, adding and removing Backup Rules. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateBackupPlanRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BackupPlanRevision` represents a snapshot of a `BackupPlan` at a point in + # time. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the `BackupPlanRevision`. + # + # Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + # @!attribute [r] revision_id + # @return [::String] + # Output only. The user friendly revision ID of the `BackupPlanRevision`. + # + # Example: v0, v1, v2, etc. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanRevision::State] + # Output only. Resource State + # @!attribute [rw] backup_plan_snapshot + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlan] + # The Backup Plan being encompassed by this revision. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp that the revision was created. + class BackupPlanRevision + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of the `BackupPlanRevision`. + module State + # State not set. + STATE_UNSPECIFIED = 0 + + # The resource is being created. + CREATING = 1 + + # The resource has been created and is fully usable. + ACTIVE = 2 + + # The resource is being deleted. + DELETING = 3 + + # The resource has been created but is not usable. + INACTIVE = 4 + end + end + + # The request message for getting a `BackupPlanRevision`. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the `BackupPlanRevision` to retrieve. + # + # Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + class GetBackupPlanRevisionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for getting a list of `BackupPlanRevision`. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve + # `BackupPlanRevisions` information. Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for e.g. + # **us-central1**. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of `BackupPlans` to return in a single + # response. If not specified, a default value will be chosen by the service. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse#next_page_token next_page_token} + # received from a previous `ListBackupPlans` call. + # Provide this to retrieve the subsequent page in a multi-page list of + # results. When paginating, all other parameters provided to + # `ListBackupPlans` must match the call that provided the page token. + class ListBackupPlanRevisionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for getting a list of `BackupPlanRevision`. + # @!attribute [rw] backup_plan_revisions + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupPlanRevision>] + # The list of `BackupPlanRevisions` in the project for the specified + # location. + # + # If the `{location}` value in the request is "-", the response contains a + # list of resources from all locations. In case any location is unreachable, + # the response will only return backup plans in reachable locations and + # the 'unreachable' field will be populated with a list of unreachable + # locations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token which may be sent as + # {::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest#page_token page_token} + # in a subsequent `ListBackupPlanRevisions` call to retrieve the next page of + # results. If this field is omitted or empty, then there are no more results + # to return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupPlanRevisionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties for a disk backup plan. + # @!attribute [rw] guest_flush + # @return [::Boolean] + # Optional. Indicates whether to perform a guest flush operation before + # taking a disk backup. When set to false, the system will create + # crash-consistent backups. Default value is false. + class DiskBackupPlanProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties for a compute instance backup plan. + # @!attribute [rw] guest_flush + # @return [::Boolean] + # Optional. Indicates whether to perform a guest flush operation before + # taking a compute backup. When set to false, the system will create + # crash-consistent backups. Default value is false. + class ComputeInstanceBackupPlanProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplanassociation.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplanassociation.rb new file mode 100644 index 000000000000..512793b077f0 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupplanassociation.rb @@ -0,0 +1,423 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # A BackupPlanAssociation represents a single BackupPlanAssociation which + # contains details like workload, backup plan etc + # @!attribute [r] cloud_sql_instance_backup_plan_association_properties + # @return [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceBackupPlanAssociationProperties] + # Output only. Cloud SQL instance's backup plan association properties. + # + # Note: The following fields are mutually exclusive: `cloud_sql_instance_backup_plan_association_properties`, `alloydb_cluster_backup_plan_association_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] alloydb_cluster_backup_plan_association_properties + # @return [::Google::Cloud::BackupDR::V1beta::AlloyDBClusterBackupPlanAssociationProperties] + # Output only. AlloyDB cluster's backup plan association properties. + # + # Note: The following fields are mutually exclusive: `alloydb_cluster_backup_plan_association_properties`, `cloud_sql_instance_backup_plan_association_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of BackupPlanAssociation in + # below format Format : + # projects/\\{project}/locations/\\{location}/backupPlanAssociations/\\{backupPlanAssociationId} + # @!attribute [rw] resource_type + # @return [::String] + # Required. Immutable. Resource type of workload on which backupplan is + # applied + # @!attribute [rw] resource + # @return [::String] + # Required. Immutable. Resource name of workload on which the backup plan is + # applied. + # + # The format can either be the resource name (e.g., + # "projects/my-project/zones/us-central1-a/instances/my-instance") or the + # full resource URI (e.g., + # "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance"). + # @!attribute [rw] backup_plan + # @return [::String] + # Required. Resource name of backup plan which needs to be applied on + # workload. Format: + # projects/\\{project}/locations/\\{location}/backupPlans/\\{backupPlanId} + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was updated. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation::State] + # Output only. The BackupPlanAssociation resource state. + # @!attribute [r] rules_config_info + # @return [::Array<::Google::Cloud::BackupDR::V1beta::RuleConfigInfo>] + # Output only. The config info related to backup rules. + # @!attribute [r] data_source + # @return [::String] + # Output only. Resource name of data source which will be used as storage + # location for backups taken. Format : + # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupvault}/dataSources/\\{datasource} + # @!attribute [r] backup_plan_revision_id + # @return [::String] + # Output only. The user friendly revision ID of the `BackupPlanRevision`. + # + # Example: v0, v1, v2, etc. + # @!attribute [r] backup_plan_revision_name + # @return [::String] + # Output only. The resource id of the `BackupPlanRevision`. + # + # Format: + # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}` + # @!attribute [r] auto_protection_policy_binding + # @return [::String] + # Output only. The resource name of the `AutoProtectionPolicyBinding` that + # manages this association, if any. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{policy}/bindings/{binding}`. + class BackupPlanAssociation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum for State of BackupPlan Association + module State + # State not set. + STATE_UNSPECIFIED = 0 + + # The resource is being created. + CREATING = 1 + + # The resource has been created and is fully usable. + ACTIVE = 2 + + # The resource is being deleted. + DELETING = 3 + + # The resource has been created but is not usable. + INACTIVE = 4 + + # The resource is being updated. + UPDATING = 5 + + # The resource has been created but backups are paused. + PAUSED = 6 + end + end + + # Message for rules config info. + # @!attribute [r] rule_id + # @return [::String] + # Output only. Backup Rule id fetched from backup plan. + # @!attribute [r] last_backup_state + # @return [::Google::Cloud::BackupDR::V1beta::RuleConfigInfo::LastBackupState] + # Output only. The last backup state for rule. + # @!attribute [r] last_backup_error + # @return [::Google::Rpc::Status] + # Output only. google.rpc.Status object to store the last backup error. + # @!attribute [r] last_successful_backup_consistency_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The point in time when the last successful backup was captured + # from the source. + class RuleConfigInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum for LastBackupState + module LastBackupState + # State not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0 + + # The first backup is pending. + FIRST_BACKUP_PENDING = 1 + + # The most recent backup could not be run/failed because of the lack of + # permissions. + PERMISSION_DENIED = 2 + + # The last backup operation succeeded. + SUCCEEDED = 3 + + # The last backup operation failed. + FAILED = 4 + end + end + + # Request message for creating a backup plan. + # @!attribute [rw] parent + # @return [::String] + # Required. The backup plan association project and location in the format + # `projects/{project_id}/locations/{location}`. In Backup and DR locations + # map to Google Cloud regions, for example **us-central1**. + # @!attribute [rw] backup_plan_association_id + # @return [::String] + # Required. The name of the backup plan association to create. The name must + # be unique for the specified project and location. + # @!attribute [rw] backup_plan_association + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateBackupPlanAssociationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for List BackupPlanAssociation + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve backup Plan + # Associations information, in the format + # `projects/{project_id}/locations/{location}`. In Backup and DR, locations + # map to Google Cloud regions, for example **us-central1**. To retrieve + # backup plan associations for all locations, use "-" for the + # `{location}` value. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results + class ListBackupPlanAssociationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for List BackupPlanAssociation + # @!attribute [rw] backup_plan_associations + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # The list of Backup Plan Associations in the project for the specified + # location. + # + # If the `{location}` value in the request is "-", the response contains a + # list of instances from all locations. In case any location is unreachable, + # the response will only return backup plan associations in reachable + # locations and the 'unreachable' field will be populated with a list of + # unreachable locations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupPlanAssociationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the FetchBackupPlanAssociationsForResourceType method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] resource_type + # @return [::String] + # Required. The type of the Google Cloud resource. + # Ex: sql.googleapis.com/Instance + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of BackupPlanAssociations to return. The + # service may return fewer than this value. If unspecified, at most 50 + # BackupPlanAssociations will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous call of + # `FetchBackupPlanAssociationsForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchBackupPlanAssociationsForResourceType` must match + # the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * resource + # * backup_plan + # * state + # * data_source + # * cloud_sql_instance_backup_plan_association_properties.instance_create_time + # @!attribute [rw] order_by + # @return [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + class FetchBackupPlanAssociationsForResourceTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the FetchBackupPlanAssociationsForResourceType method. + # @!attribute [r] backup_plan_associations + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation>] + # Output only. The BackupPlanAssociations from the specified parent. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + class FetchBackupPlanAssociationsForResourceTypeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a BackupPlanAssociation resource. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + class GetBackupPlanAssociationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a backup plan association. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] auto_protection_policy_binding + # @return [::String] + # Optional. This field is exclusively used by Backup and DR's auto-protection + # feature. The resource name of the `AutoProtectionPolicyBinding` that + # triggered the deletion of this association. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{policy}/bindings/{binding}`. + class DeleteBackupPlanAssociationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a backup plan association. + # @!attribute [rw] backup_plan_association + # @return [::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation] + # Required. The resource being updated + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. + # Field mask is used to specify the fields to be overwritten in the + # BackupPlanAssociation resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # Currently backup_plan_association.backup_plan is the only supported field. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateBackupPlanAssociationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for triggering a backup. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backup plan association resource, in the format + # `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + # @!attribute [rw] rule_id + # @return [::String] + # Optional. backup rule_id for which a backup needs to be triggered. + # If not specified, on-demand backup with custom retention will be triggered. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] custom_retention_days + # @return [::Integer] + # Optional. The duration for which backup data will be kept, while taking an + # on-demand backup with custom retention. It is defined in "days". + # It is mutually exclusive with rule_id. This field is required if + # rule_id is not provided. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels to be applied on the backup. + class TriggerBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault.rb new file mode 100644 index 000000000000..75b56e8154d7 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault.rb @@ -0,0 +1,1391 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # Message describing a BackupVault object. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. Name of the backup vault to create. It must have + # the + # format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + # `{backupvault}` cannot be changed after creation. It must be between 3-63 + # characters long and must be unique within the project and location. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the BackupVault instance (2048 characters or + # less). + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource labels to represent user provided metadata. + # No labels currently defined: + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was updated. + # @!attribute [rw] backup_minimum_enforced_retention_duration + # @return [::Google::Protobuf::Duration] + # Required. The default and minimum enforced retention for each backup within + # the backup vault. The enforced retention for each backup can be extended. + # Note: Longer minimum enforced retention period impacts potential storage + # costs post introductory trial. We recommend starting with a short duration + # of 3 days or less. + # @!attribute [rw] backup_retention_inheritance + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault::BackupRetentionInheritance] + # Optional. Setting for how a backup's enforced retention end time is + # inherited. + # @!attribute [r] deletable + # @return [::Boolean] + # Output only. Set to true when there are no backups nested under this + # resource. + # @!attribute [rw] etag + # @return [::String] + # Optional. Server specified ETag for the backup vault resource to + # prevent simultaneous updates from overwiting each other. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault::State] + # Output only. The BackupVault resource instance state. + # @!attribute [rw] effective_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Time after which the BackupVault resource is locked. + # @!attribute [r] backup_count + # @return [::Integer] + # Output only. The number of backups in this backup vault. + # @!attribute [r] service_account + # @return [::String] + # Output only. Service account used by the BackupVault Service for this + # BackupVault. The user should grant this account permissions in their + # workload project to enable the service to run backups and restores there. + # @!attribute [r] total_stored_bytes + # @return [::Integer] + # Output only. Total size of the storage used by all backup resources. + # @!attribute [r] uid + # @return [::String] + # Output only. Immutable after resource creation until resource deletion. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. User annotations. See https://google.aip.dev/128#annotations + # Stores small amounts of arbitrary data. + # @!attribute [rw] access_restriction + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault::AccessRestriction] + # Optional. Restricts access to certain sources and destinations for data + # being sent into, or restored from, the backup vault. Defaults to + # WITHIN_ORGANIZATION if not provided during creation. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault::EncryptionConfig] + # Optional. The encryption config of the backup vault. + class BackupVault + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message describing the EncryptionConfig of backup vault. + # This determines how data within the vault is encrypted at rest. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. The Cloud KMS key name to encrypt backups in this backup vault. + # Must be in the same region as the vault. Some workload backups like + # compute disk backups may use their inherited source key instead. Format: + # projects/\\{project}/locations/\\{location}/keyRings/\\{ring}/cryptoKeys/\\{key} + class EncryptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # How a backup's enforced retention end time is inherited. + module BackupRetentionInheritance + # Inheritance behavior not set. This will default to + # `INHERIT_VAULT_RETENTION`. + BACKUP_RETENTION_INHERITANCE_UNSPECIFIED = 0 + + # The enforced retention end time of a backup will be inherited from the + # backup vault's `backup_minimum_enforced_retention_duration` field. + # + # This is the default behavior. + INHERIT_VAULT_RETENTION = 1 + + # The enforced retention end time of a backup will always match the expire + # time of the backup. + # + # If this is set, the backup's enforced retention end time will be set to + # match the expire time during creation of the backup. When updating, the + # ERET and expire time must be updated together and have the same value. + # Invalid update requests will be rejected by the server. + MATCH_BACKUP_EXPIRE_TIME = 2 + end + + # Holds the state of the backup vault resource. + module State + # State not set. + STATE_UNSPECIFIED = 0 + + # The backup vault is being created. + CREATING = 1 + + # The backup vault has been created and is fully usable. + ACTIVE = 2 + + # The backup vault is being deleted. + DELETING = 3 + + # The backup vault is experiencing an issue and might be unusable. + ERROR = 4 + + # The backup vault is being updated. + UPDATING = 5 + end + + # Holds the access restriction for the backup vault. + module AccessRestriction + # Access restriction not set. If user does not provide any value or pass + # this value, it will be changed to WITHIN_ORGANIZATION. + ACCESS_RESTRICTION_UNSPECIFIED = 0 + + # Access to or from resources outside your current project will be denied. + WITHIN_PROJECT = 1 + + # Access to or from resources outside your current organization will be + # denied. + WITHIN_ORGANIZATION = 2 + + # No access restriction. + UNRESTRICTED = 3 + + # Access to or from resources outside your current organization will be + # denied except for backup appliance. + WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4 + end + end + + # Message describing a DataSource object. + # Datasource object used to represent Datasource details for both admin and + # basic view. + # @!attribute [rw] data_source_gcp_resource + # @return [::Google::Cloud::BackupDR::V1beta::DataSourceGcpResource] + # The backed up resource is a Google Cloud resource. + # The word 'DataSource' was included in the names to indicate that this is + # the representation of the Google Cloud resource used within the + # DataSource object. + # + # Note: The following fields are mutually exclusive: `data_source_gcp_resource`, `data_source_backup_appliance_application`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] data_source_backup_appliance_application + # @return [::Google::Cloud::BackupDR::V1beta::DataSourceBackupApplianceApplication] + # The backed up resource is a backup appliance application. + # + # Note: The following fields are mutually exclusive: `data_source_backup_appliance_application`, `data_source_gcp_resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. Name of the datasource to create. + # It must have the + # format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + # `{datasource}` cannot be changed after creation. It must be between 3-63 + # characters long and must be unique within the backup vault. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::DataSource::State] + # Output only. The DataSource resource instance state. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource labels to represent user provided metadata. + # No labels currently defined: + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was updated. + # @!attribute [rw] backup_count + # @return [::Integer] + # Number of backups in the data source. + # @!attribute [rw] etag + # @return [::String] + # Server specified ETag for the ManagementServer resource to prevent + # simultaneous updates from overwiting each other. + # @!attribute [rw] total_stored_bytes + # @return [::Integer] + # The number of bytes (metadata and data) stored in this datasource. + # @!attribute [r] config_state + # @return [::Google::Cloud::BackupDR::V1beta::BackupConfigState] + # Output only. The backup configuration state. + # @!attribute [r] backup_config_info + # @return [::Google::Cloud::BackupDR::V1beta::BackupConfigInfo] + # Output only. Details of how the resource is configured for backup. + # @!attribute [r] backup_blocked_by_vault_access_restriction + # @return [::Boolean] + # Output only. This field is set to true if the backup is blocked by vault + # access restriction. + class DataSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Holds the state of the data source resource. + module State + # State not set. + STATE_UNSPECIFIED = 0 + + # The data source is being created. + CREATING = 1 + + # The data source has been created and is fully usable. + ACTIVE = 2 + + # The data source is being deleted. + DELETING = 3 + + # The data source is experiencing an issue and might be unusable. + ERROR = 4 + end + end + + # BackupConfigInfo has information about how the resource is configured + # for Backup and about the most recent backup to this vault. + # @!attribute [rw] gcp_backup_config + # @return [::Google::Cloud::BackupDR::V1beta::GcpBackupConfig] + # Configuration for a Google Cloud resource. + # + # Note: The following fields are mutually exclusive: `gcp_backup_config`, `backup_appliance_backup_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] backup_appliance_backup_config + # @return [::Google::Cloud::BackupDR::V1beta::BackupApplianceBackupConfig] + # Configuration for an application backed up by a Backup Appliance. + # + # Note: The following fields are mutually exclusive: `backup_appliance_backup_config`, `gcp_backup_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] last_backup_state + # @return [::Google::Cloud::BackupDR::V1beta::BackupConfigInfo::LastBackupState] + # Output only. The status of the last backup to this BackupVault + # @!attribute [r] last_successful_backup_consistency_time + # @return [::Google::Protobuf::Timestamp] + # Output only. If the last backup were successful, this field has the + # consistency date. + # @!attribute [r] last_backup_error + # @return [::Google::Rpc::Status] + # Output only. If the last backup failed, this field has the error message. + class BackupConfigInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # LastBackupstate tracks whether the last backup was not yet started, + # successful, failed, or could not be run because of the lack of permissions. + module LastBackupState + # Status not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0 + + # The first backup has not yet completed + FIRST_BACKUP_PENDING = 1 + + # The most recent backup was successful + SUCCEEDED = 2 + + # The most recent backup failed + FAILED = 3 + + # The most recent backup could not be run/failed because of the lack of + # permissions + PERMISSION_DENIED = 4 + end + end + + # GcpBackupConfig captures the Backup configuration details for Google Cloud + # resources. All Google Cloud resources regardless of type are protected with + # backup plan associations. + # @!attribute [rw] backup_plan + # @return [::String] + # The name of the backup plan. + # @!attribute [rw] backup_plan_description + # @return [::String] + # The description of the backup plan. + # @!attribute [rw] backup_plan_association + # @return [::String] + # The name of the backup plan association. + # @!attribute [rw] backup_plan_rules + # @return [::Array<::String>] + # The names of the backup plan rules which point to this backupvault + # @!attribute [rw] backup_plan_revision_name + # @return [::String] + # The name of the backup plan revision. + # @!attribute [rw] backup_plan_revision_id + # @return [::String] + # The user friendly id of the backup plan revision. + # E.g. v0, v1 etc. + # @!attribute [r] auto_protection_policy_binding + # @return [::String] + # Output only. The resource name of the `AutoProtectionPolicyBinding` that + # manages this datasource, if any. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{policy}/bindings/{binding}`. + class GcpBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupApplianceBackupConfig captures the backup configuration for + # applications that are protected by Backup Appliances. + # @!attribute [rw] backup_appliance_name + # @return [::String] + # The name of the backup appliance. + # @!attribute [rw] backup_appliance_id + # @return [::Integer] + # The ID of the backup appliance. + # @!attribute [rw] sla_id + # @return [::Integer] + # The ID of the SLA of this application. + # @!attribute [rw] application_name + # @return [::String] + # The name of the application. + # @!attribute [rw] host_name + # @return [::String] + # The name of the host where the application is running. + # @!attribute [rw] slt_name + # @return [::String] + # The name of the SLT associated with the application. + # @!attribute [rw] slp_name + # @return [::String] + # The name of the SLP associated with the application. + class BackupApplianceBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DataSourceGcpResource is used for protected resources that are Google Cloud + # Resources. This name is easeier to understand than GcpResourceDataSource or + # GcpDataSourceResource + # @!attribute [rw] compute_instance_datasource_properties + # @return [::Google::Cloud::BackupDR::V1beta::ComputeInstanceDataSourceProperties] + # ComputeInstanceDataSourceProperties has a subset of Compute Instance + # properties that are useful at the Datasource level. + # + # Note: The following fields are mutually exclusive: `compute_instance_datasource_properties`, `cloud_sql_instance_datasource_properties`, `alloy_db_cluster_datasource_properties`, `disk_datasource_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] cloud_sql_instance_datasource_properties + # @return [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceDataSourceProperties] + # Output only. CloudSqlInstanceDataSourceProperties has a subset of Cloud + # SQL Instance properties that are useful at the Datasource level. + # + # Note: The following fields are mutually exclusive: `cloud_sql_instance_datasource_properties`, `compute_instance_datasource_properties`, `alloy_db_cluster_datasource_properties`, `disk_datasource_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] alloy_db_cluster_datasource_properties + # @return [::Google::Cloud::BackupDR::V1beta::AlloyDBClusterDataSourceProperties] + # Output only. AlloyDBClusterDataSourceProperties has a subset of AlloyDB + # cluster properties that are useful at the Datasource level. Currently + # none of its child properties are auditable. If new auditable properties + # are added, the AUDIT annotation should be added. + # + # Note: The following fields are mutually exclusive: `alloy_db_cluster_datasource_properties`, `compute_instance_datasource_properties`, `cloud_sql_instance_datasource_properties`, `disk_datasource_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disk_datasource_properties + # @return [::Google::Cloud::BackupDR::V1beta::DiskDataSourceProperties] + # DiskDataSourceProperties has a subset of Disk properties that are useful + # at the Datasource level. + # + # Note: The following fields are mutually exclusive: `disk_datasource_properties`, `compute_instance_datasource_properties`, `cloud_sql_instance_datasource_properties`, `alloy_db_cluster_datasource_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] gcp_resourcename + # @return [::String] + # Output only. Full resource pathname URL of the source Google Cloud + # resource. + # @!attribute [rw] location + # @return [::String] + # Location of the resource: //"global"/"unspecified". + # @!attribute [rw] type + # @return [::String] + # The type of the Google Cloud resource. Use the Unified Resource Type, + # eg. compute.googleapis.com/Instance. + class DataSourceGcpResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupApplianceApplication describes a Source Resource when it is an + # application backed up by a BackupAppliance. + # @!attribute [rw] application_name + # @return [::String] + # The name of the Application as known to the Backup Appliance. + # @!attribute [rw] backup_appliance + # @return [::String] + # Appliance name. + # @!attribute [rw] appliance_id + # @return [::Integer] + # Appliance Id of the Backup Appliance. + # @!attribute [rw] type + # @return [::String] + # The type of the application. e.g. VMBackup + # @!attribute [rw] application_id + # @return [::Integer] + # The appid field of the application within the Backup Appliance. + # @!attribute [rw] hostname + # @return [::String] + # Hostname of the host where the application is running. + # @!attribute [rw] host_id + # @return [::Integer] + # Hostid of the application host. + class DataSourceBackupApplianceApplication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ServiceLockInfo represents the details of a lock taken by the service on a + # Backup resource. + # @!attribute [r] operation + # @return [::String] + # Output only. The name of the operation that created this lock. + # The lock will automatically be released when the operation completes. + class ServiceLockInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupApplianceLockInfo contains metadata about the backupappliance that + # created the lock. + # @!attribute [rw] job_name + # @return [::String] + # The job name on the backup/recovery appliance that created this lock. + # + # Note: The following fields are mutually exclusive: `job_name`, `backup_image`, `sla_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] backup_image + # @return [::String] + # The image name that depends on this Backup. + # + # Note: The following fields are mutually exclusive: `backup_image`, `job_name`, `sla_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] sla_id + # @return [::Integer] + # The SLA on the backup/recovery appliance that owns the lock. + # + # Note: The following fields are mutually exclusive: `sla_id`, `job_name`, `backup_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] backup_appliance_id + # @return [::Integer] + # Required. The ID of the backup/recovery appliance that created this lock. + # @!attribute [rw] backup_appliance_name + # @return [::String] + # Required. The name of the backup/recovery appliance that created this lock. + # @!attribute [rw] lock_reason + # @return [::String] + # Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + # value of this string is only meaningful to the client and it is not + # interpreted by the BackupVault service. + class BackupApplianceLockInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupLock represents a single lock on a Backup resource. An unexpired + # lock on a Backup prevents the Backup from being deleted. + # @!attribute [rw] backup_appliance_lock_info + # @return [::Google::Cloud::BackupDR::V1beta::BackupApplianceLockInfo] + # If the client is a backup and recovery appliance, this + # contains metadata about why the lock exists. + # + # Note: The following fields are mutually exclusive: `backup_appliance_lock_info`, `service_lock_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] service_lock_info + # @return [::Google::Cloud::BackupDR::V1beta::ServiceLockInfo] + # Output only. Contains metadata about the lock exist for Google Cloud + # native backups. + # + # Note: The following fields are mutually exclusive: `service_lock_info`, `backup_appliance_lock_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] lock_until_time + # @return [::Google::Protobuf::Timestamp] + # Required. The time after which this lock is not considered valid and will + # no longer protect the Backup from deletion. + class BackupLock + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing a Backup object. + # @!attribute [r] compute_instance_backup_properties + # @return [::Google::Cloud::BackupDR::V1beta::ComputeInstanceBackupProperties] + # Output only. Compute Engine specific backup properties. + # + # Note: The following fields are mutually exclusive: `compute_instance_backup_properties`, `cloud_sql_instance_backup_properties`, `backup_appliance_backup_properties`, `alloy_db_backup_properties`, `disk_backup_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] cloud_sql_instance_backup_properties + # @return [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceBackupProperties] + # Output only. Cloud SQL specific backup properties. + # + # Note: The following fields are mutually exclusive: `cloud_sql_instance_backup_properties`, `compute_instance_backup_properties`, `backup_appliance_backup_properties`, `alloy_db_backup_properties`, `disk_backup_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] backup_appliance_backup_properties + # @return [::Google::Cloud::BackupDR::V1beta::BackupApplianceBackupProperties] + # Output only. Backup Appliance specific backup properties. + # + # Note: The following fields are mutually exclusive: `backup_appliance_backup_properties`, `compute_instance_backup_properties`, `cloud_sql_instance_backup_properties`, `alloy_db_backup_properties`, `disk_backup_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] alloy_db_backup_properties + # @return [::Google::Cloud::BackupDR::V1beta::AlloyDbClusterBackupProperties] + # Output only. AlloyDB specific backup properties. + # + # Note: The following fields are mutually exclusive: `alloy_db_backup_properties`, `compute_instance_backup_properties`, `cloud_sql_instance_backup_properties`, `backup_appliance_backup_properties`, `disk_backup_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] disk_backup_properties + # @return [::Google::Cloud::BackupDR::V1beta::DiskBackupProperties] + # Output only. Disk specific backup properties. + # + # Note: The following fields are mutually exclusive: `disk_backup_properties`, `compute_instance_backup_properties`, `cloud_sql_instance_backup_properties`, `backup_appliance_backup_properties`, `alloy_db_backup_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] gcp_backup_plan_info + # @return [::Google::Cloud::BackupDR::V1beta::Backup::GCPBackupPlanInfo] + # Output only. Configuration for a Google Cloud resource. + # @!attribute [r] gcp_resource + # @return [::Google::Cloud::BackupDR::V1beta::BackupGcpResource] + # Output only. Unique identifier of the GCP resource that is being backed + # up. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. Name of the backup to create. It must have the + # format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + # `{backup}` cannot be changed after creation. It must be between 3-63 + # characters long and must be unique within the datasource. + # @!attribute [r] description + # @return [::String] + # Output only. The description of the Backup instance (2048 characters or + # less). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource labels to represent user provided metadata. + # No labels currently defined. + # @!attribute [rw] enforced_retention_end_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The backup can not be deleted before this time. + # @!attribute [r] backup_retention_inheritance + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault::BackupRetentionInheritance] + # Output only. Setting for how the enforced retention end time is inherited. + # This value is copied from this backup's BackupVault. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Optional. When this backup is automatically expired. + # @!attribute [r] consistency_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The point in time when this backup was captured from the + # source. + # @!attribute [rw] etag + # @return [::String] + # Optional. Server specified ETag to prevent updates from overwriting each + # other. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::Backup::State] + # Output only. The Backup resource instance state. + # @!attribute [r] service_locks + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupLock>] + # Output only. The list of BackupLocks taken by the service to prevent the + # deletion of the backup. + # @!attribute [rw] backup_appliance_locks + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupLock>] + # Optional. The list of BackupLocks taken by the accessor Backup Appliance. + # @!attribute [r] backup_type + # @return [::Google::Cloud::BackupDR::V1beta::Backup::BackupType] + # Output only. Type of the backup, unspecified, scheduled or ondemand. + # @!attribute [r] resource_size_bytes + # @return [::Integer] + # Output only. source resource size in bytes at the time of the backup. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Optional. Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Optional. Output only. Reserved for future use. + # @!attribute [r] kms_key_versions + # @return [::Array<::String>] + # Optional. Output only. The list of KMS key versions used to encrypt the + # backup. + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # GCPBackupPlanInfo captures the plan configuration details of Google Cloud + # resources at the time of backup. + # @!attribute [rw] backup_plan + # @return [::String] + # Resource name of backup plan by which workload is protected at the time + # of the backup. + # Format: + # projects/\\{project}/locations/\\{location}/backupPlans/\\{backupPlanId} + # @!attribute [rw] backup_plan_rule_id + # @return [::String] + # The rule id of the backup plan which triggered this backup in case of + # scheduled backup or used for + # @!attribute [rw] backup_plan_revision_name + # @return [::String] + # Resource name of the backup plan revision which triggered this backup in + # case of scheduled backup or used for on demand backup. + # Format: + # projects/\\{project}/locations/\\{location}/backupPlans/\\{backupPlanId}/revisions/\\{revisionId} + # @!attribute [rw] backup_plan_revision_id + # @return [::String] + # The user friendly id of the backup plan revision which triggered this + # backup in case of scheduled backup or used for on demand backup. + class GCPBackupPlanInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Holds the state of the backup resource. + module State + # State not set. + STATE_UNSPECIFIED = 0 + + # The backup is being created. + CREATING = 1 + + # The backup has been created and is fully usable. + ACTIVE = 2 + + # The backup is being deleted. + DELETING = 3 + + # The backup is experiencing an issue and might be unusable. + ERROR = 4 + + # The backup is being uploaded. + UPLOADING = 5 + end + + # Type of the backup, scheduled or ondemand. + module BackupType + # Backup type is unspecified. + BACKUP_TYPE_UNSPECIFIED = 0 + + # Scheduled backup. + SCHEDULED = 1 + + # On demand backup. + ON_DEMAND = 2 + + # Operational backup. + ON_DEMAND_OPERATIONAL = 3 + end + end + + # Message for creating a BackupVault. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] backup_vault_id + # @return [::String] + # Required. ID of the requesting object + # If auto-generating ID server-side, remove this field and + # backup_vault_id from the method_signature of Create RPC + # @!attribute [rw] backup_vault + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + class CreateBackupVaultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing backupvault stores. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve backupvault stores + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. + # To retrieve backupvault stores for all locations, use "-" for the + # '\\{location}' value. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results. + # @!attribute [rw] view + # @return [::Google::Cloud::BackupDR::V1beta::BackupVaultView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # Vault. + class ListBackupVaultsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing BackupVaults. + # @!attribute [rw] backup_vaults + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # The list of BackupVault instances in the project for the specified + # location. + # + # If the '\\{location}' value in the request is "-", the response contains a + # list of instances from all locations. In case any location is unreachable, + # the response will only return backup vaults in reachable locations and + # the 'unreachable' field will be populated with a list of unreachable + # locations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupVaultsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for fetching usable BackupVaults. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve backupvault stores + # information, in the format 'projects/\\{project_id}/locations/\\{location}'. In + # Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example + # **us-central1**. + # To retrieve backupvault stores for all locations, use "-" for the + # '\\{location}' value. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results. + class FetchUsableBackupVaultsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for fetching usable BackupVaults. + # @!attribute [rw] backup_vaults + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupVault>] + # The list of BackupVault instances in the project for the specified + # location. + # + # If the '\\{location}' value in the request is "-", the response contains a + # list of instances from all locations. In case any location is unreachable, + # the response will only return backup vaults in reachable locations and + # the 'unreachable' field will be populated with a list of unreachable + # locations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class FetchUsableBackupVaultsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the FetchBackupsForResourceType method. + # @!attribute [rw] parent + # @return [::String] + # Required. Datasources are the parent resource for the backups. + # Format: + # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupVaultId}/dataSources/\\{datasourceId} + # @!attribute [rw] resource_type + # @return [::String] + # Required. The type of the GCP resource. + # Ex: sqladmin.googleapis.com/Instance + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of Backups to return. The service may + # return fewer than this value. If unspecified, at most 50 + # Backups will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous call of + # `FetchBackupsForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchBackupsForResourceType` must match + # the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * name + # * state + # * backup_type + # * create_time + # * expire_time + # * enforced_retention_end_time + # * gcp_backup_plan_info.backup_plan + # * cloud_sql_instance_backup_properties.instance_tier + # * cloud_sql_instance_backup_properties.database_installed_version + # @!attribute [rw] order_by + # @return [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + # @!attribute [rw] view + # @return [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. This parameter is used to specify the view of the backup. + # If not specified, the default view is BASIC. + class FetchBackupsForResourceTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the FetchBackupsForResourceType method. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::BackupDR::V1beta::Backup>] + # The Backups from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class FetchBackupsForResourceTypeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a BackupVault. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backupvault store resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}' + # @!attribute [rw] view + # @return [::Google::Cloud::BackupDR::V1beta::BackupVaultView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # Vault + class GetBackupVaultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a BackupVault. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # BackupVault resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @!attribute [rw] backup_vault + # @return [::Google::Cloud::BackupDR::V1beta::BackupVault] + # Required. The resource being updated + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, will not check plan duration against backup vault + # enforcement duration. + # @!attribute [rw] force_update_access_restriction + # @return [::Boolean] + # Optional. If set to true, we will force update access restriction even if + # some non compliant data sources are present. The default is 'false'. + class UpdateBackupVaultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a BackupVault. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, any data source from this backup vault will also + # be deleted. + # @!attribute [rw] etag + # @return [::String] + # The current etag of the backup vault. + # If an etag is provided and does not match the current etag of the + # connection, deletion will be blocked. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Only validate the request, but do not perform mutations. + # The default is 'false'. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If true and the BackupVault is not found, the request will + # succeed but no action will be taken. + # @!attribute [rw] ignore_backup_plan_references + # @return [::Boolean] + # Optional. If set to true, backupvault deletion will proceed even if there + # are backup plans referencing the backupvault. The default is 'false'. + class DeleteBackupVaultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing DataSources. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve data + # sources information, in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and + # DR, locations map to Google Cloud regions, for example + # **us-central1**. + # To retrieve data sources for all locations, use "-" for the + # '\\{location}' value. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results. + class ListDataSourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing DataSources. + # @!attribute [rw] data_sources + # @return [::Array<::Google::Cloud::BackupDR::V1beta::DataSource>] + # The list of DataSource instances in the project for the specified + # location. + # + # If the '\\{location}' value in the request is "-", the response contains a + # list of instances from all locations. In case any location is unreachable, + # the response will only return data sources in reachable locations + # and the 'unreachable' field will be populated with a list of unreachable + # locations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListDataSourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a DataSource instance. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the data source resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}/dataSource/\\{resource_name}' + class GetDataSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a data source instance. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # DataSource resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @!attribute [rw] data_source + # @return [::Google::Cloud::BackupDR::V1beta::DataSource] + # Required. The resource being updated + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. Enable upsert. + class UpdateDataSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing Backups. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve backup + # information, in the format + # 'projects/\\{project_id}/locations/\\{location}'. In Google Cloud Backup and + # DR, locations map to Google Cloud regions, for example + # **us-central1**. + # To retrieve data sources for all locations, use "-" for the + # '\\{location}' value. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results. + # @!attribute [rw] view + # @return [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # resource. + class ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing Backups. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::BackupDR::V1beta::Backup>] + # The list of Backup instances in the project for the specified + # location. + # + # If the '\\{location}' value in the request is "-", the response contains a + # list of instances from all locations. In case any location is unreachable, + # the response will only return data sources in reachable locations + # and the 'unreachable' field will be populated with a list of unreachable + # locations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a Backup. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the data source resource name, in the format + # 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{backupVault}/dataSources/\\{datasource}/backups/\\{backup}' + # @!attribute [rw] view + # @return [::Google::Cloud::BackupDR::V1beta::BackupView] + # Optional. Reserved for future use to provide a BASIC & FULL view of Backup + # resource. + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a Backup. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Backup resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then the request will fail. + # @!attribute [rw] backup + # @return [::Google::Cloud::BackupDR::V1beta::Backup] + # Required. The resource being updated + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Backup. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for restoring from a Backup. + # @!attribute [rw] compute_instance_target_environment + # @return [::Google::Cloud::BackupDR::V1beta::ComputeInstanceTargetEnvironment] + # Compute Engine target environment to be used during restore. + # + # Note: The following fields are mutually exclusive: `compute_instance_target_environment`, `disk_target_environment`, `region_disk_target_environment`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disk_target_environment + # @return [::Google::Cloud::BackupDR::V1beta::DiskTargetEnvironment] + # Disk target environment to be used during restore. + # + # Note: The following fields are mutually exclusive: `disk_target_environment`, `compute_instance_target_environment`, `region_disk_target_environment`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] region_disk_target_environment + # @return [::Google::Cloud::BackupDR::V1beta::RegionDiskTargetEnvironment] + # Region disk target environment to be used during restore. + # + # Note: The following fields are mutually exclusive: `region_disk_target_environment`, `compute_instance_target_environment`, `disk_target_environment`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] compute_instance_restore_properties + # @return [::Google::Cloud::BackupDR::V1beta::ComputeInstanceRestoreProperties] + # Compute Engine instance properties to be overridden during restore. + # + # Note: The following fields are mutually exclusive: `compute_instance_restore_properties`, `disk_restore_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disk_restore_properties + # @return [::Google::Cloud::BackupDR::V1beta::DiskRestoreProperties] + # Disk properties to be overridden during restore. + # + # Note: The following fields are mutually exclusive: `disk_restore_properties`, `compute_instance_restore_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Backup instance, in the format + # 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] clear_overrides_field_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. A field mask used to clear server-side default values + # for fields within the `instance_properties` oneof. + # + # When a field in this mask is cleared, the server will not apply its + # default logic (like inheriting a value from the source) for that field. + # + # The most common current use case is clearing default encryption keys. + # + # Examples of field mask paths: + # - Compute Instance Disks: + # `compute_instance_restore_properties.disks.*.disk_encryption_key` + # - Single Disk: `disk_restore_properties.disk_encryption_key` + class RestoreBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for restoring from a Backup. + # @!attribute [rw] target_resource + # @return [::Google::Cloud::BackupDR::V1beta::TargetResource] + # Details of the target resource created/modified as part of restore. + class RestoreBackupResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of the target resource created/modified as part of restore. + # @!attribute [rw] gcp_resource + # @return [::Google::Cloud::BackupDR::V1beta::GcpResource] + # Details of the native Google Cloud resource created as part of restore. + class TargetResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Minimum details to identify a Google Cloud resource + # @!attribute [rw] gcp_resourcename + # @return [::String] + # Name of the Google Cloud resource. + # @!attribute [rw] location + # @return [::String] + # Location of the resource: //"global"/"unspecified". + # @!attribute [rw] type + # @return [::String] + # Type of the resource. Use the Unified Resource Type, + # eg. compute.googleapis.com/Instance. + class GcpResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Minimum details to identify a Google Cloud resource for a backup. + # @!attribute [rw] gcp_resourcename + # @return [::String] + # Name of the Google Cloud resource. + # @!attribute [rw] location + # @return [::String] + # Location of the resource: //"global"/"unspecified". + # @!attribute [rw] type + # @return [::String] + # Type of the resource. Use the Unified Resource Type, + # eg. compute.googleapis.com/Instance. + class BackupGcpResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backup configuration state. Is the resource configured for backup? + module BackupConfigState + # The possible states of backup configuration. + # Status not set. + BACKUP_CONFIG_STATE_UNSPECIFIED = 0 + + # The data source is actively protected (i.e. there is a + # BackupPlanAssociation or Appliance SLA pointing to it) + ACTIVE = 1 + + # The data source is no longer protected (but may have backups under it) + PASSIVE = 2 + end + + # BackupView contains enum options for Partial and Full view. + module BackupView + # If the value is not set, the default 'FULL' view is used. + BACKUP_VIEW_UNSPECIFIED = 0 + + # Includes basic data about the Backup, but not the full contents. + BACKUP_VIEW_BASIC = 1 + + # Includes all data about the Backup. + # This is the default value (for both ListBackups and GetBackup). + BACKUP_VIEW_FULL = 2 + end + + # BackupVaultView contains enum options for Partial and Full view. + module BackupVaultView + # If the value is not set, the default 'FULL' view is used. + BACKUP_VAULT_VIEW_UNSPECIFIED = 0 + + # Includes basic data about the Backup Vault, but not the full contents. + BACKUP_VAULT_VIEW_BASIC = 1 + + # Includes all data about the Backup Vault. + # This is the default value (for both ListBackupVaults and GetBackupVault). + BACKUP_VAULT_VIEW_FULL = 2 + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_alloydb.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_alloydb.rb new file mode 100644 index 000000000000..4cdacddbb538 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_alloydb.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # AlloyDBClusterDataSourceProperties represents the properties of a + # AlloyDB cluster resource that are stored in the DataSource. + # . + # @!attribute [r] name + # @return [::String] + # Output only. Name of the AlloyDB cluster backed up by the datasource. + # @!attribute [r] pitr_windows + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AlloyDbPitrWindow>] + # Output only. Point in time recovery windows. + # The order is guaranteed to be ascending by start time. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. The cluster UID of the AlloyDB cluster backed up by the + # datasource. + class AlloyDBClusterDataSourceProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AlloyDBClusterDataSourceReferenceProperties represents the properties of an + # AlloyDB cluster that are stored in the DataSourceReference. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the AlloyDB cluster backed up by the datasource. + # Format: + # projects/\\{project}/locations/\\{location}/clusters/\\{cluster} + class AlloyDBClusterDataSourceReferenceProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Point in time recovery window for an AlloyDB cluster. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of the PITR window. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of the PITR window. It is not set if the + # corresponding Backup Plan Association is active. + # @!attribute [r] log_retention_days + # @return [::Integer] + # Output only. Log retention days for the PITR window. + class AlloyDbPitrWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AlloyDbClusterBackupProperties represents AlloyDB cluster + # backup properties. + # . + # @!attribute [rw] description + # @return [::String] + # An optional text description for the backup. + # @!attribute [r] stored_bytes + # @return [::Integer] + # Output only. Storage usage of this particular backup + # @!attribute [r] chain_id + # @return [::String] + # Output only. The chain id of this backup. Backups belonging to the same + # chain are sharing the same chain id. This property is calculated and + # maintained by BackupDR. + # @!attribute [r] database_version + # @return [::String] + # Output only. The PostgreSQL major version of the AlloyDB cluster when the + # backup was taken. + class AlloyDbClusterBackupProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties for an AlloyDB cluster backup plan association. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. The cluster UID of the AlloyDB cluster. + class AlloyDBClusterBackupPlanAssociationProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_ba.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_ba.rb new file mode 100644 index 000000000000..1fcfae6de744 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_ba.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # BackupApplianceBackupProperties represents BackupDR backup appliance's + # properties. + # @!attribute [r] generation_id + # @return [::Integer] + # Output only. The numeric generation ID of the backup (monotonically + # increasing). + # @!attribute [r] finalize_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when this backup object was finalized (if none, + # backup is not finalized). + # @!attribute [rw] recovery_range_start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The earliest timestamp of data available in this Backup. + # @!attribute [rw] recovery_range_end_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The latest timestamp of data available in this Backup. + class BackupApplianceBackupProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_cloudsql.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_cloudsql.rb new file mode 100644 index 000000000000..a386f2848b30 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_cloudsql.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # CloudSqlInstanceDataSourceProperties represents the properties of a + # Cloud SQL resource that are stored in the DataSource. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the Cloud SQL instance backed up by the datasource. + # Format: + # projects/\\{project}/instances/\\{instance} + # @!attribute [r] database_installed_version + # @return [::String] + # Output only. The installed database version of the Cloud SQL instance. + # @!attribute [r] instance_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The instance creation timestamp. + # @!attribute [r] instance_tier + # @return [::String] + # Output only. The tier (or machine type) for this instance. Example: + # `db-custom-1-3840` + class CloudSqlInstanceDataSourceProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CloudSqlInstanceBackupProperties represents Cloud SQL Instance + # Backup properties. + # @!attribute [r] database_installed_version + # @return [::String] + # Output only. The installed database version of the Cloud SQL instance + # when the backup was taken. + # @!attribute [r] final_backup + # @return [::Boolean] + # Output only. Whether the backup is a final backup. + # @!attribute [r] source_instance + # @return [::String] + # Output only. The source instance of the backup. + # Format: + # projects/\\{project}/instances/\\{instance} + # @!attribute [r] instance_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The instance creation timestamp. + # @!attribute [r] instance_tier + # @return [::String] + # Output only. The tier (or machine type) for this instance. Example: + # `db-custom-1-3840` + # @!attribute [r] instance_delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The instance delete timestamp. + class CloudSqlInstanceBackupProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CloudSqlInstanceDataSourceReferenceProperties represents the properties of a + # Cloud SQL resource that are stored in the DataSourceReference. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the Cloud SQL instance backed up by the datasource. + # Format: + # projects/\\{project}/instances/\\{instance} + # @!attribute [r] database_installed_version + # @return [::String] + # Output only. The installed database version of the Cloud SQL instance. + # @!attribute [r] instance_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The instance creation timestamp. + # @!attribute [r] instance_tier + # @return [::String] + # Output only. The tier (or machine type) for this instance. Example: + # `db-custom-1-3840` + class CloudSqlInstanceDataSourceReferenceProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CloudSqlInstanceInitializationConfig contains the configuration for + # initializing a Cloud SQL instance. + # @!attribute [rw] edition + # @return [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceInitializationConfig::Edition] + # Required. The edition of the Cloud SQL instance. + class CloudSqlInstanceInitializationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The edition of the Cloud SQL instance. For details, see + # https://cloud.google.com/sql/docs/editions-intro. + module Edition + # Unspecified edition. + EDITION_UNSPECIFIED = 0 + + # Enterprise edition. + ENTERPRISE = 1 + + # Enterprise Plus edition. + ENTERPRISE_PLUS = 2 + end + end + + # Cloud SQL instance's BPA properties. + # @!attribute [r] instance_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the instance was created. + class CloudSqlInstanceBackupPlanAssociationProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_disk.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_disk.rb new file mode 100644 index 000000000000..c403731329c9 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_disk.rb @@ -0,0 +1,301 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # DiskTargetEnvironment represents the target environment for the disk. + # @!attribute [rw] project + # @return [::String] + # Required. Target project for the disk. + # @!attribute [rw] zone + # @return [::String] + # Required. Target zone for the disk. + # @!attribute [rw] use_project_service_account + # @return [::Boolean] + # Optional. Whether to use the project service account for the disk restore. + class DiskTargetEnvironment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # RegionDiskTargetEnvironment represents the target environment for the disk. + # @!attribute [rw] project + # @return [::String] + # Required. Target project for the disk. + # @!attribute [rw] region + # @return [::String] + # Required. Target region for the disk. + # @!attribute [rw] replica_zones + # @return [::Array<::String>] + # Required. Target URLs of the replica zones for the disk. + # @!attribute [rw] use_project_service_account + # @return [::Boolean] + # Optional. Whether to use the project service account for the disk restore. + class RegionDiskTargetEnvironment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DiskRestoreProperties represents the properties of a Disk restore. + # @!attribute [rw] instance_backup_source + # @return [::Google::Cloud::BackupDR::V1beta::RestoreDiskFromInstanceOptions] + # Options for creating a disk from a source Compute Instance backup. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the disk. + # @!attribute [rw] description + # @return [::String] + # Optional. An optional description of this resource. Provide this property + # when you create the resource. + # @!attribute [rw] size_gb + # @return [::Integer] + # Required. The size of the disk in GB. + # @!attribute [rw] licenses + # @return [::Array<::String>] + # Optional. A list of publicly available licenses that are applicable to this + # backup. This is applicable if the original image had licenses attached, + # e.g. Windows image + # @!attribute [rw] guest_os_feature + # @return [::Array<::Google::Cloud::BackupDR::V1beta::GuestOsFeature>] + # Optional. A list of features to enable in the guest operating system. This + # is applicable only for bootable images. + # @!attribute [rw] disk_encryption_key + # @return [::Google::Cloud::BackupDR::V1beta::CustomerEncryptionKey] + # Optional. Encrypts the disk using a + # customer-supplied encryption key or a customer-managed encryption key. + # @!attribute [rw] physical_block_size_bytes + # @return [::Integer] + # Optional. Physical block size of the persistent disk, in bytes. + # If not present in a request, a default value is used. + # Currently, the supported size is 4096. + # @!attribute [rw] provisioned_iops + # @return [::Integer] + # Optional. Indicates how many IOPS to provision for the disk. This sets the + # number of I/O operations per second that the disk can handle. + # @!attribute [rw] provisioned_throughput + # @return [::Integer] + # Optional. Indicates how much throughput to provision for the disk. This + # sets the number of throughput MB per second that the disk can handle. + # @!attribute [rw] enable_confidential_compute + # @return [::Boolean] + # Optional. Indicates whether this disk is using confidential compute mode. + # Encryption with a Cloud KMS key is required to enable this option. + # @!attribute [rw] storage_pool + # @return [::String] + # Optional. The storage pool in which the new disk is created. You can + # provide this as a partial or full URL to the resource. + # @!attribute [rw] access_mode + # @return [::Google::Cloud::BackupDR::V1beta::DiskRestoreProperties::AccessMode] + # Optional. The access mode of the disk. + # @!attribute [rw] architecture + # @return [::Google::Cloud::BackupDR::V1beta::DiskRestoreProperties::Architecture] + # Optional. The architecture of the source disk. Valid values are + # ARM64 or X86_64. + # @!attribute [rw] resource_policy + # @return [::Array<::String>] + # Optional. Resource policies applied to this disk. + # @!attribute [rw] type + # @return [::String] + # Required. URL of the disk type resource describing which disk type to use + # to create the disk. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels to apply to this disk. These can be modified later using + # setLabels method. Label values can be empty. + # @!attribute [rw] resource_manager_tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource manager tags to be bound to the disk. + class DiskRestoreProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ResourceManagerTagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The supported access modes of the disk. + module AccessMode + # The default AccessMode, means the disk can be attached to single instance + # in RW mode. + READ_WRITE_SINGLE = 0 + + # The AccessMode means the disk can be attached to multiple instances in RW + # mode. + READ_WRITE_MANY = 1 + + # The AccessMode means the disk can be attached to multiple instances in RO + # mode. + READ_ONLY_MANY = 2 + end + + # Architecture of the source disk. + module Architecture + # Default value. This value is unused. + ARCHITECTURE_UNSPECIFIED = 0 + + # Disks with architecture X86_64 + X86_64 = 1 + + # Disks with architecture ARM64 + ARM64 = 2 + end + end + + # Options for creating a disk from a source Compute Instance backup. + # @!attribute [rw] source_device_name + # @return [::String] + # The device name of the disk to restore from the VM backup. + # + # Note: The following fields are mutually exclusive: `source_device_name`, `boot_disk`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] boot_disk + # @return [::Boolean] + # Set to true to restore the boot disk from the instance backup. + # This field should only be set to true if selected. + # + # Note: The following fields are mutually exclusive: `boot_disk`, `source_device_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class RestoreDiskFromInstanceOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DiskBackupProperties represents the properties of a Disk backup. + # @!attribute [rw] description + # @return [::String] + # A description of the source disk. + # @!attribute [rw] licenses + # @return [::Array<::String>] + # A list of publicly available licenses that are applicable to this backup. + # This is applicable if the original image had licenses attached, e.g. + # Windows image. + # @!attribute [rw] guest_os_feature + # @return [::Array<::Google::Cloud::BackupDR::V1beta::GuestOsFeature>] + # A list of guest OS features that are applicable to this backup. + # @!attribute [rw] architecture + # @return [::Google::Cloud::BackupDR::V1beta::DiskBackupProperties::Architecture] + # The architecture of the source disk. Valid values are + # ARM64 or X86_64. + # @!attribute [rw] type + # @return [::String] + # The URL of the type of the disk. + # @!attribute [rw] size_gb + # @return [::Integer] + # Size(in GB) of the source disk. + # @!attribute [rw] region + # @return [::String] + # Region and zone are mutually exclusive fields. + # The URL of the region of the source disk. + # @!attribute [rw] zone + # @return [::String] + # The URL of the Zone where the source disk. + # @!attribute [rw] replica_zones + # @return [::Array<::String>] + # The URL of the Zones where the source disk should be replicated. + # @!attribute [rw] source_disk + # @return [::String] + # The source disk used to create this backup. + # @!attribute [rw] access_mode + # @return [::String] + # The access mode of the source disk. + # @!attribute [rw] provisioned_iops + # @return [::Integer] + # The number of IOPS provisioned for the source disk. + # @!attribute [rw] provisioned_throughput + # @return [::Integer] + # The number of throughput provisioned for the source disk. + # @!attribute [rw] physical_block_size_bytes + # @return [::Integer] + # The physical block size of the source disk. + # @!attribute [rw] enable_confidential_compute + # @return [::Boolean] + # Indicates whether the source disk is using confidential compute mode. + # @!attribute [rw] storage_pool + # @return [::String] + # The storage pool of the source disk. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels of the source disk. + # @!attribute [rw] guest_flush + # @return [::Boolean] + # Optional. Defines if the guest flush is enabled for the source disk. + # Default value is false. + class DiskBackupProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Architecture of the source disk. + module Architecture + # Default value. This value is unused. + ARCHITECTURE_UNSPECIFIED = 0 + + # Disks with architecture X86_64 + X86_64 = 1 + + # Disks with architecture ARM64 + ARM64 = 2 + end + end + + # DiskDataSourceProperties represents the properties of a + # Disk resource that are stored in the DataSource. + # . + # @!attribute [rw] name + # @return [::String] + # Name of the disk backed up by the datasource. + # @!attribute [rw] description + # @return [::String] + # The description of the disk. + # @!attribute [rw] type + # @return [::String] + # The type of the disk. + # @!attribute [rw] size_gb + # @return [::Integer] + # The size of the disk in GB. + class DiskDataSourceProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_gce.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_gce.rb new file mode 100644 index 000000000000..5c3542389751 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/backupvault_gce.rb @@ -0,0 +1,1010 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # ComputeInstanceBackupProperties represents Compute Engine instance backup + # properties. + # @!attribute [rw] description + # @return [::String] + # An optional text description for the instances that are created from these + # properties. + # @!attribute [rw] tags + # @return [::Google::Cloud::BackupDR::V1beta::Tags] + # A list of tags to apply to the instances that are created from these + # properties. The tags identify valid sources or targets for network + # firewalls. The setTags method can modify this list of tags. Each tag within + # the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + # @!attribute [rw] machine_type + # @return [::String] + # The machine type to use for instances that are created from these + # properties. + # @!attribute [rw] can_ip_forward + # @return [::Boolean] + # Enables instances created based on these properties to send packets with + # source IP addresses other than their own and receive packets with + # destination IP addresses other than their own. If these instances will be + # used as an IP gateway or it will be set as the next-hop in a Route + # resource, specify `true`. If unsure, leave this set to `false`. See the + # https://cloud.google.com/vpc/docs/using-routes#canipforward + # documentation for more information. + # @!attribute [rw] network_interface + # @return [::Array<::Google::Cloud::BackupDR::V1beta::NetworkInterface>] + # An array of network access configurations for this interface. + # @!attribute [rw] disk + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AttachedDisk>] + # An array of disks that are associated with the instances that are created + # from these properties. + # @!attribute [rw] metadata + # @return [::Google::Cloud::BackupDR::V1beta::Metadata] + # The metadata key/value pairs to assign to instances that are created from + # these properties. These pairs can consist of custom metadata or predefined + # keys. See https://cloud.google.com/compute/docs/metadata/overview for more + # information. + # @!attribute [rw] service_account + # @return [::Array<::Google::Cloud::BackupDR::V1beta::ServiceAccount>] + # A list of service accounts with specified scopes. Access tokens for these + # service accounts are available to the instances that are created from + # these properties. Use metadata queries to obtain the access tokens for + # these instances. + # @!attribute [rw] scheduling + # @return [::Google::Cloud::BackupDR::V1beta::Scheduling] + # Specifies the scheduling options for the instances that are created from + # these properties. + # @!attribute [rw] guest_accelerator + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AcceleratorConfig>] + # A list of guest accelerator cards' type and count to use for instances + # created from these properties. + # @!attribute [rw] min_cpu_platform + # @return [::String] + # Minimum cpu/platform to be used by instances. The instance may be + # scheduled on the specified or newer cpu/platform. Applicable values are the + # friendly names of CPU platforms, such as + # `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + # For more information, read + # https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + # @!attribute [rw] key_revocation_action_type + # @return [::Google::Cloud::BackupDR::V1beta::KeyRevocationActionType] + # KeyRevocationActionType of the instance. Supported options are "STOP" and + # "NONE". The default value is "NONE" if it is not specified. + # @!attribute [rw] source_instance + # @return [::String] + # The source instance used to create this backup. This can be a partial or + # full URL to the resource. For example, the following are valid values: + # -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + # -projects/project/zones/zone/instances/instance + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels to apply to instances that are created from these properties. + # @!attribute [rw] guest_flush + # @return [::Boolean] + # Optional. Indicates whether to perform a guest flush operation before + # taking a compute backup. When set to false, the system will create + # crash-consistent backups. Default value is false. + class ComputeInstanceBackupProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ComputeInstanceRestoreProperties represents Compute Engine instance + # properties to be overridden during restore. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the compute instance. + # @!attribute [rw] advanced_machine_features + # @return [::Google::Cloud::BackupDR::V1beta::AdvancedMachineFeatures] + # Optional. Controls for advanced machine-related behavior features. + # @!attribute [rw] can_ip_forward + # @return [::Boolean] + # Optional. Allows this instance to send and receive packets with + # non-matching destination or source IPs. + # @!attribute [rw] confidential_instance_config + # @return [::Google::Cloud::BackupDR::V1beta::ConfidentialInstanceConfig] + # Optional. Controls Confidential compute options on the instance + # @!attribute [rw] deletion_protection + # @return [::Boolean] + # Optional. Whether the resource should be protected against deletion. + # @!attribute [rw] description + # @return [::String] + # Optional. An optional description of this resource. Provide this property + # when you create the resource. + # @!attribute [rw] disks + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AttachedDisk>] + # Optional. Array of disks associated with this instance. Persistent disks + # must be created before you can assign them. Source regional persistent + # disks will be restored with default replica zones if not specified. + # @!attribute [rw] display_device + # @return [::Google::Cloud::BackupDR::V1beta::DisplayDevice] + # Optional. Enables display device for the instance. + # @!attribute [rw] guest_accelerators + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AcceleratorConfig>] + # Optional. A list of the type and count of accelerator cards attached to the + # instance. + # @!attribute [rw] hostname + # @return [::String] + # Optional. Specifies the hostname of the instance. The specified hostname + # must be RFC1035 compliant. If hostname is not specified, the default + # hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + # DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + # DNS. + # @!attribute [rw] instance_encryption_key + # @return [::Google::Cloud::BackupDR::V1beta::CustomerEncryptionKey] + # Optional. Encrypts suspended data for an instance with a + # customer-managed encryption key. + # @!attribute [rw] key_revocation_action_type + # @return [::Google::Cloud::BackupDR::V1beta::KeyRevocationActionType] + # Optional. KeyRevocationActionType of the instance. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels to apply to this instance. + # @!attribute [rw] machine_type + # @return [::String] + # Optional. Full or partial URL of the machine type resource to use for this + # instance. + # @!attribute [rw] metadata + # @return [::Google::Cloud::BackupDR::V1beta::Metadata] + # Optional. This includes custom metadata and predefined keys. + # @!attribute [rw] min_cpu_platform + # @return [::String] + # Optional. Minimum CPU platform to use for this instance. + # @!attribute [rw] network_interfaces + # @return [::Array<::Google::Cloud::BackupDR::V1beta::NetworkInterface>] + # Optional. An array of network configurations for this instance. These + # specify how interfaces are configured to interact with other network + # services, such as connecting to the internet. Multiple interfaces are + # supported per instance. Required to restore in different project or region. + # @!attribute [rw] network_performance_config + # @return [::Google::Cloud::BackupDR::V1beta::NetworkPerformanceConfig] + # Optional. Configure network performance such as egress bandwidth tier. + # @!attribute [rw] params + # @return [::Google::Cloud::BackupDR::V1beta::InstanceParams] + # Input only. Additional params passed with the request, but not persisted + # as part of resource payload. + # @!attribute [rw] private_ipv6_google_access + # @return [::Google::Cloud::BackupDR::V1beta::ComputeInstanceRestoreProperties::InstancePrivateIpv6GoogleAccess] + # Optional. The private IPv6 google access type for the VM. + # If not specified, use INHERIT_FROM_SUBNETWORK as default. + # @!attribute [rw] allocation_affinity + # @return [::Google::Cloud::BackupDR::V1beta::AllocationAffinity] + # Optional. Specifies the reservations that this instance can consume from. + # @!attribute [rw] resource_policies + # @return [::Array<::String>] + # Optional. Resource policies applied to this instance. + # By default, no resource policies will be applied. + # @!attribute [rw] scheduling + # @return [::Google::Cloud::BackupDR::V1beta::Scheduling] + # Optional. Sets the scheduling options for this instance. + # @!attribute [rw] service_accounts + # @return [::Array<::Google::Cloud::BackupDR::V1beta::ServiceAccount>] + # Optional. A list of service accounts, with their specified scopes, + # authorized for this instance. Only one service account per VM instance is + # supported. + # @!attribute [rw] tags + # @return [::Google::Cloud::BackupDR::V1beta::Tags] + # Optional. Tags to apply to this instance. Tags are used to identify valid + # sources or targets for network firewalls and are specified by the client + # during instance creation. + class ComputeInstanceRestoreProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The private IPv6 google access type for the VMs. + module InstancePrivateIpv6GoogleAccess + # Default value. This value is unused. + INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0 + + # Each network interface inherits PrivateIpv6GoogleAccess from its + # subnetwork. + INHERIT_FROM_SUBNETWORK = 1 + + # Outbound private IPv6 access from VMs in this subnet to Google services. + # If specified, the subnetwork who is attached to the instance's default + # network interface will be assigned an internal IPv6 prefix if it doesn't + # have before. + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2 + + # Bidirectional private IPv6 access to/from Google services. If + # specified, the subnetwork who is attached to the instance's default + # network interface will be assigned an internal IPv6 prefix if it doesn't + # have before. + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3 + end + end + + # ComputeInstanceTargetEnvironment represents Compute Engine target + # environment to be used during restore. + # @!attribute [rw] project + # @return [::String] + # Required. Target project for the Compute Engine instance. + # @!attribute [rw] zone + # @return [::String] + # Required. The zone of the Compute Engine instance. + # @!attribute [rw] use_project_service_account + # @return [::Boolean] + # Optional. Whether to use the project service account for the Compute Engine + # instance restore. + class ComputeInstanceTargetEnvironment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ComputeInstanceDataSourceProperties represents the properties of a + # ComputeEngine resource that are stored in the DataSource. + # @!attribute [rw] name + # @return [::String] + # Name of the compute instance backed up by the datasource. + # @!attribute [rw] description + # @return [::String] + # The description of the Compute Engine instance. + # @!attribute [rw] machine_type + # @return [::String] + # The machine type of the instance. + # @!attribute [rw] total_disk_count + # @return [::Integer] + # The total number of disks attached to the Instance. + # @!attribute [rw] total_disk_size_gb + # @return [::Integer] + # The sum of all the disk sizes. + class ComputeInstanceDataSourceProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies options for controlling advanced machine features. + # @!attribute [rw] enable_nested_virtualization + # @return [::Boolean] + # Optional. Whether to enable nested virtualization or not (default is + # false). + # @!attribute [rw] threads_per_core + # @return [::Integer] + # Optional. The number of threads per physical core. To disable simultaneous + # multithreading (SMT) set this to 1. If unset, the maximum number + # of threads supported per core by the underlying processor is + # assumed. + # @!attribute [rw] visible_core_count + # @return [::Integer] + # Optional. The number of physical cores to expose to an instance. Multiply + # by the number of threads per core to compute the total number of virtual + # CPUs to expose to the instance. If unset, the number of cores is + # inferred from the instance's nominal CPU count and the underlying + # platform's SMT width. + # @!attribute [rw] enable_uefi_networking + # @return [::Boolean] + # Optional. Whether to enable UEFI networking for instance creation. + class AdvancedMachineFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of Confidential Instance options. + # @!attribute [rw] enable_confidential_compute + # @return [::Boolean] + # Optional. Defines whether the instance should have confidential compute + # enabled. + class ConfidentialInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of Display Device options + # @!attribute [rw] enable_display + # @return [::Boolean] + # Optional. Enables display for the Compute Engine VM + class DisplayDevice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Network performance configuration. + # @!attribute [rw] total_egress_bandwidth_tier + # @return [::Google::Cloud::BackupDR::V1beta::NetworkPerformanceConfig::Tier] + # Optional. The tier of the total egress bandwidth. + class NetworkPerformanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Network performance tier. + module Tier + # This value is unused. + TIER_UNSPECIFIED = 0 + + # Default network performance config. + DEFAULT = 1 + + # Tier 1 network performance config. + TIER_1 = 2 + end + end + + # Additional instance params. + # @!attribute [rw] resource_manager_tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource manager tags to be bound to the instance. + class InstanceParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ResourceManagerTagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Feature type of the Guest OS. + # @!attribute [rw] type + # @return [::Google::Cloud::BackupDR::V1beta::GuestOsFeature::FeatureType] + # The ID of a supported feature. + class GuestOsFeature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # List of the Feature Types. + module FeatureType + # Default value, which is unused. + FEATURE_TYPE_UNSPECIFIED = 0 + + # VIRTIO_SCSI_MULTIQUEUE feature type. + VIRTIO_SCSI_MULTIQUEUE = 1 + + # WINDOWS feature type. + WINDOWS = 2 + + # MULTI_IP_SUBNET feature type. + MULTI_IP_SUBNET = 3 + + # UEFI_COMPATIBLE feature type. + UEFI_COMPATIBLE = 4 + + # SECURE_BOOT feature type. + SECURE_BOOT = 5 + + # GVNIC feature type. + GVNIC = 6 + + # SEV_CAPABLE feature type. + SEV_CAPABLE = 7 + + # BARE_METAL_LINUX_COMPATIBLE feature type. + BARE_METAL_LINUX_COMPATIBLE = 8 + + # SUSPEND_RESUME_COMPATIBLE feature type. + SUSPEND_RESUME_COMPATIBLE = 9 + + # SEV_LIVE_MIGRATABLE feature type. + SEV_LIVE_MIGRATABLE = 10 + + # SEV_SNP_CAPABLE feature type. + SEV_SNP_CAPABLE = 11 + + # TDX_CAPABLE feature type. + TDX_CAPABLE = 12 + + # IDPF feature type. + IDPF = 13 + + # SEV_LIVE_MIGRATABLE_V2 feature type. + SEV_LIVE_MIGRATABLE_V2 = 14 + end + end + + # Specifies the reservations that this instance can consume from. + # @!attribute [rw] consume_allocation_type + # @return [::Google::Cloud::BackupDR::V1beta::AllocationAffinity::Type] + # Optional. Specifies the type of reservation from which this instance can + # consume + # @!attribute [rw] key + # @return [::String] + # Optional. Corresponds to the label key of a reservation resource. + # @!attribute [rw] values + # @return [::Array<::String>] + # Optional. Corresponds to the label values of a reservation resource. + class AllocationAffinity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates whether to consume from a reservation or not. + module Type + # Default value. This value is unused. + TYPE_UNSPECIFIED = 0 + + # Do not consume from any allocated capacity. + NO_RESERVATION = 1 + + # Consume any allocation available. + ANY_RESERVATION = 2 + + # Must consume from a specific reservation. Must specify key value fields + # for specifying the reservations. + SPECIFIC_RESERVATION = 3 + end + end + + # A specification of the type and number of accelerator cards attached to the + # instance. + # @!attribute [rw] accelerator_type + # @return [::String] + # Optional. Full or partial URL of the accelerator type resource to attach to + # this instance. + # @!attribute [rw] accelerator_count + # @return [::Integer] + # Optional. The number of the guest accelerator cards exposed to this + # instance. + class AcceleratorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A customer-supplied encryption key. + # @!attribute [rw] raw_key + # @return [::String] + # Optional. Specifies a 256-bit customer-supplied + # encryption key. + # + # Note: The following fields are mutually exclusive: `raw_key`, `rsa_encrypted_key`, `kms_key_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] rsa_encrypted_key + # @return [::String] + # Optional. RSA-wrapped 2048-bit + # customer-supplied encryption key to either encrypt or decrypt this + # resource. + # + # Note: The following fields are mutually exclusive: `rsa_encrypted_key`, `raw_key`, `kms_key_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. The name of the encryption key that is stored in Google Cloud + # KMS. + # + # Note: The following fields are mutually exclusive: `kms_key_name`, `raw_key`, `rsa_encrypted_key`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] kms_key_service_account + # @return [::String] + # Optional. The service account being used for the encryption request for the + # given KMS key. If absent, the Compute Engine default service account is + # used. + class CustomerEncryptionKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A key/value pair to be used for storing metadata. + # @!attribute [rw] key + # @return [::String] + # Optional. Key for the metadata entry. + # @!attribute [rw] value + # @return [::String] + # Optional. Value for the metadata entry. These are free-form strings, and + # only have meaning as interpreted by the image running in the instance. The + # only restriction placed on values is that their size must be less than + # or equal to 262144 bytes (256 KiB). + class Entry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A metadata key/value entry. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::BackupDR::V1beta::Entry>] + # Optional. Array of key/value pairs. The total size of all keys and values + # must be less than 512 KB. + class Metadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A network interface resource attached to an instance. + # s + # @!attribute [rw] network + # @return [::String] + # Optional. URL of the VPC network resource for this instance. + # @!attribute [rw] subnetwork + # @return [::String] + # Optional. The URL of the Subnetwork resource for this instance. + # @!attribute [rw] ip_address + # @return [::String] + # Optional. An IPv4 internal IP address to assign to the instance for this + # network interface. If not specified by the user, an unused internal IP is + # assigned by the system. + # @!attribute [rw] ipv6_address + # @return [::String] + # Optional. An IPv6 internal network address for this network interface. To + # use a static internal IP address, it must be unused and in the same region + # as the instance's zone. If not specified, Google Cloud will automatically + # assign an internal IPv6 address from the instance's subnetwork. + # @!attribute [rw] internal_ipv6_prefix_length + # @return [::Integer] + # Optional. The prefix length of the primary internal IPv6 range. + # @!attribute [r] name + # @return [::String] + # Output only. [Output Only] The name of the network interface, which is + # generated by the server. + # @!attribute [rw] access_configs + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AccessConfig>] + # Optional. An array of configurations for this interface. Currently, only + # one access config,ONE_TO_ONE_NAT is supported. If there are no + # accessConfigs specified, then this instance will have + # no external internet access. + # @!attribute [rw] ipv6_access_configs + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AccessConfig>] + # Optional. An array of IPv6 access configurations for this interface. + # Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + # is no ipv6AccessConfig specified, then this instance will + # have no external IPv6 Internet access. + # @!attribute [rw] alias_ip_ranges + # @return [::Array<::Google::Cloud::BackupDR::V1beta::AliasIpRange>] + # Optional. An array of alias IP ranges for this network interface. + # You can only specify this field for network interfaces in VPC networks. + # @!attribute [rw] stack_type + # @return [::Google::Cloud::BackupDR::V1beta::NetworkInterface::StackType] + # The stack type for this network interface. + # @!attribute [rw] ipv6_access_type + # @return [::Google::Cloud::BackupDR::V1beta::NetworkInterface::Ipv6AccessType] + # Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + # IP can be accessed from the Internet. This field is always inherited from + # its subnetwork. + # @!attribute [rw] queue_count + # @return [::Integer] + # Optional. The networking queue count that's specified by users for the + # network interface. Both Rx and Tx queues will be set to this number. It'll + # be empty if not specified by the users. + # @!attribute [rw] nic_type + # @return [::Google::Cloud::BackupDR::V1beta::NetworkInterface::NicType] + # Optional. The type of vNIC to be used on this interface. This may be gVNIC + # or VirtioNet. + # @!attribute [rw] network_attachment + # @return [::String] + # Optional. The URL of the network attachment that this interface should + # connect to in the following format: + # projects/\\{project_number}/regions/\\{region_name}/networkAttachments/\\{network_attachment_name}. + class NetworkInterface + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Stack type for this network interface. + module StackType + # Default should be STACK_TYPE_UNSPECIFIED. + STACK_TYPE_UNSPECIFIED = 0 + + # The network interface will be assigned IPv4 address. + IPV4_ONLY = 1 + + # The network interface can have both IPv4 and IPv6 addresses. + IPV4_IPV6 = 2 + end + + # IPv6 access type for this network interface. + module Ipv6AccessType + # IPv6 access type not set. Means this network interface hasn't been + # turned on IPv6 yet. + UNSPECIFIED_IPV6_ACCESS_TYPE = 0 + + # This network interface can have internal IPv6. + INTERNAL = 1 + + # This network interface can have external IPv6. + EXTERNAL = 2 + end + + # Nic type for this network interface. + module NicType + # Default should be NIC_TYPE_UNSPECIFIED. + NIC_TYPE_UNSPECIFIED = 0 + + # VIRTIO + VIRTIO_NET = 1 + + # GVNIC + GVNIC = 2 + end + end + + # An access configuration attached to an instance's network interface. + # Only one access config per instance is supported. + # @!attribute [rw] type + # @return [::Google::Cloud::BackupDR::V1beta::AccessConfig::AccessType] + # Optional. In accessConfigs (IPv4), the + # default and only option is ONE_TO_ONE_NAT. In + # ipv6AccessConfigs, the default and only option is + # DIRECT_IPV6. + # @!attribute [rw] name + # @return [::String] + # Optional. The name of this access configuration. + # @!attribute [rw] external_ip + # @return [::String] + # Optional. The external IP address of this access configuration. + # @!attribute [rw] external_ipv6 + # @return [::String] + # Optional. The external IPv6 address of this access configuration. + # @!attribute [rw] external_ipv6_prefix_length + # @return [::Integer] + # Optional. The prefix length of the external IPv6 range. + # @!attribute [rw] set_public_ptr + # @return [::Boolean] + # Optional. Specifies whether a public DNS 'PTR' record should be created to + # map the external IP address of the instance to a DNS domain name. + # @!attribute [rw] public_ptr_domain_name + # @return [::String] + # Optional. The DNS domain name for the public PTR record. + # @!attribute [rw] network_tier + # @return [::Google::Cloud::BackupDR::V1beta::AccessConfig::NetworkTier] + # Optional. This signifies the networking tier used for configuring this + # access + class AccessConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of configuration. + module AccessType + # Default value. This value is unused. + ACCESS_TYPE_UNSPECIFIED = 0 + + # ONE_TO_ONE_NAT + ONE_TO_ONE_NAT = 1 + + # Direct IPv6 access. + DIRECT_IPV6 = 2 + end + + # Network tier property used by addresses, instances and forwarding rules. + module NetworkTier + # Default value. This value is unused. + NETWORK_TIER_UNSPECIFIED = 0 + + # High quality, Google-grade network tier, support for all networking + # products. + PREMIUM = 1 + + # Public internet quality, only limited support for other networking + # products. + STANDARD = 2 + end + end + + # An alias IP range attached to an instance's network interface. + # @!attribute [rw] ip_cidr_range + # @return [::String] + # Optional. The IP alias ranges to allocate for this interface. + # @!attribute [rw] subnetwork_range_name + # @return [::String] + # Optional. The name of a subnetwork secondary IP range from which to + # allocate an IP alias range. If not specified, the primary range of the + # subnetwork is used. + class AliasIpRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sets the scheduling options for an Instance. + # @!attribute [rw] on_host_maintenance + # @return [::Google::Cloud::BackupDR::V1beta::Scheduling::OnHostMaintenance] + # Optional. Defines the maintenance behavior for this instance. + # @!attribute [rw] automatic_restart + # @return [::Boolean] + # Optional. Specifies whether the instance should be automatically restarted + # if it is terminated by Compute Engine (not terminated by a user). + # @!attribute [rw] preemptible + # @return [::Boolean] + # Optional. Defines whether the instance is preemptible. + # @!attribute [rw] node_affinities + # @return [::Array<::Google::Cloud::BackupDR::V1beta::Scheduling::NodeAffinity>] + # Optional. A set of node affinity and anti-affinity configurations. + # Overrides reservationAffinity. + # @!attribute [rw] min_node_cpus + # @return [::Integer] + # Optional. The minimum number of virtual CPUs this instance will consume + # when running on a sole-tenant node. + # @!attribute [rw] provisioning_model + # @return [::Google::Cloud::BackupDR::V1beta::Scheduling::ProvisioningModel] + # Optional. Specifies the provisioning model of the instance. + # @!attribute [rw] instance_termination_action + # @return [::Google::Cloud::BackupDR::V1beta::Scheduling::InstanceTerminationAction] + # Optional. Specifies the termination action for the instance. + # @!attribute [rw] local_ssd_recovery_timeout + # @return [::Google::Cloud::BackupDR::V1beta::SchedulingDuration] + # Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + # while recovery of the Local Ssd state is attempted. Its value should be in + # between 0 and 168 hours with hour granularity and the default value being 1 + # hour. + class Scheduling + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Node Affinity: the configuration of desired nodes onto which this Instance + # could be scheduled. + # @!attribute [rw] key + # @return [::String] + # Optional. Corresponds to the label key of Node resource. + # @!attribute [rw] operator + # @return [::Google::Cloud::BackupDR::V1beta::Scheduling::NodeAffinity::Operator] + # Optional. Defines the operation of node selection. + # @!attribute [rw] values + # @return [::Array<::String>] + # Optional. Corresponds to the label values of Node resource. + class NodeAffinity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines the type of node selections. + module Operator + # Default value. This value is unused. + OPERATOR_UNSPECIFIED = 0 + + # Requires Compute Engine to seek for matched nodes. + IN = 1 + + # Requires Compute Engine to avoid certain nodes. + NOT_IN = 2 + end + end + + # Defines the maintenance behavior for this instance= + module OnHostMaintenance + # Default value. This value is unused. + ON_HOST_MAINTENANCE_UNSPECIFIED = 0 + + # Tells Compute Engine to terminate and (optionally) restart the instance + # away from the maintenance activity. + TERMINATE = 1 + + # Default, Allows Compute Engine to automatically migrate instances + # out of the way of maintenance events. + MIGRATE = 1000 + end + + # Defines the provisioning model for an instance. + module ProvisioningModel + # Default value. This value is not used. + PROVISIONING_MODEL_UNSPECIFIED = 0 + + # Standard provisioning with user controlled runtime, no discounts. + STANDARD = 1 + + # Heavily discounted, no guaranteed runtime. + SPOT = 2 + end + + # Defines the supported termination actions for an instance. + module InstanceTerminationAction + # Default value. This value is unused. + INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0 + + # Delete the VM. + DELETE = 1 + + # Stop the VM without storing in-memory content. default action. + STOP = 2 + end + end + + # A SchedulingDuration represents a fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". Range is approximately 10,000 years. + # @!attribute [rw] seconds + # @return [::Integer] + # Optional. Span of time at a resolution of a second. + # @!attribute [rw] nanos + # @return [::Integer] + # Optional. Span of time that's a fraction of a second at nanosecond + # resolution. + class SchedulingDuration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A service account. + # @!attribute [rw] email + # @return [::String] + # Optional. Email address of the service account. + # @!attribute [rw] scopes + # @return [::Array<::String>] + # Optional. The list of scopes to be made available for this service account. + class ServiceAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of instance tags. + # @!attribute [rw] items + # @return [::Array<::String>] + # Optional. An array of tags. Each tag must be 1-63 characters long, and + # comply with RFC1035. + class Tags + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An instance-attached disk resource. + # @!attribute [rw] initialize_params + # @return [::Google::Cloud::BackupDR::V1beta::AttachedDisk::InitializeParams] + # Optional. Specifies the parameters to initialize this disk. + # @!attribute [rw] device_name + # @return [::String] + # Optional. This is used as an identifier for the disks. This is the unique + # name has to provided to modify disk parameters like disk_name and + # replica_zones (in case of RePDs) + # @!attribute [rw] kind + # @return [::String] + # Optional. Type of the resource. + # @!attribute [rw] disk_type_deprecated + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::BackupDR::V1beta::AttachedDisk::DiskType] + # Specifies the type of the disk. + # @!attribute [rw] mode + # @return [::Google::Cloud::BackupDR::V1beta::AttachedDisk::DiskMode] + # Optional. The mode in which to attach this disk. + # @!attribute [rw] source + # @return [::String] + # Optional. Specifies a valid partial or full URL to an existing Persistent + # Disk resource. + # @!attribute [rw] index + # @return [::Integer] + # Optional. A zero-based index to this disk, where 0 is reserved for the + # boot disk. + # @!attribute [rw] boot + # @return [::Boolean] + # Optional. Indicates that this is a boot disk. The virtual machine will use + # the first partition of the disk for its root filesystem. + # @!attribute [rw] auto_delete + # @return [::Boolean] + # Optional. Specifies whether the disk will be auto-deleted when the instance + # is deleted (but not when the disk is detached from the instance). + # @!attribute [rw] license + # @return [::Array<::String>] + # Optional. Any valid publicly visible licenses. + # @!attribute [rw] disk_interface + # @return [::Google::Cloud::BackupDR::V1beta::AttachedDisk::DiskInterface] + # Optional. Specifies the disk interface to use for attaching this disk. + # @!attribute [rw] guest_os_feature + # @return [::Array<::Google::Cloud::BackupDR::V1beta::GuestOsFeature>] + # Optional. A list of features to enable on the guest operating system. + # Applicable only for bootable images. + # @!attribute [rw] disk_encryption_key + # @return [::Google::Cloud::BackupDR::V1beta::CustomerEncryptionKey] + # Optional. Encrypts or decrypts a disk using a customer-supplied + # encryption key. + # @!attribute [rw] disk_size_gb + # @return [::Integer] + # Optional. The size of the disk in GB. + # @!attribute [r] saved_state + # @return [::Google::Cloud::BackupDR::V1beta::AttachedDisk::DiskSavedState] + # Optional. Output only. The state of the disk. + # @!attribute [r] disk_type + # @return [::String] + # Optional. Output only. The URI of the disk type resource. For example: + # projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + # @!attribute [rw] type + # @return [::Google::Cloud::BackupDR::V1beta::AttachedDisk::DiskType] + # Optional. Specifies the type of the disk. + class AttachedDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies the parameters to initialize this disk. + # @!attribute [rw] disk_name + # @return [::String] + # Optional. Specifies the disk name. If not specified, the default is to + # use the name of the instance. + # @!attribute [rw] replica_zones + # @return [::Array<::String>] + # Optional. URL of the zone where the disk should be created. + # Required for each regional disk associated with the instance. + class InitializeParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of the Disk Types. + module DiskType + # Default value, which is unused. + DISK_TYPE_UNSPECIFIED = 0 + + # A scratch disk type. + SCRATCH = 1 + + # A persistent disk type. + PERSISTENT = 2 + end + + # List of the Disk Modes. + module DiskMode + # Default value, which is unused. + DISK_MODE_UNSPECIFIED = 0 + + # Attaches this disk in read-write mode. Only one + # virtual machine at a time can be attached to a disk in read-write mode. + READ_WRITE = 1 + + # Attaches this disk in read-only mode. Multiple virtual machines can use + # a disk in read-only mode at a time. + READ_ONLY = 2 + + # The disk is locked for administrative reasons. Nobody else + # can use the disk. This mode is used (for example) when taking + # a snapshot of a disk to prevent mounting the disk while it is + # being snapshotted. + LOCKED = 3 + end + + # List of the Disk Interfaces. + module DiskInterface + # Default value, which is unused. + DISK_INTERFACE_UNSPECIFIED = 0 + + # SCSI Disk Interface. + SCSI = 1 + + # NVME Disk Interface. + NVME = 2 + + # NVDIMM Disk Interface. + NVDIMM = 3 + + # ISCSI Disk Interface. + ISCSI = 4 + end + + # List of the states of the Disk. + module DiskSavedState + # Default Disk state has not been preserved. + DISK_SAVED_STATE_UNSPECIFIED = 0 + + # Disk state has been preserved. + PRESERVED = 1 + end + end + + # Specifies whether the virtual machine instance will be shut down on key + # revocation. It is currently used in instance, instance properties and GMI + # protos + module KeyRevocationActionType + # Default value. This value is unused. + KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0 + + # Indicates user chose no operation. + NONE = 1 + + # Indicates user chose to opt for VM shutdown on key revocation. + STOP = 2 + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/bindingmatchingresource.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/bindingmatchingresource.rb new file mode 100644 index 000000000000..c38880224d57 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/bindingmatchingresource.rb @@ -0,0 +1,160 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # Request message for getting a BindingMatchingResource. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the matching resource to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/autoProtectionPolicies/\\{auto_protection_policy}/bindings/\\{binding}/matchingResources/\\{matching_resource} + class GetBindingMatchingResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for List BindingMatchingResources. + # @!attribute [rw] parent + # @return [::String] + # Required. The project, location, auto protection policy and binding for + # which to retrieve `BindingMatchingResources` information. Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}`. + # In Google Cloud Backup and DR, locations map to Google Cloud regions, for + # example **us-central1**. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of `BindingMatchingResources` to return in a + # single response. The default page size is 100 and maximum page size is 200. + # Note that the response may include a partial list and a caller should + # only rely on the response's + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse#next_page_token next_page_token} + # to determine if there are more instances left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value of + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse#next_page_token next_page_token} + # received from a previous `ListBindingMatchingResources` call. Provide this + # to retrieve the subsequent page in a multi-page list of results. When + # paginating, all other parameters provided to `ListBindingMatchingResources` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. Field match expression used to filter the results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Field by which to sort the results. + class ListBindingMatchingResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for getting a list of `BindingMatchingResources`. + # @!attribute [rw] matching_resources + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BindingMatchingResource>] + # The list of `BindingMatchingResources` in the project,location for the + # specified binding. + # @!attribute [rw] next_page_token + # @return [::String] + # A token which may be sent as + # {::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest#page_token page_token} + # in a subsequent `ListBindingMatchingResources` call to retrieve the next + # page of results. If this field is omitted or empty, then there are no more + # results to return. + class ListBindingMatchingResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BindingMatchingResource contains the details of a resource that matches the + # criteria of a binding. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the `BindingMatchingResource`. + # Format: + # `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}/matchingResources/{matching_resource}` + # @!attribute [rw] resource + # @return [::String] + # Required. Immutable. Resource name of the workload that matches the + # criteria of the binding. + # + # The format can be either a relative resource name (e.g., + # `projects/my-project/zones/us-central1-a/instances/my-instance`) or a + # schemeless full resource name (e.g., + # `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`). + # @!attribute [r] last_evaluation_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last evaluated for + # protection. + # @!attribute [r] auto_protection_details + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionDetails] + # Output only. The auto protection details of the resource from the current + # binding's perspective. + class BindingMatchingResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AutoProtectionDetails contains the protection details of a resource from the + # current binding's perspective. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::AutoProtectionDetails::State] + # Output only. Protection state of the resource from the current binding's + # perspective. Output only. + # @!attribute [r] backup_plan_association + # @return [::String] + # Output only. Resource name of backup plan association linked to the + # resource, if any. Format: + # projects/\\{project}/locations/\\{location}/backupPlanAssociations/\\{backupPlanAssociationId} + # @!attribute [r] data_source + # @return [::String] + # Output only. Resource name of the datasource linked to the resource, if + # any. Format: + # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupVaultId}/dataSources/\\{dataSourceId} + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Error during last sync for protection/unprotection, if any. + class AutoProtectionDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum for protection state of the resource. + module State + # State unspecified. + STATE_UNSPECIFIED = 0 + + # Resource is protected. + PROTECTED = 1 + + # Resource protection failed. + PROTECTION_FAILED = 2 + + # Resource is being unprotected. + UNPROTECTING = 3 + + # Resource unprotection failed. + UNPROTECTION_FAILED = 4 + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/datasourcereference.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/datasourcereference.rb new file mode 100644 index 000000000000..daf0b6598c87 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/datasourcereference.rb @@ -0,0 +1,236 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # DataSourceReference is a reference to a DataSource resource. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the DataSourceReference. + # Format: + # projects/\\{project}/locations/\\{location}/dataSourceReferences/\\{data_source_reference} + # @!attribute [r] data_source + # @return [::String] + # Output only. The resource name of the DataSource. + # Format: + # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupVault}/dataSources/\\{dataSource} + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the DataSourceReference was created. + # @!attribute [r] data_source_backup_config_state + # @return [::Google::Cloud::BackupDR::V1beta::BackupConfigState] + # Output only. The backup configuration state of the DataSource. + # @!attribute [r] data_source_backup_count + # @return [::Integer] + # Output only. Number of backups in the DataSource. + # @!attribute [r] data_source_backup_config_info + # @return [::Google::Cloud::BackupDR::V1beta::DataSourceBackupConfigInfo] + # Output only. Information of backup configuration on the DataSource. + # @!attribute [r] data_source_gcp_resource_info + # @return [::Google::Cloud::BackupDR::V1beta::DataSourceGcpResourceInfo] + # Output only. The Google Cloud resource that the DataSource is associated + # with. + # @!attribute [r] total_stored_bytes + # @return [::Integer] + # Output only. Total size of the storage used by all backup resources for the + # referenced datasource. + class DataSourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information of backup configuration on the DataSource. + # @!attribute [r] last_backup_state + # @return [::Google::Cloud::BackupDR::V1beta::BackupConfigInfo::LastBackupState] + # Output only. The status of the last backup in this DataSource + # @!attribute [r] last_successful_backup_consistency_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp of the last successful backup to this DataSource. + class DataSourceBackupConfigInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud resource that the DataSource is associated with. + # @!attribute [r] cloud_sql_instance_properties + # @return [::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceDataSourceReferenceProperties] + # Output only. The properties of the Cloud SQL instance. + # + # Note: The following fields are mutually exclusive: `cloud_sql_instance_properties`, `alloy_db_cluster_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] alloy_db_cluster_properties + # @return [::Google::Cloud::BackupDR::V1beta::AlloyDBClusterDataSourceReferenceProperties] + # Output only. The properties of the AlloyDB cluster. + # + # Note: The following fields are mutually exclusive: `alloy_db_cluster_properties`, `cloud_sql_instance_properties`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] gcp_resourcename + # @return [::String] + # Output only. The resource name of the Google Cloud resource. + # Ex: projects/\\{project}/zones/\\{zone}/instances/\\{instance} + # @!attribute [r] type + # @return [::String] + # Output only. The type of the Google Cloud resource. + # Ex: compute.googleapis.com/Instance + # @!attribute [r] location + # @return [::String] + # Output only. The location of the Google Cloud resource. + # Ex: //"global"/"unspecified" + class DataSourceGcpResourceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the GetDataSourceReference method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DataSourceReference to retrieve. + # Format: + # projects/\\{project}/locations/\\{location}/dataSourceReferences/\\{data_source_reference} + class GetDataSourceReferenceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the ListDataSourceReferences method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of DataSourceReferences to return. The service + # may return fewer than this value. If unspecified, at most 50 + # DataSourceReferences will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListDataSourceReferences` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDataSourceReferences` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters the results listed in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. + # + # The following field and operator combinations are supported: + # + # * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + # * data_source_gcp_resource_info.type with `=`, `!=` + # @!attribute [rw] order_by + # @return [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # + # * data_source + # * data_source_gcp_resource_info.gcp_resourcename + class ListDataSourceReferencesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the ListDataSourceReferences method. + # @!attribute [rw] data_source_references + # @return [::Array<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # The DataSourceReferences from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListDataSourceReferencesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the FetchDataSourceReferencesForResourceType method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] resource_type + # @return [::String] + # Required. The type of the Google Cloud resource. + # Ex: sql.googleapis.com/Instance + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of DataSourceReferences to return. The service + # may return fewer than this value. If unspecified, at most 50 + # DataSourceReferences will be returned. The maximum value is 100; values + # above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous call of + # `FetchDataSourceReferencesForResourceType`. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchDataSourceReferencesForResourceType` must match + # the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters the results fetched in the + # response. The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. Supported + # fields: + # * data_source + # * data_source_gcp_resource_info.gcp_resourcename + # * data_source_backup_config_state + # * data_source_backup_count + # * data_source_backup_config_info.last_backup_state + # * data_source_gcp_resource_info.gcp_resourcename + # * data_source_gcp_resource_info.type + # * data_source_gcp_resource_info.location + # * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + # @!attribute [rw] order_by + # @return [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. + # + # Supported fields: + # * name + class FetchDataSourceReferencesForResourceTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the FetchDataSourceReferencesForResourceType method. + # @!attribute [rw] data_source_references + # @return [::Array<::Google::Cloud::BackupDR::V1beta::DataSourceReference>] + # The DataSourceReferences from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class FetchDataSourceReferencesForResourceTypeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/protection_summary.rb b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/protection_summary.rb new file mode 100644 index 000000000000..0f682dbf5cd8 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/cloud/backupdr/v1beta/protection_summary.rb @@ -0,0 +1,309 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module BackupDR + module V1beta + # Request for ListResourceBackupConfigs. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location for which to retrieve resource backup + # configs. Format: 'projects/\\{project_id}/locations/\\{location}'. In Google + # Cloud Backup and DR, locations map to Google Cloud regions, for example + # **us-central1**. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will use 100 as default. Maximum value is + # 500 and values above 500 will be coerced to 500. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results. + class ListResourceBackupConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListResourceBackupConfigs. + # @!attribute [rw] resource_backup_configs + # @return [::Array<::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig>] + # The list of ResourceBackupConfigs for the specified scope. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListResourceBackupConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ResourceBackupConfig represents a resource along with its backup + # configurations. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the ResourceBackupConfig. + # Format: + # projects/\\{project}/locations/\\{location}/resourceBackupConfigs/\\{uid} + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource backup config. + # @!attribute [r] target_resource + # @return [::String] + # Output only. The [full resource + # name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + # of the cloud resource that this configuration applies to. Supported + # resource types are + # {::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig::ResourceType ResourceBackupConfig.ResourceType}. + # @!attribute [r] target_resource_display_name + # @return [::String] + # Output only. The human friendly name of the target resource. + # @!attribute [r] target_resource_type + # @return [::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig::ResourceType] + # Output only. The type of the target resource. + # @!attribute [rw] target_resource_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with the target resource. + # @!attribute [rw] backup_configs_details + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupConfigDetails>] + # Backup configurations applying to the target resource, including those + # targeting its related/child resources. For example, backup configuration + # applicable to Compute Engine disks will be populated in this field for a + # Compute Engine VM which has the disk associated. + # @!attribute [r] backup_configured + # @return [::Boolean] + # Output only. Whether the target resource is configured for backup. This is + # true if the backup_configs_details is not empty. + # @!attribute [r] vaulted + # @return [::Boolean] + # Output only. Whether the target resource is protected by a backup vault. + # This is true if the backup_configs_details is not empty and any of the + # {::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig#backup_configs_details ResourceBackupConfig.backup_configs_details} + # has a backup configuration with + # {::Google::Cloud::BackupDR::V1beta::BackupConfigDetails#backup_vault BackupConfigDetails.backup_vault} + # set. + class ResourceBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TargetResourceLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of the cloud resource. + module ResourceType + # Resource type not set. + RESOURCE_TYPE_UNSPECIFIED = 0 + + # Cloud SQL instance. + CLOUD_SQL_INSTANCE = 1 + + # Compute Engine VM. + COMPUTE_ENGINE_VM = 2 + + # Compute Engine Disk. + COMPUTE_ENGINE_DISK = 3 + + # Compute Engine Regional Disk. + COMPUTE_ENGINE_REGIONAL_DISK = 4 + end + end + + # BackupConfigDetails has information about how the resource is configured + # for backups and about the most recent backup taken for this configuration. + # @!attribute [rw] backup_dr_plan_config + # @return [::Google::Cloud::BackupDR::V1beta::BackupDrPlanConfig] + # Google Cloud Backup and DR's Backup Plan specific data. + # + # Note: The following fields are mutually exclusive: `backup_dr_plan_config`, `backup_dr_template_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] backup_dr_template_config + # @return [::Google::Cloud::BackupDR::V1beta::BackupDrTemplateConfig] + # Google Cloud Backup and DR's Template specific data. + # + # Note: The following fields are mutually exclusive: `backup_dr_template_config`, `backup_dr_plan_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] backup_config_source + # @return [::String] + # Output only. The full resource name of the backup config source resource. + # For example, + # "//backupdr.googleapis.com/v1/projects/\\{project}/locations/\\{region}/backupPlans/\\{backupplanId}" + # or + # "//compute.googleapis.com/projects/\\{project}/locations/\\{region}/resourcePolicies/\\{resourcePolicyId}". + # @!attribute [r] backup_config_source_display_name + # @return [::String] + # Output only. The display name of the backup config source resource. + # @!attribute [r] type + # @return [::Google::Cloud::BackupDR::V1beta::BackupConfigDetails::Type] + # Output only. The type of the backup config resource. + # @!attribute [r] state + # @return [::Google::Cloud::BackupDR::V1beta::BackupConfigDetails::State] + # Output only. The state of the backup config resource. + # @!attribute [r] pitr_settings + # @return [::Google::Cloud::BackupDR::V1beta::PitrSettings] + # Output only. Point in time recovery settings of the backup configuration + # resource. + # @!attribute [r] latest_successful_backup_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp of the latest successful backup created via this + # backup configuration. + # @!attribute [r] applicable_resource + # @return [::String] + # Output only. The [full resource + # name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + # of the resource that is applicable for the backup configuration. Example: + # "//compute.googleapis.com/projects/\\{project}/zones/\\{zone}/instances/\\{instance}" + # @!attribute [r] backup_vault + # @return [::String] + # Output only. The [full resource + # name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + # of the backup vault that will store the backups generated through this + # backup configuration. Example: + # "//backupdr.googleapis.com/v1/projects/\\{project}/locations/\\{region}/backupVaults/\\{backupvaultId}" + # @!attribute [rw] backup_locations + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupLocation>] + # The locations where the backups are to be stored. + class BackupConfigDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the backup configuration. + # This enum may receive new values in the future. + module Type + # Backup config type is unspecified. + TYPE_UNSPECIFIED = 0 + + # Backup config is Cloud SQL instance's automated backup config. + CLOUD_SQL_INSTANCE_BACKUP_CONFIG = 1 + + # Backup config is Compute Engine Resource Policy. + COMPUTE_ENGINE_RESOURCE_POLICY = 2 + + # Backup config is Google Cloud Backup and DR's Backup Plan. + BACKUPDR_BACKUP_PLAN = 3 + + # Backup config is Google Cloud Backup and DR's Template. + BACKUPDR_TEMPLATE = 4 + end + + # The state tells whether the backup config is active or not. + module State + # Backup config state not set. + STATE_UNSPECIFIED = 0 + + # The config is in an active state protecting the resource + ACTIVE = 1 + + # The config is currently not protecting the resource. Either because it is + # disabled or the owning project has been deleted without cleanup of the + # actual resource. + INACTIVE = 2 + + # The config still exists but because of some error state it is not + # protecting the resource. Like the source project is deleted. For eg. + # PlanAssociation, BackupPlan is deleted. + ERROR = 3 + end + end + + # Point in time recovery settings of the backup configuration resource. + # @!attribute [r] retention_days + # @return [::Integer] + # Output only. Number of days to retain the backup. + class PitrSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides additional information about Google Cloud Backup and DR's Template + # backup configuration. + # @!attribute [r] first_party_management_uri + # @return [::String] + # Output only. The URI of the BackupDr template resource for the first party + # identity users. + # @!attribute [r] third_party_management_uri + # @return [::String] + # Output only. The URI of the BackupDr template resource for the third party + # identity users. + class BackupDrTemplateConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupDrPlanConfig has additional information about Google Cloud Backup and + # DR's Plan backup configuration. + # @!attribute [rw] backup_dr_plan_rules + # @return [::Array<::Google::Cloud::BackupDR::V1beta::BackupDrPlanRule>] + # Backup rules of the backup plan resource. + class BackupDrPlanConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupDrPlanRule has rule specific information of the backup plan resource. + # @!attribute [r] rule_id + # @return [::String] + # Output only. Unique Id of the backup rule. + # @!attribute [r] last_successful_backup_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp of the latest successful backup created via this + # backup rule. + class BackupDrPlanRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupLocation represents a cloud location where a backup can be stored. + # @!attribute [r] type + # @return [::Google::Cloud::BackupDR::V1beta::BackupLocation::Type] + # Output only. The type of the location. + # @!attribute [r] location_id + # @return [::String] + # Output only. The id of the cloud location. Example: "us-central1" + class BackupLocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the location. + module Type + # Location type is unspecified. + TYPE_UNSPECIFIED = 0 + + # Location type is zonal. + ZONAL = 1 + + # Location type is regional. + REGIONAL = 2 + + # Location type is multi regional. + MULTI_REGIONAL = 3 + end + end + end + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/longrunning/operations.rb b/google-cloud-backupdr-v1beta/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/any.rb b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/duration.rb b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/empty.rb b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/field_mask.rb b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/timestamp.rb b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..e58202461f88 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + # be between -315576000000 and 315576000000 inclusive (which corresponds to + # 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. This field is + # the nanosecond portion of the duration, not an alternative to seconds. + # Negative second values with fractions must still have non-negative nanos + # values that count forward in time. Must be between 0 and 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/wrappers.rb b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/rpc/status.rb b/google-cloud-backupdr-v1beta/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/type/dayofweek.rb b/google-cloud-backupdr-v1beta/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..973211b9ffe7 --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/google-cloud-backupdr-v1beta/proto_docs/google/type/month.rb b/google-cloud-backupdr-v1beta/proto_docs/google/type/month.rb new file mode 100644 index 000000000000..3e27c902551d --- /dev/null +++ b/google-cloud-backupdr-v1beta/proto_docs/google/type/month.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a month in the Gregorian calendar. + module Month + # The unspecified month. + MONTH_UNSPECIFIED = 0 + + # The month of January. + JANUARY = 1 + + # The month of February. + FEBRUARY = 2 + + # The month of March. + MARCH = 3 + + # The month of April. + APRIL = 4 + + # The month of May. + MAY = 5 + + # The month of June. + JUNE = 6 + + # The month of July. + JULY = 7 + + # The month of August. + AUGUST = 8 + + # The month of September. + SEPTEMBER = 9 + + # The month of October. + OCTOBER = 10 + + # The month of November. + NOVEMBER = 11 + + # The month of December. + DECEMBER = 12 + end + end +end diff --git a/google-cloud-backupdr-v1beta/snippets/Gemfile b/google-cloud-backupdr-v1beta/snippets/Gemfile new file mode 100644 index 000000000000..a2dc1e96c659 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-backupdr-v1beta", path: "../" +else + gem "google-cloud-backupdr-v1beta" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/google-cloud-backupdr-v1beta/snippets/backup_dr_protection_summary/list_resource_backup_configs.rb b/google-cloud-backupdr-v1beta/snippets/backup_dr_protection_summary/list_resource_backup_configs.rb new file mode 100644 index 000000000000..734420945123 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backup_dr_protection_summary/list_resource_backup_configs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_resource_backup_configs call in the BackupDrProtectionSummary service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client#list_resource_backup_configs. +# +def list_resource_backup_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest.new + + # Call the list_resource_backup_configs method. + result = client.list_resource_backup_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::ResourceBackupConfig. + p item + end +end +# [END backupdr_v1beta_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy.rb new file mode 100644 index 000000000000..986f3cb7e82e --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_CreateAutoProtectionPolicy_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the create_auto_protection_policy call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_auto_protection_policy. +# +def create_auto_protection_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest.new + + # Call the create_auto_protection_policy method. + result = client.create_auto_protection_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_CreateAutoProtectionPolicy_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy_binding.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy_binding.rb new file mode 100644 index 000000000000..1dc13b234b12 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/create_auto_protection_policy_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_CreateAutoProtectionPolicyBinding_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the create_auto_protection_policy_binding call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_auto_protection_policy_binding. +# +def create_auto_protection_policy_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest.new + + # Call the create_auto_protection_policy_binding method. + result = client.create_auto_protection_policy_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_CreateAutoProtectionPolicyBinding_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan.rb new file mode 100644 index 000000000000..3359f8455c99 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_CreateBackupPlan_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the create_backup_plan call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_plan. +# +def create_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest.new + + # Call the create_backup_plan method. + result = client.create_backup_plan request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_CreateBackupPlan_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan_association.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan_association.rb new file mode 100644 index 000000000000..32951382e881 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_plan_association.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_CreateBackupPlanAssociation_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the create_backup_plan_association call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_plan_association. +# +def create_backup_plan_association + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest.new + + # Call the create_backup_plan_association method. + result = client.create_backup_plan_association request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_CreateBackupPlanAssociation_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_vault.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_vault.rb new file mode 100644 index 000000000000..566182678647 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/create_backup_vault.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_CreateBackupVault_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the create_backup_vault call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_vault. +# +def create_backup_vault + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest.new + + # Call the create_backup_vault method. + result = client.create_backup_vault request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_CreateBackupVault_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/create_management_server.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/create_management_server.rb new file mode 100644 index 000000000000..a79c99656ead --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/create_management_server.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_CreateManagementServer_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the create_management_server call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_management_server. +# +def create_management_server + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest.new + + # Call the create_management_server method. + result = client.create_management_server request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_CreateManagementServer_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/delete_auto_protection_policy.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_auto_protection_policy.rb new file mode 100644 index 000000000000..06cc406d1ea2 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_auto_protection_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_DeleteAutoProtectionPolicy_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the delete_auto_protection_policy call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_auto_protection_policy. +# +def delete_auto_protection_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest.new + + # Call the delete_auto_protection_policy method. + result = client.delete_auto_protection_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_DeleteAutoProtectionPolicy_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup.rb new file mode 100644 index 000000000000..ece6e706f0fc --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_DeleteBackup_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the delete_backup call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_DeleteBackup_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan.rb new file mode 100644 index 000000000000..51178264cca9 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_DeleteBackupPlan_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the delete_backup_plan call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_plan. +# +def delete_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest.new + + # Call the delete_backup_plan method. + result = client.delete_backup_plan request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_DeleteBackupPlan_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan_association.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan_association.rb new file mode 100644 index 000000000000..9114dda88938 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_plan_association.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_DeleteBackupPlanAssociation_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the delete_backup_plan_association call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_plan_association. +# +def delete_backup_plan_association + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest.new + + # Call the delete_backup_plan_association method. + result = client.delete_backup_plan_association request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_DeleteBackupPlanAssociation_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_vault.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_vault.rb new file mode 100644 index 000000000000..c703e7a6901d --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_backup_vault.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_DeleteBackupVault_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the delete_backup_vault call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_vault. +# +def delete_backup_vault + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest.new + + # Call the delete_backup_vault method. + result = client.delete_backup_vault request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_DeleteBackupVault_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/delete_management_server.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_management_server.rb new file mode 100644 index 000000000000..cc639270857b --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/delete_management_server.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_DeleteManagementServer_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the delete_management_server call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_management_server. +# +def delete_management_server + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest.new + + # Call the delete_management_server method. + result = client.delete_management_server request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_DeleteManagementServer_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backup_plan_associations_for_resource_type.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backup_plan_associations_for_resource_type.rb new file mode 100644 index 000000000000..8bb176f572ac --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backup_plan_associations_for_resource_type.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the fetch_backup_plan_associations_for_resource_type call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_backup_plan_associations_for_resource_type. +# +def fetch_backup_plan_associations_for_resource_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest.new + + # Call the fetch_backup_plan_associations_for_resource_type method. + result = client.fetch_backup_plan_associations_for_resource_type request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backups_for_resource_type.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backups_for_resource_type.rb new file mode 100644 index 000000000000..79502a44cfe3 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_backups_for_resource_type.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_FetchBackupsForResourceType_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the fetch_backups_for_resource_type call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_backups_for_resource_type. +# +def fetch_backups_for_resource_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest.new + + # Call the fetch_backups_for_resource_type method. + result = client.fetch_backups_for_resource_type request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::Backup. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_FetchBackupsForResourceType_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_data_source_references_for_resource_type.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_data_source_references_for_resource_type.rb new file mode 100644 index 000000000000..44835ebf784d --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_data_source_references_for_resource_type.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_FetchDataSourceReferencesForResourceType_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the fetch_data_source_references_for_resource_type call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_data_source_references_for_resource_type. +# +def fetch_data_source_references_for_resource_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest.new + + # Call the fetch_data_source_references_for_resource_type method. + result = client.fetch_data_source_references_for_resource_type request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSourceReference. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_FetchDataSourceReferencesForResourceType_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_usable_backup_vaults.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_usable_backup_vaults.rb new file mode 100644 index 000000000000..68982dcb02e7 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/fetch_usable_backup_vaults.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_FetchUsableBackupVaults_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the fetch_usable_backup_vaults call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_usable_backup_vaults. +# +def fetch_usable_backup_vaults + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest.new + + # Call the fetch_usable_backup_vaults method. + result = client.fetch_usable_backup_vaults request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupVault. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_FetchUsableBackupVaults_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy.rb new file mode 100644 index 000000000000..058f2729c9a0 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetAutoProtectionPolicy_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_auto_protection_policy call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_auto_protection_policy. +# +def get_auto_protection_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest.new + + # Call the get_auto_protection_policy method. + result = client.get_auto_protection_policy request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetAutoProtectionPolicy_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy_binding.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy_binding.rb new file mode 100644 index 000000000000..38e8589ee956 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_auto_protection_policy_binding.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetAutoProtectionPolicyBinding_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_auto_protection_policy_binding call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_auto_protection_policy_binding. +# +def get_auto_protection_policy_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest.new + + # Call the get_auto_protection_policy_binding method. + result = client.get_auto_protection_policy_binding request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetAutoProtectionPolicyBinding_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup.rb new file mode 100644 index 000000000000..daf488912111 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetBackup_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_backup call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::Backup. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetBackup_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan.rb new file mode 100644 index 000000000000..5da4d79a2acb --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetBackupPlan_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_backup_plan call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan. +# +def get_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest.new + + # Call the get_backup_plan method. + result = client.get_backup_plan request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlan. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetBackupPlan_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_association.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_association.rb new file mode 100644 index 000000000000..4a3f6fd31821 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_association.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetBackupPlanAssociation_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_backup_plan_association call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan_association. +# +def get_backup_plan_association + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest.new + + # Call the get_backup_plan_association method. + result = client.get_backup_plan_association request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetBackupPlanAssociation_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_revision.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_revision.rb new file mode 100644 index 000000000000..a6adb83c8a06 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_plan_revision.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetBackupPlanRevision_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_backup_plan_revision call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan_revision. +# +def get_backup_plan_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest.new + + # Call the get_backup_plan_revision method. + result = client.get_backup_plan_revision request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupPlanRevision. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetBackupPlanRevision_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_vault.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_vault.rb new file mode 100644 index 000000000000..07b4d175ef13 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_backup_vault.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetBackupVault_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_backup_vault call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_vault. +# +def get_backup_vault + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest.new + + # Call the get_backup_vault method. + result = client.get_backup_vault request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::BackupVault. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetBackupVault_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_binding_matching_resource.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_binding_matching_resource.rb new file mode 100644 index 000000000000..720408c9b505 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_binding_matching_resource.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetBindingMatchingResource_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_binding_matching_resource call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_binding_matching_resource. +# +def get_binding_matching_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest.new + + # Call the get_binding_matching_resource method. + result = client.get_binding_matching_resource request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::BindingMatchingResource. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetBindingMatchingResource_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source.rb new file mode 100644 index 000000000000..aceeeaf8e00b --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetDataSource_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_data_source call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_data_source. +# +def get_data_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetDataSourceRequest.new + + # Call the get_data_source method. + result = client.get_data_source request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::DataSource. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetDataSource_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source_reference.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source_reference.rb new file mode 100644 index 000000000000..8374adf523ea --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_data_source_reference.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetDataSourceReference_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_data_source_reference call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_data_source_reference. +# +def get_data_source_reference + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest.new + + # Call the get_data_source_reference method. + result = client.get_data_source_reference request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::DataSourceReference. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetDataSourceReference_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/get_management_server.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/get_management_server.rb new file mode 100644 index 000000000000..516aa165dc9d --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/get_management_server.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_GetManagementServer_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the get_management_server call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_management_server. +# +def get_management_server + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::GetManagementServerRequest.new + + # Call the get_management_server method. + result = client.get_management_server request + + # The returned object is of type Google::Cloud::BackupDR::V1beta::ManagementServer. + p result +end +# [END backupdr_v1beta_generated_BackupDR_GetManagementServer_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/initialize_service.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/initialize_service.rb new file mode 100644 index 000000000000..45b8c0a7a52f --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/initialize_service.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_InitializeService_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the initialize_service call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#initialize_service. +# +def initialize_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::InitializeServiceRequest.new + + # Call the initialize_service method. + result = client.initialize_service request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_InitializeService_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/initiate_delete_auto_protection_policy_binding.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/initiate_delete_auto_protection_policy_binding.rb new file mode 100644 index 000000000000..e7a8bff37d4d --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/initiate_delete_auto_protection_policy_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_InitiateDeleteAutoProtectionPolicyBinding_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the initiate_delete_auto_protection_policy_binding call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#initiate_delete_auto_protection_policy_binding. +# +def initiate_delete_auto_protection_policy_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest.new + + # Call the initiate_delete_auto_protection_policy_binding method. + result = client.initiate_delete_auto_protection_policy_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_InitiateDeleteAutoProtectionPolicyBinding_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_applied_auto_protection_policies.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_applied_auto_protection_policies.rb new file mode 100644 index 000000000000..56ae0f06436b --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_applied_auto_protection_policies.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListAppliedAutoProtectionPolicies_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_applied_auto_protection_policies call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_applied_auto_protection_policies. +# +def list_applied_auto_protection_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest.new + + # Call the list_applied_auto_protection_policies method. + result = client.list_applied_auto_protection_policies request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::AppliedAutoProtectionPolicy. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListAppliedAutoProtectionPolicies_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policies.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policies.rb new file mode 100644 index 000000000000..6a2abe36e711 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policies.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListAutoProtectionPolicies_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_auto_protection_policies call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_auto_protection_policies. +# +def list_auto_protection_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest.new + + # Call the list_auto_protection_policies method. + result = client.list_auto_protection_policies request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListAutoProtectionPolicies_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policy_bindings.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policy_bindings.rb new file mode 100644 index 000000000000..dc5d7b6c2662 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_auto_protection_policy_bindings.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListAutoProtectionPolicyBindings_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_auto_protection_policy_bindings call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_auto_protection_policy_bindings. +# +def list_auto_protection_policy_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest.new + + # Call the list_auto_protection_policy_bindings method. + result = client.list_auto_protection_policy_bindings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListAutoProtectionPolicyBindings_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_associations.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_associations.rb new file mode 100644 index 000000000000..701e53ac1e4c --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_associations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListBackupPlanAssociations_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_backup_plan_associations call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plan_associations. +# +def list_backup_plan_associations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest.new + + # Call the list_backup_plan_associations method. + result = client.list_backup_plan_associations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListBackupPlanAssociations_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_revisions.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_revisions.rb new file mode 100644 index 000000000000..c2f6d781bfa1 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plan_revisions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListBackupPlanRevisions_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_backup_plan_revisions call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plan_revisions. +# +def list_backup_plan_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest.new + + # Call the list_backup_plan_revisions method. + result = client.list_backup_plan_revisions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlanRevision. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListBackupPlanRevisions_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plans.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plans.rb new file mode 100644 index 000000000000..2a93c559cb80 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_plans.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListBackupPlans_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_backup_plans call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plans. +# +def list_backup_plans + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest.new + + # Call the list_backup_plans method. + result = client.list_backup_plans request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupPlan. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListBackupPlans_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_vaults.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_vaults.rb new file mode 100644 index 000000000000..f980638e8ea5 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backup_vaults.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListBackupVaults_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_backup_vaults call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_vaults. +# +def list_backup_vaults + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest.new + + # Call the list_backup_vaults method. + result = client.list_backup_vaults request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::BackupVault. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListBackupVaults_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_backups.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backups.rb new file mode 100644 index 000000000000..4e52b926af1d --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_backups.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListBackups_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_backups call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListBackupsRequest.new + + # Call the list_backups method. + result = client.list_backups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::Backup. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListBackups_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_binding_matching_resources.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_binding_matching_resources.rb new file mode 100644 index 000000000000..cd5e82da8d9d --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_binding_matching_resources.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListBindingMatchingResources_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_binding_matching_resources call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_binding_matching_resources. +# +def list_binding_matching_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest.new + + # Call the list_binding_matching_resources method. + result = client.list_binding_matching_resources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::BindingMatchingResource. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListBindingMatchingResources_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_data_source_references.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_data_source_references.rb new file mode 100644 index 000000000000..602edd000c1c --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_data_source_references.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListDataSourceReferences_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_data_source_references call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_data_source_references. +# +def list_data_source_references + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest.new + + # Call the list_data_source_references method. + result = client.list_data_source_references request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSourceReference. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListDataSourceReferences_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_data_sources.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_data_sources.rb new file mode 100644 index 000000000000..beabf79278bd --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_data_sources.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListDataSources_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_data_sources call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_data_sources. +# +def list_data_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest.new + + # Call the list_data_sources method. + result = client.list_data_sources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::DataSource. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListDataSources_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/list_management_servers.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/list_management_servers.rb new file mode 100644 index 000000000000..e5dbb94e22a6 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/list_management_servers.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_ListManagementServers_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the list_management_servers call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_management_servers. +# +def list_management_servers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new + + # Call the list_management_servers method. + result = client.list_management_servers request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::BackupDR::V1beta::ManagementServer. + p item + end +end +# [END backupdr_v1beta_generated_BackupDR_ListManagementServers_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/restore_backup.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/restore_backup.rb new file mode 100644 index 000000000000..345e78dae3ec --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/restore_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_RestoreBackup_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the restore_backup call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#restore_backup. +# +def restore_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::RestoreBackupRequest.new + + # Call the restore_backup method. + result = client.restore_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_RestoreBackup_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/trigger_backup.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/trigger_backup.rb new file mode 100644 index 000000000000..7bf9161559a4 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/trigger_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_TriggerBackup_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the trigger_backup call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#trigger_backup. +# +def trigger_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::TriggerBackupRequest.new + + # Call the trigger_backup method. + result = client.trigger_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_TriggerBackup_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/update_auto_protection_policy.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/update_auto_protection_policy.rb new file mode 100644 index 000000000000..3d7930061663 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/update_auto_protection_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_UpdateAutoProtectionPolicy_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the update_auto_protection_policy call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_auto_protection_policy. +# +def update_auto_protection_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest.new + + # Call the update_auto_protection_policy method. + result = client.update_auto_protection_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_UpdateAutoProtectionPolicy_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup.rb new file mode 100644 index 000000000000..53b328aada2a --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_UpdateBackup_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the update_backup call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup. +# +def update_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::UpdateBackupRequest.new + + # Call the update_backup method. + result = client.update_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_UpdateBackup_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan.rb new file mode 100644 index 000000000000..0d03de3a0044 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_UpdateBackupPlan_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the update_backup_plan call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_plan. +# +def update_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest.new + + # Call the update_backup_plan method. + result = client.update_backup_plan request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_UpdateBackupPlan_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan_association.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan_association.rb new file mode 100644 index 000000000000..8ba6f303b94e --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_plan_association.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_UpdateBackupPlanAssociation_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the update_backup_plan_association call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_plan_association. +# +def update_backup_plan_association + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest.new + + # Call the update_backup_plan_association method. + result = client.update_backup_plan_association request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_UpdateBackupPlanAssociation_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_vault.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_vault.rb new file mode 100644 index 000000000000..c126337ce561 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/update_backup_vault.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_UpdateBackupVault_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the update_backup_vault call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_vault. +# +def update_backup_vault + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest.new + + # Call the update_backup_vault method. + result = client.update_backup_vault request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_UpdateBackupVault_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/backupdr/update_data_source.rb b/google-cloud-backupdr-v1beta/snippets/backupdr/update_data_source.rb new file mode 100644 index 000000000000..d27ee2a5558e --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/backupdr/update_data_source.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START backupdr_v1beta_generated_BackupDR_UpdateDataSource_sync] +require "google/cloud/backupdr/v1beta" + +## +# Snippet for the update_data_source call in the BackupDR service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_data_source. +# +def update_data_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BackupDR::V1beta::BackupDR::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest.new + + # Call the update_data_source method. + result = client.update_data_source request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END backupdr_v1beta_generated_BackupDR_UpdateDataSource_sync] diff --git a/google-cloud-backupdr-v1beta/snippets/snippet_metadata_google.cloud.backupdr.v1beta.json b/google-cloud-backupdr-v1beta/snippets/snippet_metadata_google.cloud.backupdr.v1beta.json new file mode 100644 index 000000000000..842c71aad977 --- /dev/null +++ b/google-cloud-backupdr-v1beta/snippets/snippet_metadata_google.cloud.backupdr.v1beta.json @@ -0,0 +1,2015 @@ +{ + "client_library": { + "name": "google-cloud-backupdr-v1beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.backupdr.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListManagementServers_sync", + "title": "Snippet for the list_management_servers call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_management_servers.", + "file": "backupdr/list_management_servers.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_management_servers", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_management_servers", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListManagementServersResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListManagementServers", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListManagementServers", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetManagementServer_sync", + "title": "Snippet for the get_management_server call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_management_server.", + "file": "backupdr/get_management_server.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_management_server", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_management_server", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ManagementServer", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetManagementServer", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetManagementServer", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_CreateManagementServer_sync", + "title": "Snippet for the create_management_server call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_management_server.", + "file": "backupdr/create_management_server.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_management_server", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_management_server", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "CreateManagementServer", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.CreateManagementServer", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_DeleteManagementServer_sync", + "title": "Snippet for the delete_management_server call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_management_server.", + "file": "backupdr/delete_management_server.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_management_server", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_management_server", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "DeleteManagementServer", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.DeleteManagementServer", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_CreateBackupVault_sync", + "title": "Snippet for the create_backup_vault call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_vault.", + "file": "backupdr/create_backup_vault.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_backup_vault", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_vault", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "CreateBackupVault", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.CreateBackupVault", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListBackupVaults_sync", + "title": "Snippet for the list_backup_vaults call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_vaults.", + "file": "backupdr/list_backup_vaults.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_vaults", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_vaults", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListBackupVaultsResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListBackupVaults", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListBackupVaults", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_FetchUsableBackupVaults_sync", + "title": "Snippet for the fetch_usable_backup_vaults call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_usable_backup_vaults.", + "file": "backupdr/fetch_usable_backup_vaults.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_usable_backup_vaults", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_usable_backup_vaults", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "FetchUsableBackupVaults", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.FetchUsableBackupVaults", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetBackupVault_sync", + "title": "Snippet for the get_backup_vault call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_vault.", + "file": "backupdr/get_backup_vault.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_vault", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_vault", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::BackupVault", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetBackupVault", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetBackupVault", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_UpdateBackupVault_sync", + "title": "Snippet for the update_backup_vault call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_vault.", + "file": "backupdr/update_backup_vault.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup_vault", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_vault", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "UpdateBackupVault", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.UpdateBackupVault", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_DeleteBackupVault_sync", + "title": "Snippet for the delete_backup_vault call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_vault.", + "file": "backupdr/delete_backup_vault.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup_vault", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_vault", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "DeleteBackupVault", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.DeleteBackupVault", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListDataSources_sync", + "title": "Snippet for the list_data_sources call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_data_sources.", + "file": "backupdr/list_data_sources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_data_sources", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_data_sources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListDataSourcesResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListDataSources", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListDataSources", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetDataSource_sync", + "title": "Snippet for the get_data_source call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_data_source.", + "file": "backupdr/get_data_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_data_source", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_data_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::DataSource", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetDataSource", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetDataSource", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_UpdateDataSource_sync", + "title": "Snippet for the update_data_source call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_data_source.", + "file": "backupdr/update_data_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_data_source", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_data_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "UpdateDataSource", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.UpdateDataSource", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListBackups_sync", + "title": "Snippet for the list_backups call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backups.", + "file": "backupdr/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListBackupsResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListBackups", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_FetchBackupsForResourceType_sync", + "title": "Snippet for the fetch_backups_for_resource_type call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_backups_for_resource_type.", + "file": "backupdr/fetch_backups_for_resource_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_backups_for_resource_type", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_backups_for_resource_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "FetchBackupsForResourceType", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.FetchBackupsForResourceType", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetBackup_sync", + "title": "Snippet for the get_backup call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup.", + "file": "backupdr/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::Backup", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetBackup", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_UpdateBackup_sync", + "title": "Snippet for the update_backup call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup.", + "file": "backupdr/update_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "UpdateBackup", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.UpdateBackup", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup.", + "file": "backupdr/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.DeleteBackup", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_RestoreBackup_sync", + "title": "Snippet for the restore_backup call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#restore_backup.", + "file": "backupdr/restore_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_backup", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#restore_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "RestoreBackup", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.RestoreBackup", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_CreateBackupPlan_sync", + "title": "Snippet for the create_backup_plan call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_plan.", + "file": "backupdr/create_backup_plan.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_backup_plan", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_plan", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "CreateBackupPlan", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.CreateBackupPlan", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_UpdateBackupPlan_sync", + "title": "Snippet for the update_backup_plan call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_plan.", + "file": "backupdr/update_backup_plan.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup_plan", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_plan", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "UpdateBackupPlan", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.UpdateBackupPlan", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetBackupPlan_sync", + "title": "Snippet for the get_backup_plan call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan.", + "file": "backupdr/get_backup_plan.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_plan", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::BackupPlan", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetBackupPlan", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetBackupPlan", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListBackupPlans_sync", + "title": "Snippet for the list_backup_plans call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plans.", + "file": "backupdr/list_backup_plans.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_plans", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plans", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListBackupPlans", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListBackupPlans", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_DeleteBackupPlan_sync", + "title": "Snippet for the delete_backup_plan call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_plan.", + "file": "backupdr/delete_backup_plan.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup_plan", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_plan", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "DeleteBackupPlan", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.DeleteBackupPlan", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetBackupPlanRevision_sync", + "title": "Snippet for the get_backup_plan_revision call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan_revision.", + "file": "backupdr/get_backup_plan_revision.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_plan_revision", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan_revision", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::BackupPlanRevision", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetBackupPlanRevision", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetBackupPlanRevision", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListBackupPlanRevisions_sync", + "title": "Snippet for the list_backup_plan_revisions call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plan_revisions.", + "file": "backupdr/list_backup_plan_revisions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_plan_revisions", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plan_revisions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListBackupPlanRevisions", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListBackupPlanRevisions", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_CreateBackupPlanAssociation_sync", + "title": "Snippet for the create_backup_plan_association call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_plan_association.", + "file": "backupdr/create_backup_plan_association.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_backup_plan_association", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_backup_plan_association", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "CreateBackupPlanAssociation", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.CreateBackupPlanAssociation", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_UpdateBackupPlanAssociation_sync", + "title": "Snippet for the update_backup_plan_association call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_plan_association.", + "file": "backupdr/update_backup_plan_association.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup_plan_association", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_backup_plan_association", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "UpdateBackupPlanAssociation", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.UpdateBackupPlanAssociation", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetBackupPlanAssociation_sync", + "title": "Snippet for the get_backup_plan_association call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan_association.", + "file": "backupdr/get_backup_plan_association.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_plan_association", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_backup_plan_association", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetBackupPlanAssociation", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetBackupPlanAssociation", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListBackupPlanAssociations_sync", + "title": "Snippet for the list_backup_plan_associations call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plan_associations.", + "file": "backupdr/list_backup_plan_associations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_plan_associations", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_backup_plan_associations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListBackupPlanAssociations", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListBackupPlanAssociations", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_sync", + "title": "Snippet for the fetch_backup_plan_associations_for_resource_type call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_backup_plan_associations_for_resource_type.", + "file": "backupdr/fetch_backup_plan_associations_for_resource_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_backup_plan_associations_for_resource_type", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_backup_plan_associations_for_resource_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "FetchBackupPlanAssociationsForResourceType", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.FetchBackupPlanAssociationsForResourceType", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_DeleteBackupPlanAssociation_sync", + "title": "Snippet for the delete_backup_plan_association call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_plan_association.", + "file": "backupdr/delete_backup_plan_association.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup_plan_association", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_backup_plan_association", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "DeleteBackupPlanAssociation", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.DeleteBackupPlanAssociation", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_TriggerBackup_sync", + "title": "Snippet for the trigger_backup call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#trigger_backup.", + "file": "backupdr/trigger_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "trigger_backup", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#trigger_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "TriggerBackup", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.TriggerBackup", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetDataSourceReference_sync", + "title": "Snippet for the get_data_source_reference call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_data_source_reference.", + "file": "backupdr/get_data_source_reference.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_data_source_reference", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_data_source_reference", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::DataSourceReference", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetDataSourceReference", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetDataSourceReference", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListDataSourceReferences_sync", + "title": "Snippet for the list_data_source_references call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_data_source_references.", + "file": "backupdr/list_data_source_references.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_data_source_references", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_data_source_references", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListDataSourceReferences", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListDataSourceReferences", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_FetchDataSourceReferencesForResourceType_sync", + "title": "Snippet for the fetch_data_source_references_for_resource_type call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_data_source_references_for_resource_type.", + "file": "backupdr/fetch_data_source_references_for_resource_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_data_source_references_for_resource_type", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#fetch_data_source_references_for_resource_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "FetchDataSourceReferencesForResourceType", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.FetchDataSourceReferencesForResourceType", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_InitializeService_sync", + "title": "Snippet for the initialize_service call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#initialize_service.", + "file": "backupdr/initialize_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "initialize_service", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#initialize_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "InitializeService", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.InitializeService", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_CreateAutoProtectionPolicy_sync", + "title": "Snippet for the create_auto_protection_policy call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_auto_protection_policy.", + "file": "backupdr/create_auto_protection_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_auto_protection_policy", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_auto_protection_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "CreateAutoProtectionPolicy", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.CreateAutoProtectionPolicy", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListAutoProtectionPolicies_sync", + "title": "Snippet for the list_auto_protection_policies call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_auto_protection_policies.", + "file": "backupdr/list_auto_protection_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_auto_protection_policies", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_auto_protection_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListAutoProtectionPolicies", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListAutoProtectionPolicies", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetAutoProtectionPolicy_sync", + "title": "Snippet for the get_auto_protection_policy call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_auto_protection_policy.", + "file": "backupdr/get_auto_protection_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_auto_protection_policy", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_auto_protection_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetAutoProtectionPolicy", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetAutoProtectionPolicy", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_UpdateAutoProtectionPolicy_sync", + "title": "Snippet for the update_auto_protection_policy call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_auto_protection_policy.", + "file": "backupdr/update_auto_protection_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_auto_protection_policy", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#update_auto_protection_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "UpdateAutoProtectionPolicy", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.UpdateAutoProtectionPolicy", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_DeleteAutoProtectionPolicy_sync", + "title": "Snippet for the delete_auto_protection_policy call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_auto_protection_policy.", + "file": "backupdr/delete_auto_protection_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_auto_protection_policy", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#delete_auto_protection_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "DeleteAutoProtectionPolicy", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.DeleteAutoProtectionPolicy", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_CreateAutoProtectionPolicyBinding_sync", + "title": "Snippet for the create_auto_protection_policy_binding call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_auto_protection_policy_binding.", + "file": "backupdr/create_auto_protection_policy_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_auto_protection_policy_binding", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#create_auto_protection_policy_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "CreateAutoProtectionPolicyBinding", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.CreateAutoProtectionPolicyBinding", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetAutoProtectionPolicyBinding_sync", + "title": "Snippet for the get_auto_protection_policy_binding call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_auto_protection_policy_binding.", + "file": "backupdr/get_auto_protection_policy_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_auto_protection_policy_binding", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_auto_protection_policy_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetAutoProtectionPolicyBinding", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetAutoProtectionPolicyBinding", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListAutoProtectionPolicyBindings_sync", + "title": "Snippet for the list_auto_protection_policy_bindings call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_auto_protection_policy_bindings.", + "file": "backupdr/list_auto_protection_policy_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_auto_protection_policy_bindings", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_auto_protection_policy_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListAutoProtectionPolicyBindings", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListAutoProtectionPolicyBindings", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListAppliedAutoProtectionPolicies_sync", + "title": "Snippet for the list_applied_auto_protection_policies call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_applied_auto_protection_policies.", + "file": "backupdr/list_applied_auto_protection_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_applied_auto_protection_policies", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_applied_auto_protection_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListAppliedAutoProtectionPolicies", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListAppliedAutoProtectionPolicies", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_InitiateDeleteAutoProtectionPolicyBinding_sync", + "title": "Snippet for the initiate_delete_auto_protection_policy_binding call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#initiate_delete_auto_protection_policy_binding.", + "file": "backupdr/initiate_delete_auto_protection_policy_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "initiate_delete_auto_protection_policy_binding", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#initiate_delete_auto_protection_policy_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "InitiateDeleteAutoProtectionPolicyBinding", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.InitiateDeleteAutoProtectionPolicyBinding", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_GetBindingMatchingResource_sync", + "title": "Snippet for the get_binding_matching_resource call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_binding_matching_resource.", + "file": "backupdr/get_binding_matching_resource.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_binding_matching_resource", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#get_binding_matching_resource", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::BindingMatchingResource", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "GetBindingMatchingResource", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.GetBindingMatchingResource", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDR_ListBindingMatchingResources_sync", + "title": "Snippet for the list_binding_matching_resources call in the BackupDR service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_binding_matching_resources.", + "file": "backupdr/list_binding_matching_resources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_binding_matching_resources", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client#list_binding_matching_resources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse", + "client": { + "short_name": "BackupDR::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDR::Client" + }, + "method": { + "short_name": "ListBindingMatchingResources", + "full_name": "google.cloud.backupdr.v1beta.BackupDR.ListBindingMatchingResources", + "service": { + "short_name": "BackupDR", + "full_name": "google.cloud.backupdr.v1beta.BackupDR" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "backupdr_v1beta_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_sync", + "title": "Snippet for the list_resource_backup_configs call in the BackupDrProtectionSummary service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client#list_resource_backup_configs.", + "file": "backup_dr_protection_summary/list_resource_backup_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_resource_backup_configs", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client#list_resource_backup_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsResponse", + "client": { + "short_name": "BackupDrProtectionSummary::Client", + "full_name": "::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client" + }, + "method": { + "short_name": "ListResourceBackupConfigs", + "full_name": "google.cloud.backupdr.v1beta.BackupDrProtectionSummary.ListResourceBackupConfigs", + "service": { + "short_name": "BackupDrProtectionSummary", + "full_name": "google.cloud.backupdr.v1beta.BackupDrProtectionSummary" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_paths_test.rb b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_paths_test.rb new file mode 100644 index 000000000000..16585df56de5 --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary" + +class ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end +end diff --git a/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_rest_test.rb b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_rest_test.rb new file mode 100644 index 000000000000..3326748b2b20 --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_rest_test.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/backupdr/v1beta/protection_summary_pb" +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary/rest" + + +class ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_resource_backup_configs + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_resource_backup_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::ServiceStub.stub :transcode_list_resource_backup_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_resource_backup_configs_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_resource_backup_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_resource_backup_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_resource_backup_configs ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_resource_backup_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_resource_backup_configs(::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_resource_backup_configs_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_test.rb b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_test.rb new file mode 100644 index 000000000000..f8c5a6b027cc --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backup_dr_protection_summary_test.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/backupdr/v1beta/protection_summary_pb" +require "google/cloud/backupdr/v1beta/backup_dr_protection_summary" + +class ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_resource_backup_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_resource_backup_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_resource_backup_configs, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_resource_backup_configs_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_resource_backup_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_resource_backup_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_resource_backup_configs ::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_resource_backup_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_resource_backup_configs(::Google::Cloud::BackupDR::V1beta::ListResourceBackupConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_resource_backup_configs_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDrProtectionSummary::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_operations_test.rb b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_operations_test.rb new file mode 100644 index 000000000000..c2f446d3aa47 --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/backupdr/v1beta/backupdr_pb" +require "google/cloud/backupdr/v1beta/backupdr_services_pb" +require "google/cloud/backupdr/v1beta/backupdr" + +class ::Google::Cloud::BackupDR::V1beta::BackupDR::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations::Configuration, config + end +end diff --git a/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_paths_test.rb b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_paths_test.rb new file mode 100644 index 000000000000..24bac59c085e --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_paths_test.rb @@ -0,0 +1,247 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/backupdr/v1beta/backupdr" + +class ::Google::Cloud::BackupDR::V1beta::BackupDR::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_auto_protection_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.auto_protection_policy_path project: "value0", location: "value1", auto_protection_policy: "value2" + assert_equal "projects/value0/locations/value1/autoProtectionPolicies/value2", path + end + end + + def test_auto_protection_policy_binding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.auto_protection_policy_binding_path project: "value0", location: "value1", auto_protection_policy: "value2", binding: "value3" + assert_equal "projects/value0/locations/value1/autoProtectionPolicies/value2/bindings/value3", path + end + end + + def test_backup_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backupvault: "value2", datasource: "value3", backup: "value4" + assert_equal "projects/value0/locations/value1/backupVaults/value2/dataSources/value3/backups/value4", path + end + end + + def test_backup_plan_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_plan_path project: "value0", location: "value1", backup_plan: "value2" + assert_equal "projects/value0/locations/value1/backupPlans/value2", path + end + end + + def test_backup_plan_association_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_plan_association_path project: "value0", location: "value1", backup_plan_association: "value2" + assert_equal "projects/value0/locations/value1/backupPlanAssociations/value2", path + end + end + + def test_backup_plan_revision_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_plan_revision_path project: "value0", location: "value1", backup_plan: "value2", revision: "value3" + assert_equal "projects/value0/locations/value1/backupPlans/value2/revisions/value3", path + end + end + + def test_backup_vault_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_vault_path project: "value0", location: "value1", backupvault: "value2" + assert_equal "projects/value0/locations/value1/backupVaults/value2", path + end + end + + def test_binding_matching_resource_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.binding_matching_resource_path project: "value0", location: "value1", auto_protection_policy: "value2", binding: "value3", matching_resource: "value4" + assert_equal "projects/value0/locations/value1/autoProtectionPolicies/value2/bindings/value3/matchingResources/value4", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", ring: "value2", key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_data_source_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_source_path project: "value0", location: "value1", backupvault: "value2", datasource: "value3" + assert_equal "projects/value0/locations/value1/backupVaults/value2/dataSources/value3", path + end + end + + def test_data_source_reference_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_source_reference_path project: "value0", location: "value1", data_source_reference: "value2" + assert_equal "projects/value0/locations/value1/dataSourceReferences/value2", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", instance: "value1" + assert_equal "projects/value0/instances/value1", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_management_server_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.management_server_path project: "value0", location: "value1", managementserver: "value2" + assert_equal "projects/value0/locations/value1/managementServers/value2", path + end + end + + def test_storage_pool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.storage_pool_path project: "value0", zone: "value1", storage_pool: "value2" + assert_equal "projects/value0/zones/value1/storagePools/value2", path + end + end +end diff --git a/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_rest_test.rb b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_rest_test.rb new file mode 100644 index 000000000000..32bf479dceae --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_rest_test.rb @@ -0,0 +1,2871 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/backupdr/v1beta/backupdr_pb" +require "google/cloud/backupdr/v1beta/backupdr/rest" + + +class ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_management_servers + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListManagementServersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_management_servers_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_management_servers_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_management_servers_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_management_servers({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_management_servers parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_management_servers ::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_management_servers({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_management_servers(::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_management_servers_client_stub.call_count + end + end + end + + def test_get_management_server + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ManagementServer.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_management_server_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_management_server_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_management_server_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_management_server({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_management_server name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_management_server ::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_management_server({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_management_server(::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_management_server_client_stub.call_count + end + end + end + + def test_create_management_server + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + management_server_id = "hello world" + management_server = {} + request_id = "hello world" + + create_management_server_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_create_management_server_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_management_server_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_management_server({ parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_management_server parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_management_server ::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest.new(parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_management_server({ parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_management_server(::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest.new(parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_management_server_client_stub.call_count + end + end + end + + def test_delete_management_server + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_management_server_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_delete_management_server_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_management_server_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_management_server({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_management_server name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_management_server ::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_management_server({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_management_server(::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_management_server_client_stub.call_count + end + end + end + + def test_create_backup_vault + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_vault_id = "hello world" + backup_vault = {} + request_id = "hello world" + validate_only = true + + create_backup_vault_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_create_backup_vault_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_backup_vault({ parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_backup_vault parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_backup_vault ::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest.new(parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_backup_vault({ parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_backup_vault(::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest.new(parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_backup_vault_client_stub.call_count + end + end + end + + def test_list_backup_vaults + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + view = :BACKUP_VAULT_VIEW_UNSPECIFIED + + list_backup_vaults_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_backup_vaults_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_vaults_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_backup_vaults parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_backup_vaults ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_backup_vaults(::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_vaults_client_stub.call_count + end + end + end + + def test_fetch_usable_backup_vaults + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + fetch_usable_backup_vaults_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_fetch_usable_backup_vaults_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_usable_backup_vaults_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.fetch_usable_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.fetch_usable_backup_vaults parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.fetch_usable_backup_vaults ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.fetch_usable_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.fetch_usable_backup_vaults(::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_usable_backup_vaults_client_stub.call_count + end + end + end + + def test_get_backup_vault + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::BackupVault.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :BACKUP_VAULT_VIEW_UNSPECIFIED + + get_backup_vault_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_backup_vault_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_backup_vault({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_backup_vault name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_backup_vault ::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_backup_vault({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_backup_vault(::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_vault_client_stub.call_count + end + end + end + + def test_update_backup_vault + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + backup_vault = {} + request_id = "hello world" + validate_only = true + force = true + force_update_access_restriction = true + + update_backup_vault_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_update_backup_vault_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_backup_vault({ update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_backup_vault update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_backup_vault ::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest.new(update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_backup_vault({ update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_backup_vault(::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest.new(update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_backup_vault_client_stub.call_count + end + end + end + + def test_delete_backup_vault + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + force = true + etag = "hello world" + validate_only = true + allow_missing = true + ignore_backup_plan_references = true + + delete_backup_vault_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_delete_backup_vault_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_backup_vault({ name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_backup_vault name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_backup_vault ::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest.new(name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_backup_vault({ name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_backup_vault(::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest.new(name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_vault_client_stub.call_count + end + end + end + + def test_list_data_sources + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListDataSourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_data_sources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_data_sources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_data_sources_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_data_sources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_data_sources parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_data_sources ::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_data_sources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_data_sources(::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_data_sources_client_stub.call_count + end + end + end + + def test_get_data_source + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::DataSource.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_data_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_data_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_data_source_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_data_source({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_data_source name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_data_source ::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_data_source({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_data_source(::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_data_source_client_stub.call_count + end + end + end + + def test_update_data_source + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + data_source = {} + request_id = "hello world" + allow_missing = true + + update_data_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_update_data_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_data_source_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_data_source({ update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_data_source update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_data_source ::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest.new(update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_data_source({ update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_data_source(::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest.new(update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_data_source_client_stub.call_count + end + end + end + + def test_list_backups + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListBackupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + view = :BACKUP_VIEW_UNSPECIFIED + + list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_backups parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_backups ::Google::Cloud::BackupDR::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_backups(::Google::Cloud::BackupDR::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_count + end + end + end + + def test_fetch_backups_for_resource_type + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + resource_type = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + view = :BACKUP_VIEW_UNSPECIFIED + + fetch_backups_for_resource_type_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_fetch_backups_for_resource_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_backups_for_resource_type_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.fetch_backups_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.fetch_backups_for_resource_type parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.fetch_backups_for_resource_type ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.fetch_backups_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.fetch_backups_for_resource_type(::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_backups_for_resource_type_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::Backup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :BACKUP_VIEW_UNSPECIFIED + + get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_backup({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_backup name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_backup ::Google::Cloud::BackupDR::V1beta::GetBackupRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_backup({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_backup(::Google::Cloud::BackupDR::V1beta::GetBackupRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_count + end + end + end + + def test_update_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + backup = {} + request_id = "hello world" + + update_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_update_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_backup update_mask: update_mask, backup: backup, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_backup ::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_backup(::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_backup_client_stub.call_count + end + end + end + + def test_delete_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_backup({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_backup name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_backup ::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_backup(::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_count + end + end + end + + def test_restore_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + compute_instance_target_environment = {} + compute_instance_restore_properties = {} + name = "hello world" + request_id = "hello world" + clear_overrides_field_mask = {} + + restore_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_restore_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.restore_backup({ compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.restore_backup compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.restore_backup ::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest.new(compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.restore_backup({ compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.restore_backup(::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest.new(compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_backup_client_stub.call_count + end + end + end + + def test_create_backup_plan + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_plan_id = "hello world" + backup_plan = {} + request_id = "hello world" + + create_backup_plan_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_create_backup_plan_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_backup_plan({ parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_backup_plan parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_backup_plan ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest.new(parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_backup_plan({ parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_backup_plan(::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest.new(parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_backup_plan_client_stub.call_count + end + end + end + + def test_update_backup_plan + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + backup_plan = {} + update_mask = {} + request_id = "hello world" + + update_backup_plan_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_update_backup_plan_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_backup_plan({ backup_plan: backup_plan, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_backup_plan backup_plan: backup_plan, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_backup_plan ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest.new(backup_plan: backup_plan, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_backup_plan({ backup_plan: backup_plan, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_backup_plan(::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest.new(backup_plan: backup_plan, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_backup_plan_client_stub.call_count + end + end + end + + def test_get_backup_plan + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::BackupPlan.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_plan_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_backup_plan_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_backup_plan({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_backup_plan name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_backup_plan ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_backup_plan({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_backup_plan(::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_plan_client_stub.call_count + end + end + end + + def test_list_backup_plans + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_backup_plans_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_backup_plans_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_plans_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_backup_plans({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_backup_plans parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_backup_plans ::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_backup_plans({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_backup_plans(::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_plans_client_stub.call_count + end + end + end + + def test_delete_backup_plan + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_plan_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_delete_backup_plan_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_backup_plan({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_backup_plan name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_backup_plan ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_backup_plan({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_backup_plan(::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_plan_client_stub.call_count + end + end + end + + def test_get_backup_plan_revision + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::BackupPlanRevision.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_plan_revision_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_backup_plan_revision_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_plan_revision_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_backup_plan_revision({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_backup_plan_revision name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_backup_plan_revision ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_backup_plan_revision({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_backup_plan_revision(::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_plan_revision_client_stub.call_count + end + end + end + + def test_list_backup_plan_revisions + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_plan_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_backup_plan_revisions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_plan_revisions_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_backup_plan_revisions({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_backup_plan_revisions parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_backup_plan_revisions ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_backup_plan_revisions({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_backup_plan_revisions(::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_plan_revisions_client_stub.call_count + end + end + end + + def test_create_backup_plan_association + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_plan_association_id = "hello world" + backup_plan_association = {} + request_id = "hello world" + + create_backup_plan_association_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_create_backup_plan_association_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_backup_plan_association({ parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_backup_plan_association parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_backup_plan_association ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest.new(parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_backup_plan_association({ parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_backup_plan_association(::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest.new(parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_backup_plan_association_client_stub.call_count + end + end + end + + def test_update_backup_plan_association + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + backup_plan_association = {} + update_mask = {} + request_id = "hello world" + + update_backup_plan_association_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_update_backup_plan_association_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_backup_plan_association({ backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_backup_plan_association backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_backup_plan_association ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest.new(backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_backup_plan_association({ backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_backup_plan_association(::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest.new(backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_backup_plan_association_client_stub.call_count + end + end + end + + def test_get_backup_plan_association + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_plan_association_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_backup_plan_association_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_backup_plan_association({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_backup_plan_association name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_backup_plan_association ::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_backup_plan_association({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_backup_plan_association(::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_plan_association_client_stub.call_count + end + end + end + + def test_list_backup_plan_associations + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_backup_plan_associations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_backup_plan_associations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_plan_associations_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_backup_plan_associations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_backup_plan_associations parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_backup_plan_associations ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_backup_plan_associations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_backup_plan_associations(::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_plan_associations_client_stub.call_count + end + end + end + + def test_fetch_backup_plan_associations_for_resource_type + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + resource_type = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + fetch_backup_plan_associations_for_resource_type_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_fetch_backup_plan_associations_for_resource_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_backup_plan_associations_for_resource_type_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.fetch_backup_plan_associations_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.fetch_backup_plan_associations_for_resource_type parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.fetch_backup_plan_associations_for_resource_type ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.fetch_backup_plan_associations_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.fetch_backup_plan_associations_for_resource_type(::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_backup_plan_associations_for_resource_type_client_stub.call_count + end + end + end + + def test_delete_backup_plan_association + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + auto_protection_policy_binding = "hello world" + + delete_backup_plan_association_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_delete_backup_plan_association_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_backup_plan_association({ name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_backup_plan_association name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_backup_plan_association ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest.new(name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_backup_plan_association({ name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_backup_plan_association(::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest.new(name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_plan_association_client_stub.call_count + end + end + end + + def test_trigger_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + rule_id = "hello world" + request_id = "hello world" + custom_retention_days = 42 + labels = {} + + trigger_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_trigger_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, trigger_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.trigger_backup({ name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.trigger_backup name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.trigger_backup ::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest.new(name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.trigger_backup({ name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.trigger_backup(::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest.new(name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, trigger_backup_client_stub.call_count + end + end + end + + def test_get_data_source_reference + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::DataSourceReference.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_data_source_reference_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_data_source_reference_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_data_source_reference_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_data_source_reference({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_data_source_reference name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_data_source_reference ::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_data_source_reference({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_data_source_reference(::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_data_source_reference_client_stub.call_count + end + end + end + + def test_list_data_source_references + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_data_source_references_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_data_source_references_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_data_source_references_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_data_source_references({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_data_source_references parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_data_source_references ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_data_source_references({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_data_source_references(::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_data_source_references_client_stub.call_count + end + end + end + + def test_fetch_data_source_references_for_resource_type + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + resource_type = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + fetch_data_source_references_for_resource_type_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_fetch_data_source_references_for_resource_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_data_source_references_for_resource_type_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.fetch_data_source_references_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.fetch_data_source_references_for_resource_type parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.fetch_data_source_references_for_resource_type ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.fetch_data_source_references_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.fetch_data_source_references_for_resource_type(::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_data_source_references_for_resource_type_client_stub.call_count + end + end + end + + def test_initialize_service + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + cloud_sql_instance_initialization_config = {} + name = "hello world" + resource_type = "hello world" + request_id = "hello world" + backup_plan_location = "hello world" + validate_only = true + + initialize_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_initialize_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, initialize_service_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.initialize_service({ cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.initialize_service cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.initialize_service ::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest.new(cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.initialize_service({ cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.initialize_service(::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest.new(cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, initialize_service_client_stub.call_count + end + end + end + + def test_create_auto_protection_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + auto_protection_policy_id = "hello world" + auto_protection_policy = {} + + create_auto_protection_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_create_auto_protection_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_auto_protection_policy({ parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_auto_protection_policy parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest.new(parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_auto_protection_policy({ parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest.new(parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_auto_protection_policy_client_stub.call_count + end + end + end + + def test_list_auto_protection_policies + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_auto_protection_policies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_auto_protection_policies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_auto_protection_policies_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_auto_protection_policies parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_auto_protection_policies ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_auto_protection_policies(::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_auto_protection_policies_client_stub.call_count + end + end + end + + def test_get_auto_protection_policy + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_auto_protection_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_auto_protection_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_auto_protection_policy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_auto_protection_policy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_auto_protection_policy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_auto_protection_policy_client_stub.call_count + end + end + end + + def test_update_auto_protection_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + auto_protection_policy = {} + update_mask = {} + + update_auto_protection_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_update_auto_protection_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_auto_protection_policy({ auto_protection_policy: auto_protection_policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_auto_protection_policy auto_protection_policy: auto_protection_policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest.new(auto_protection_policy: auto_protection_policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_auto_protection_policy({ auto_protection_policy: auto_protection_policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest.new(auto_protection_policy: auto_protection_policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_auto_protection_policy_client_stub.call_count + end + end + end + + def test_delete_auto_protection_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_auto_protection_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_delete_auto_protection_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_auto_protection_policy({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_auto_protection_policy name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_auto_protection_policy({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_auto_protection_policy_client_stub.call_count + end + end + end + + def test_create_auto_protection_policy_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + auto_protection_policy_binding_id = "hello world" + auto_protection_policy_binding = {} + + create_auto_protection_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_create_auto_protection_policy_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_auto_protection_policy_binding_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_auto_protection_policy_binding({ parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_auto_protection_policy_binding parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_auto_protection_policy_binding ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest.new(parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_auto_protection_policy_binding({ parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_auto_protection_policy_binding(::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest.new(parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_auto_protection_policy_binding_client_stub.call_count + end + end + end + + def test_get_auto_protection_policy_binding + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_auto_protection_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_auto_protection_policy_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_auto_protection_policy_binding_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_auto_protection_policy_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_auto_protection_policy_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_auto_protection_policy_binding ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_auto_protection_policy_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_auto_protection_policy_binding(::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_auto_protection_policy_binding_client_stub.call_count + end + end + end + + def test_list_auto_protection_policy_bindings + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_auto_protection_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_auto_protection_policy_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_auto_protection_policy_bindings_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_auto_protection_policy_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_auto_protection_policy_bindings parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_auto_protection_policy_bindings ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_auto_protection_policy_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_auto_protection_policy_bindings(::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_auto_protection_policy_bindings_client_stub.call_count + end + end + end + + def test_list_applied_auto_protection_policies + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_applied_auto_protection_policies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_applied_auto_protection_policies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_applied_auto_protection_policies_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_applied_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_applied_auto_protection_policies parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_applied_auto_protection_policies ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_applied_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_applied_auto_protection_policies(::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_applied_auto_protection_policies_client_stub.call_count + end + end + end + + def test_initiate_delete_auto_protection_policy_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + initiate_delete_auto_protection_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_initiate_delete_auto_protection_policy_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, initiate_delete_auto_protection_policy_binding_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.initiate_delete_auto_protection_policy_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.initiate_delete_auto_protection_policy_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.initiate_delete_auto_protection_policy_binding ::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.initiate_delete_auto_protection_policy_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.initiate_delete_auto_protection_policy_binding(::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, initiate_delete_auto_protection_policy_binding_client_stub.call_count + end + end + end + + def test_get_binding_matching_resource + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::BindingMatchingResource.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_binding_matching_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_get_binding_matching_resource_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_binding_matching_resource_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_binding_matching_resource({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_binding_matching_resource name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_binding_matching_resource ::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_binding_matching_resource({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_binding_matching_resource(::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_binding_matching_resource_client_stub.call_count + end + end + end + + def test_list_binding_matching_resources + # Create test objects. + client_result = ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_binding_matching_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::ServiceStub.stub :transcode_list_binding_matching_resources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_binding_matching_resources_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_binding_matching_resources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_binding_matching_resources parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_binding_matching_resources ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_binding_matching_resources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_binding_matching_resources(::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_binding_matching_resources_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDR::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_test.rb b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_test.rb new file mode 100644 index 000000000000..4bd7fee8735b --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/google/cloud/backupdr/v1beta/backupdr_test.rb @@ -0,0 +1,3408 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/backupdr/v1beta/backupdr_pb" +require "google/cloud/backupdr/v1beta/backupdr" + +class ::Google::Cloud::BackupDR::V1beta::BackupDR::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_management_servers + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListManagementServersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_management_servers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_management_servers, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert request.has_filter? + assert_equal "hello world", request["order_by"] + assert request.has_order_by? + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_management_servers_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_management_servers({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_management_servers parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_management_servers ::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_management_servers({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_management_servers(::Google::Cloud::BackupDR::V1beta::ListManagementServersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_management_servers_client_stub.call_rpc_count + end + end + + def test_get_management_server + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ManagementServer.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_management_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_management_server, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_management_server_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_management_server({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_management_server name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_management_server ::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_management_server({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_management_server(::Google::Cloud::BackupDR::V1beta::GetManagementServerRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_management_server_client_stub.call_rpc_count + end + end + + def test_create_management_server + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + management_server_id = "hello world" + management_server = {} + request_id = "hello world" + + create_management_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_management_server, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["management_server_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::ManagementServer), request["management_server"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_management_server_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_management_server({ parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_management_server parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_management_server ::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest.new(parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_management_server({ parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_management_server(::Google::Cloud::BackupDR::V1beta::CreateManagementServerRequest.new(parent: parent, management_server_id: management_server_id, management_server: management_server, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_management_server_client_stub.call_rpc_count + end + end + + def test_delete_management_server + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_management_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_management_server, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_management_server_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_management_server({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_management_server name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_management_server ::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_management_server({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_management_server(::Google::Cloud::BackupDR::V1beta::DeleteManagementServerRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_management_server_client_stub.call_rpc_count + end + end + + def test_create_backup_vault + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_vault_id = "hello world" + backup_vault = {} + request_id = "hello world" + validate_only = true + + create_backup_vault_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_backup_vault, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["backup_vault_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::BackupVault), request["backup_vault"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_backup_vault({ parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_backup_vault parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_backup_vault ::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest.new(parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_backup_vault({ parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_backup_vault(::Google::Cloud::BackupDR::V1beta::CreateBackupVaultRequest.new(parent: parent, backup_vault_id: backup_vault_id, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_backup_vault_client_stub.call_rpc_count + end + end + + def test_list_backup_vaults + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + view = :BACKUP_VAULT_VIEW_UNSPECIFIED + + list_backup_vaults_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_vaults, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal :BACKUP_VAULT_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_vaults_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_backup_vaults parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_backup_vaults ::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_backup_vaults(::Google::Cloud::BackupDR::V1beta::ListBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_vaults_client_stub.call_rpc_count + end + end + + def test_fetch_usable_backup_vaults + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + fetch_usable_backup_vaults_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_usable_backup_vaults, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_usable_backup_vaults_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.fetch_usable_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.fetch_usable_backup_vaults parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.fetch_usable_backup_vaults ::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.fetch_usable_backup_vaults({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.fetch_usable_backup_vaults(::Google::Cloud::BackupDR::V1beta::FetchUsableBackupVaultsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_usable_backup_vaults_client_stub.call_rpc_count + end + end + + def test_get_backup_vault + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::BackupVault.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :BACKUP_VAULT_VIEW_UNSPECIFIED + + get_backup_vault_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_vault, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest, request + assert_equal "hello world", request["name"] + assert_equal :BACKUP_VAULT_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_backup_vault({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_backup_vault name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_backup_vault ::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_backup_vault({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_backup_vault(::Google::Cloud::BackupDR::V1beta::GetBackupVaultRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_vault_client_stub.call_rpc_count + end + end + + def test_update_backup_vault + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + backup_vault = {} + request_id = "hello world" + validate_only = true + force = true + force_update_access_restriction = true + + update_backup_vault_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup_vault, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::BackupVault), request["backup_vault"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal true, request["force"] + assert_equal true, request["force_update_access_restriction"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_backup_vault({ update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_backup_vault update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_backup_vault ::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest.new(update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_backup_vault({ update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_backup_vault(::Google::Cloud::BackupDR::V1beta::UpdateBackupVaultRequest.new(update_mask: update_mask, backup_vault: backup_vault, request_id: request_id, validate_only: validate_only, force: force, force_update_access_restriction: force_update_access_restriction), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_backup_vault_client_stub.call_rpc_count + end + end + + def test_delete_backup_vault + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + force = true + etag = "hello world" + validate_only = true + allow_missing = true + ignore_backup_plan_references = true + + delete_backup_vault_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup_vault, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["force"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + assert_equal true, request["ignore_backup_plan_references"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_vault_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_backup_vault({ name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_backup_vault name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_backup_vault ::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest.new(name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_backup_vault({ name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_backup_vault(::Google::Cloud::BackupDR::V1beta::DeleteBackupVaultRequest.new(name: name, request_id: request_id, force: force, etag: etag, validate_only: validate_only, allow_missing: allow_missing, ignore_backup_plan_references: ignore_backup_plan_references), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_vault_client_stub.call_rpc_count + end + end + + def test_list_data_sources + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListDataSourcesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_data_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_data_sources, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_data_sources_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_data_sources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_data_sources parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_data_sources ::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_data_sources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_data_sources(::Google::Cloud::BackupDR::V1beta::ListDataSourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_data_sources_client_stub.call_rpc_count + end + end + + def test_get_data_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::DataSource.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_data_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_data_source, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_data_source_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_data_source({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_data_source name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_data_source ::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_data_source({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_data_source(::Google::Cloud::BackupDR::V1beta::GetDataSourceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_data_source_client_stub.call_rpc_count + end + end + + def test_update_data_source + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + data_source = {} + request_id = "hello world" + allow_missing = true + + update_data_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_data_source, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::DataSource), request["data_source"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_data_source_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_data_source({ update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_data_source update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_data_source ::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest.new(update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_data_source({ update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_data_source(::Google::Cloud::BackupDR::V1beta::UpdateDataSourceRequest.new(update_mask: update_mask, data_source: data_source, request_id: request_id, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_data_source_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListBackupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + view = :BACKUP_VIEW_UNSPECIFIED + + list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backups, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListBackupsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal :BACKUP_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backups_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_backups parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_backups ::Google::Cloud::BackupDR::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_backups(::Google::Cloud::BackupDR::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_rpc_count + end + end + + def test_fetch_backups_for_resource_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + resource_type = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + view = :BACKUP_VIEW_UNSPECIFIED + + fetch_backups_for_resource_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_backups_for_resource_type, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["resource_type"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal :BACKUP_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_backups_for_resource_type_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.fetch_backups_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.fetch_backups_for_resource_type parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.fetch_backups_for_resource_type ::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.fetch_backups_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.fetch_backups_for_resource_type(::Google::Cloud::BackupDR::V1beta::FetchBackupsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_backups_for_resource_type_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::Backup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :BACKUP_VIEW_UNSPECIFIED + + get_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal :BACKUP_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_backup({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_backup name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_backup ::Google::Cloud::BackupDR::V1beta::GetBackupRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_backup({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_backup(::Google::Cloud::BackupDR::V1beta::GetBackupRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_rpc_count + end + end + + def test_update_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + backup = {} + request_id = "hello world" + + update_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::Backup), request["backup"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_backup update_mask: update_mask, backup: backup, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_backup ::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_backup(::Google::Cloud::BackupDR::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_backup({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_backup name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_backup ::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_backup(::Google::Cloud::BackupDR::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_rpc_count + end + end + + def test_restore_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + compute_instance_target_environment = {} + compute_instance_restore_properties = {} + name = "hello world" + request_id = "hello world" + clear_overrides_field_mask = {} + + restore_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_backup, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::ComputeInstanceTargetEnvironment), request["compute_instance_target_environment"] + assert_equal :compute_instance_target_environment, request.target_environment + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::ComputeInstanceRestoreProperties), request["compute_instance_restore_properties"] + assert_equal :compute_instance_restore_properties, request.instance_properties + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["clear_overrides_field_mask"] + assert request.has_clear_overrides_field_mask? + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.restore_backup({ compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.restore_backup compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.restore_backup ::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest.new(compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.restore_backup({ compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.restore_backup(::Google::Cloud::BackupDR::V1beta::RestoreBackupRequest.new(compute_instance_target_environment: compute_instance_target_environment, compute_instance_restore_properties: compute_instance_restore_properties, name: name, request_id: request_id, clear_overrides_field_mask: clear_overrides_field_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, restore_backup_client_stub.call_rpc_count + end + end + + def test_create_backup_plan + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_plan_id = "hello world" + backup_plan = {} + request_id = "hello world" + + create_backup_plan_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_backup_plan, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["backup_plan_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::BackupPlan), request["backup_plan"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_backup_plan({ parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_backup_plan parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_backup_plan ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest.new(parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_backup_plan({ parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_backup_plan(::Google::Cloud::BackupDR::V1beta::CreateBackupPlanRequest.new(parent: parent, backup_plan_id: backup_plan_id, backup_plan: backup_plan, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_backup_plan_client_stub.call_rpc_count + end + end + + def test_update_backup_plan + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + backup_plan = {} + update_mask = {} + request_id = "hello world" + + update_backup_plan_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup_plan, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::BackupPlan), request["backup_plan"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_backup_plan({ backup_plan: backup_plan, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_backup_plan backup_plan: backup_plan, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_backup_plan ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest.new(backup_plan: backup_plan, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_backup_plan({ backup_plan: backup_plan, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_backup_plan(::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanRequest.new(backup_plan: backup_plan, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_backup_plan_client_stub.call_rpc_count + end + end + + def test_get_backup_plan + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::BackupPlan.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_plan_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_plan, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_backup_plan({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_backup_plan name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_backup_plan ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_backup_plan({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_backup_plan(::Google::Cloud::BackupDR::V1beta::GetBackupPlanRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_plan_client_stub.call_rpc_count + end + end + + def test_list_backup_plans + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListBackupPlansResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_backup_plans_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_plans, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_plans_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_backup_plans({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_backup_plans parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_backup_plans ::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_backup_plans({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_backup_plans(::Google::Cloud::BackupDR::V1beta::ListBackupPlansRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_plans_client_stub.call_rpc_count + end + end + + def test_delete_backup_plan + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_plan_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup_plan, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_plan_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_backup_plan({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_backup_plan name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_backup_plan ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_backup_plan({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_backup_plan(::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_plan_client_stub.call_rpc_count + end + end + + def test_get_backup_plan_revision + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::BackupPlanRevision.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_plan_revision_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_plan_revision, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_plan_revision_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_backup_plan_revision({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_backup_plan_revision name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_backup_plan_revision ::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_backup_plan_revision({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_backup_plan_revision(::Google::Cloud::BackupDR::V1beta::GetBackupPlanRevisionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_plan_revision_client_stub.call_rpc_count + end + end + + def test_list_backup_plan_revisions + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_plan_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_plan_revisions, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_plan_revisions_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_backup_plan_revisions({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_backup_plan_revisions parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_backup_plan_revisions ::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_backup_plan_revisions({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_backup_plan_revisions(::Google::Cloud::BackupDR::V1beta::ListBackupPlanRevisionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_plan_revisions_client_stub.call_rpc_count + end + end + + def test_create_backup_plan_association + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_plan_association_id = "hello world" + backup_plan_association = {} + request_id = "hello world" + + create_backup_plan_association_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_backup_plan_association, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["backup_plan_association_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation), request["backup_plan_association"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_backup_plan_association({ parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_backup_plan_association parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_backup_plan_association ::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest.new(parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_backup_plan_association({ parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_backup_plan_association(::Google::Cloud::BackupDR::V1beta::CreateBackupPlanAssociationRequest.new(parent: parent, backup_plan_association_id: backup_plan_association_id, backup_plan_association: backup_plan_association, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_backup_plan_association_client_stub.call_rpc_count + end + end + + def test_update_backup_plan_association + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + backup_plan_association = {} + update_mask = {} + request_id = "hello world" + + update_backup_plan_association_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup_plan_association, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation), request["backup_plan_association"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_backup_plan_association({ backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_backup_plan_association backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_backup_plan_association ::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest.new(backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_backup_plan_association({ backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_backup_plan_association(::Google::Cloud::BackupDR::V1beta::UpdateBackupPlanAssociationRequest.new(backup_plan_association: backup_plan_association, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_backup_plan_association_client_stub.call_rpc_count + end + end + + def test_get_backup_plan_association + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::BackupPlanAssociation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_plan_association_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_plan_association, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_backup_plan_association({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_backup_plan_association name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_backup_plan_association ::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_backup_plan_association({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_backup_plan_association(::Google::Cloud::BackupDR::V1beta::GetBackupPlanAssociationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_plan_association_client_stub.call_rpc_count + end + end + + def test_list_backup_plan_associations + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_backup_plan_associations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_plan_associations, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_plan_associations_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_backup_plan_associations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_backup_plan_associations parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_backup_plan_associations ::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_backup_plan_associations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_backup_plan_associations(::Google::Cloud::BackupDR::V1beta::ListBackupPlanAssociationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_plan_associations_client_stub.call_rpc_count + end + end + + def test_fetch_backup_plan_associations_for_resource_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + resource_type = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + fetch_backup_plan_associations_for_resource_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_backup_plan_associations_for_resource_type, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["resource_type"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_backup_plan_associations_for_resource_type_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.fetch_backup_plan_associations_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.fetch_backup_plan_associations_for_resource_type parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.fetch_backup_plan_associations_for_resource_type ::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.fetch_backup_plan_associations_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.fetch_backup_plan_associations_for_resource_type(::Google::Cloud::BackupDR::V1beta::FetchBackupPlanAssociationsForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_backup_plan_associations_for_resource_type_client_stub.call_rpc_count + end + end + + def test_delete_backup_plan_association + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + auto_protection_policy_binding = "hello world" + + delete_backup_plan_association_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup_plan_association, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["auto_protection_policy_binding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_plan_association_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_backup_plan_association({ name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_backup_plan_association name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_backup_plan_association ::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest.new(name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_backup_plan_association({ name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_backup_plan_association(::Google::Cloud::BackupDR::V1beta::DeleteBackupPlanAssociationRequest.new(name: name, request_id: request_id, auto_protection_policy_binding: auto_protection_policy_binding), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_plan_association_client_stub.call_rpc_count + end + end + + def test_trigger_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + rule_id = "hello world" + request_id = "hello world" + custom_retention_days = 42 + labels = {} + + trigger_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :trigger_backup, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["rule_id"] + assert_equal "hello world", request["request_id"] + assert_equal 42, request["custom_retention_days"] + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, trigger_backup_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.trigger_backup({ name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.trigger_backup name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.trigger_backup ::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest.new(name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.trigger_backup({ name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.trigger_backup(::Google::Cloud::BackupDR::V1beta::TriggerBackupRequest.new(name: name, rule_id: rule_id, request_id: request_id, custom_retention_days: custom_retention_days, labels: labels), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, trigger_backup_client_stub.call_rpc_count + end + end + + def test_get_data_source_reference + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::DataSourceReference.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_data_source_reference_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_data_source_reference, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_data_source_reference_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_data_source_reference({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_data_source_reference name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_data_source_reference ::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_data_source_reference({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_data_source_reference(::Google::Cloud::BackupDR::V1beta::GetDataSourceReferenceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_data_source_reference_client_stub.call_rpc_count + end + end + + def test_list_data_source_references + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_data_source_references_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_data_source_references, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_data_source_references_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_data_source_references({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_data_source_references parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_data_source_references ::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_data_source_references({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_data_source_references(::Google::Cloud::BackupDR::V1beta::ListDataSourceReferencesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_data_source_references_client_stub.call_rpc_count + end + end + + def test_fetch_data_source_references_for_resource_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + resource_type = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + fetch_data_source_references_for_resource_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_data_source_references_for_resource_type, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["resource_type"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_data_source_references_for_resource_type_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.fetch_data_source_references_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.fetch_data_source_references_for_resource_type parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.fetch_data_source_references_for_resource_type ::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.fetch_data_source_references_for_resource_type({ parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.fetch_data_source_references_for_resource_type(::Google::Cloud::BackupDR::V1beta::FetchDataSourceReferencesForResourceTypeRequest.new(parent: parent, resource_type: resource_type, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_data_source_references_for_resource_type_client_stub.call_rpc_count + end + end + + def test_initialize_service + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + cloud_sql_instance_initialization_config = {} + name = "hello world" + resource_type = "hello world" + request_id = "hello world" + backup_plan_location = "hello world" + validate_only = true + + initialize_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :initialize_service, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::CloudSqlInstanceInitializationConfig), request["cloud_sql_instance_initialization_config"] + assert_equal :cloud_sql_instance_initialization_config, request.initialization_config + assert_equal "hello world", request["name"] + assert_equal "hello world", request["resource_type"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["backup_plan_location"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, initialize_service_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.initialize_service({ cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.initialize_service cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.initialize_service ::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest.new(cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.initialize_service({ cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.initialize_service(::Google::Cloud::BackupDR::V1beta::InitializeServiceRequest.new(cloud_sql_instance_initialization_config: cloud_sql_instance_initialization_config, name: name, resource_type: resource_type, request_id: request_id, backup_plan_location: backup_plan_location, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, initialize_service_client_stub.call_rpc_count + end + end + + def test_create_auto_protection_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + auto_protection_policy_id = "hello world" + auto_protection_policy = {} + + create_auto_protection_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_auto_protection_policy, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["auto_protection_policy_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy), request["auto_protection_policy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_auto_protection_policy({ parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_auto_protection_policy parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest.new(parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_auto_protection_policy({ parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyRequest.new(parent: parent, auto_protection_policy_id: auto_protection_policy_id, auto_protection_policy: auto_protection_policy), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_auto_protection_policy_client_stub.call_rpc_count + end + end + + def test_list_auto_protection_policies + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_auto_protection_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_auto_protection_policies, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_auto_protection_policies_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_auto_protection_policies parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_auto_protection_policies ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_auto_protection_policies(::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_auto_protection_policies_client_stub.call_rpc_count + end + end + + def test_get_auto_protection_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_auto_protection_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_auto_protection_policy, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_auto_protection_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_auto_protection_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_auto_protection_policy({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_auto_protection_policy_client_stub.call_rpc_count + end + end + + def test_update_auto_protection_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + auto_protection_policy = {} + update_mask = {} + + update_auto_protection_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_auto_protection_policy, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicy), request["auto_protection_policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_auto_protection_policy({ auto_protection_policy: auto_protection_policy, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_auto_protection_policy auto_protection_policy: auto_protection_policy, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest.new(auto_protection_policy: auto_protection_policy, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_auto_protection_policy({ auto_protection_policy: auto_protection_policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::UpdateAutoProtectionPolicyRequest.new(auto_protection_policy: auto_protection_policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_auto_protection_policy_client_stub.call_rpc_count + end + end + + def test_delete_auto_protection_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_auto_protection_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_auto_protection_policy, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_auto_protection_policy_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_auto_protection_policy({ name: name, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_auto_protection_policy name: name, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_auto_protection_policy ::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest.new(name: name, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_auto_protection_policy({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_auto_protection_policy(::Google::Cloud::BackupDR::V1beta::DeleteAutoProtectionPolicyRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_auto_protection_policy_client_stub.call_rpc_count + end + end + + def test_create_auto_protection_policy_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + auto_protection_policy_binding_id = "hello world" + auto_protection_policy_binding = {} + + create_auto_protection_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_auto_protection_policy_binding, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["auto_protection_policy_binding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding), request["auto_protection_policy_binding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_auto_protection_policy_binding_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_auto_protection_policy_binding({ parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_auto_protection_policy_binding parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_auto_protection_policy_binding ::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest.new(parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_auto_protection_policy_binding({ parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_auto_protection_policy_binding(::Google::Cloud::BackupDR::V1beta::CreateAutoProtectionPolicyBindingRequest.new(parent: parent, auto_protection_policy_binding_id: auto_protection_policy_binding_id, auto_protection_policy_binding: auto_protection_policy_binding), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_auto_protection_policy_binding_client_stub.call_rpc_count + end + end + + def test_get_auto_protection_policy_binding + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::AutoProtectionPolicyBinding.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_auto_protection_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_auto_protection_policy_binding, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_auto_protection_policy_binding_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_auto_protection_policy_binding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_auto_protection_policy_binding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_auto_protection_policy_binding ::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_auto_protection_policy_binding({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_auto_protection_policy_binding(::Google::Cloud::BackupDR::V1beta::GetAutoProtectionPolicyBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_auto_protection_policy_binding_client_stub.call_rpc_count + end + end + + def test_list_auto_protection_policy_bindings + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_auto_protection_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_auto_protection_policy_bindings, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_auto_protection_policy_bindings_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_auto_protection_policy_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_auto_protection_policy_bindings parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_auto_protection_policy_bindings ::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_auto_protection_policy_bindings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_auto_protection_policy_bindings(::Google::Cloud::BackupDR::V1beta::ListAutoProtectionPolicyBindingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_auto_protection_policy_bindings_client_stub.call_rpc_count + end + end + + def test_list_applied_auto_protection_policies + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_applied_auto_protection_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_applied_auto_protection_policies, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_applied_auto_protection_policies_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_applied_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_applied_auto_protection_policies parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_applied_auto_protection_policies ::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_applied_auto_protection_policies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_applied_auto_protection_policies(::Google::Cloud::BackupDR::V1beta::ListAppliedAutoProtectionPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_applied_auto_protection_policies_client_stub.call_rpc_count + end + end + + def test_initiate_delete_auto_protection_policy_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + initiate_delete_auto_protection_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :initiate_delete_auto_protection_policy_binding, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, initiate_delete_auto_protection_policy_binding_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.initiate_delete_auto_protection_policy_binding({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.initiate_delete_auto_protection_policy_binding name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.initiate_delete_auto_protection_policy_binding ::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.initiate_delete_auto_protection_policy_binding({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.initiate_delete_auto_protection_policy_binding(::Google::Cloud::BackupDR::V1beta::InitiateDeleteAutoProtectionPolicyBindingRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, initiate_delete_auto_protection_policy_binding_client_stub.call_rpc_count + end + end + + def test_get_binding_matching_resource + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::BindingMatchingResource.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_binding_matching_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_binding_matching_resource, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_binding_matching_resource_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_binding_matching_resource({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_binding_matching_resource name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_binding_matching_resource ::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_binding_matching_resource({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_binding_matching_resource(::Google::Cloud::BackupDR::V1beta::GetBindingMatchingResourceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_binding_matching_resource_client_stub.call_rpc_count + end + end + + def test_list_binding_matching_resources + # Create GRPC objects. + grpc_response = ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_binding_matching_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_binding_matching_resources, name + assert_kind_of ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_binding_matching_resources_client_stub do + # Create client + c = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_binding_matching_resources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_binding_matching_resources parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_binding_matching_resources ::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_binding_matching_resources({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_binding_matching_resources(::Google::Cloud::BackupDR::V1beta::ListBindingMatchingResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_binding_matching_resources_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDR::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDR::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::BackupDR::V1beta::BackupDR::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::BackupDR::V1beta::BackupDR::Operations, client.operations_client + end +end diff --git a/google-cloud-backupdr-v1beta/test/helper.rb b/google-cloud-backupdr-v1beta/test/helper.rb new file mode 100644 index 000000000000..4fb6756ac7e2 --- /dev/null +++ b/google-cloud-backupdr-v1beta/test/helper.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Load JUnit XML formatter from googleapis/ruby-common-tools to write +# tmp/reports/sponge_log.xml for Kokoro/TestGrid build health tracking. +if ENV["CI"] || ENV["KOKORO_JOB_NAME"] + begin + require "gapic/minitest_junit_preloader" + rescue LoadError + end +end + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/librarian.yaml b/librarian.yaml index 06d415d791eb..c4c870e4a4d6 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -512,6 +512,14 @@ libraries: ruby_cloud_opts: ruby-cloud-namespace-override: Backupdr=BackupDR ruby-cloud-path-override: backup_dr=backupdr + - name: google-cloud-backupdr-v1beta + version: 0.0.1 + apis: + - path: google/cloud/backupdr/v1beta + ruby: + ruby_cloud_opts: + ruby-cloud-namespace-override: Backupdr=BackupDR + ruby-cloud-path-override: backup_dr=backupdr - name: google-cloud-bare_metal_solution version: 2.2.1 apis: diff --git a/release-please-config.json b/release-please-config.json index 07273ba19d1f..21135946198e 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -257,6 +257,10 @@ "component": "google-cloud-backupdr-v1", "version_file": "lib/google/cloud/backupdr/v1/version.rb" }, + "google-cloud-backupdr-v1beta": { + "component": "google-cloud-backupdr-v1beta", + "version_file": "lib/google/cloud/backupdr/v1beta/version.rb" + }, "google-cloud-bare_metal_solution": { "component": "google-cloud-bare_metal_solution", "version_file": "lib/google/cloud/bare_metal_solution/version.rb"