From 3b5021f698e96fb8cf9076a5ce5306ea47917bef Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 7 Oct 2024 19:03:41 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20post-p?= =?UTF-8?q?rocessor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- BackupDr/metadata/V1/Backupdr.php | Bin 5611 -> 11158 bytes .../metadata}/V1/Backupplan.php | Bin .../metadata}/V1/Backupplanassociation.php | Bin .../metadata}/V1/Backupvault.php | Bin .../metadata}/V1/BackupvaultBa.php | Bin .../metadata}/V1/BackupvaultGce.php | Bin .../V1/BackupDRClient/create_backup_plan.php | 0 .../create_backup_plan_association.php | 0 .../V1/BackupDRClient/create_backup_vault.php | 0 .../create_management_server.php | 4 +- .../V1/BackupDRClient/delete_backup.php | 0 .../V1/BackupDRClient/delete_backup_plan.php | 0 .../delete_backup_plan_association.php | 0 .../V1/BackupDRClient/delete_backup_vault.php | 0 .../fetch_usable_backup_vaults.php | 0 .../samples/V1/BackupDRClient/get_backup.php | 0 .../V1/BackupDRClient/get_backup_plan.php | 0 .../get_backup_plan_association.php | 0 .../V1/BackupDRClient/get_backup_vault.php | 0 .../V1/BackupDRClient/get_data_source.php | 0 .../BackupDRClient/get_management_server.php | 2 +- .../list_backup_plan_associations.php | 0 .../V1/BackupDRClient/list_backup_plans.php | 0 .../V1/BackupDRClient/list_backup_vaults.php | 0 .../V1/BackupDRClient/list_backups.php | 0 .../V1/BackupDRClient/list_data_sources.php | 0 .../list_management_servers.php | 9 +- .../V1/BackupDRClient/restore_backup.php | 0 .../V1/BackupDRClient/trigger_backup.php | 0 .../V1/BackupDRClient/update_backup.php | 0 .../V1/BackupDRClient/update_backup_vault.php | 0 .../V1/BackupDRClient/update_data_source.php | 0 .../src}/V1/AcceleratorConfig.php | 0 .../src}/V1/AccessConfig.php | 0 .../src}/V1/AccessConfig/AccessType.php | 2 - .../src}/V1/AccessConfig/NetworkTier.php | 2 - .../src}/V1/AdvancedMachineFeatures.php | 0 .../src}/V1/AliasIpRange.php | 0 .../src}/V1/AllocationAffinity.php | 0 .../src}/V1/AllocationAffinity/Type.php | 2 - .../src}/V1/AttachedDisk.php | 0 .../src}/V1/AttachedDisk/DiskInterface.php | 2 - .../src}/V1/AttachedDisk/DiskMode.php | 2 - .../src}/V1/AttachedDisk/DiskSavedState.php | 2 - .../src}/V1/AttachedDisk/DiskType.php | 2 - .../src}/V1/AttachedDisk/InitializeParams.php | 2 - .../BackupDR => BackupDr/src}/V1/Backup.php | 0 .../src}/V1/Backup/BackupType.php | 2 - .../src}/V1/Backup/GCPBackupPlanInfo.php | 2 - .../src}/V1/Backup/State.php | 2 - .../src}/V1/BackupApplianceBackupConfig.php | 0 .../V1/BackupApplianceBackupProperties.php | 0 .../src}/V1/BackupApplianceLockInfo.php | 0 .../src}/V1/BackupConfigInfo.php | 0 .../V1/BackupConfigInfo/LastBackupState.php | 2 - .../src}/V1/BackupConfigState.php | 0 .../src}/V1/BackupLock.php | 0 .../src}/V1/BackupPlan.php | 0 .../src}/V1/BackupPlan/State.php | 2 - .../src}/V1/BackupPlanAssociation.php | 0 .../src}/V1/BackupPlanAssociation/State.php | 2 - .../src}/V1/BackupRule.php | 0 .../src}/V1/BackupVault.php | 0 .../src}/V1/BackupVault/AccessRestriction.php | 2 - .../src}/V1/BackupVault/State.php | 2 - .../src}/V1/BackupVaultView.php | 0 .../src}/V1/BackupView.php | 0 .../src}/V1/BackupWindow.php | 0 BackupDr/src/V1/Client/BackupDRClient.php | 779 ++++ .../V1/ComputeInstanceBackupProperties.php | 0 .../ComputeInstanceDataSourceProperties.php | 0 .../V1/ComputeInstanceRestoreProperties.php | 0 .../InstancePrivateIpv6GoogleAccess.php | 2 - .../V1/ComputeInstanceTargetEnvironment.php | 0 .../src}/V1/ConfidentialInstanceConfig.php | 0 .../V1/CreateBackupPlanAssociationRequest.php | 0 .../src}/V1/CreateBackupPlanRequest.php | 0 .../src}/V1/CreateBackupVaultRequest.php | 0 .../src/V1/CreateManagementServerRequest.php | 20 +- .../src}/V1/CustomerEncryptionKey.php | 0 .../src}/V1/DataSource.php | 0 .../src}/V1/DataSource/State.php | 2 - .../DataSourceBackupApplianceApplication.php | 0 .../src}/V1/DataSourceGcpResource.php | 0 .../V1/DeleteBackupPlanAssociationRequest.php | 0 .../src}/V1/DeleteBackupPlanRequest.php | 0 .../src}/V1/DeleteBackupRequest.php | 0 .../src}/V1/DeleteBackupVaultRequest.php | 0 .../src}/V1/DisplayDevice.php | 0 .../BackupDR => BackupDr/src}/V1/Entry.php | 0 .../V1/FetchUsableBackupVaultsRequest.php | 0 .../V1/FetchUsableBackupVaultsResponse.php | 0 .../src}/V1/GcpBackupConfig.php | 0 .../src}/V1/GcpResource.php | 0 .../V1/GetBackupPlanAssociationRequest.php | 0 .../src}/V1/GetBackupPlanRequest.php | 0 .../src}/V1/GetBackupRequest.php | 0 .../src}/V1/GetBackupVaultRequest.php | 0 .../src}/V1/GetDataSourceRequest.php | 0 .../src/V1/GetManagementServerRequest.php | 10 +- .../src}/V1/GuestOsFeature.php | 0 .../src}/V1/GuestOsFeature/FeatureType.php | 2 - .../src}/V1/InstanceParams.php | 0 .../src}/V1/KeyRevocationActionType.php | 0 .../V1/ListBackupPlanAssociationsRequest.php | 0 .../V1/ListBackupPlanAssociationsResponse.php | 0 .../src}/V1/ListBackupPlansRequest.php | 0 .../src}/V1/ListBackupPlansResponse.php | 0 .../src}/V1/ListBackupVaultsRequest.php | 0 .../src}/V1/ListBackupVaultsResponse.php | 0 .../src}/V1/ListBackupsRequest.php | 0 .../src}/V1/ListBackupsResponse.php | 0 .../src}/V1/ListDataSourcesRequest.php | 0 .../src}/V1/ListDataSourcesResponse.php | 0 .../src/V1/ListManagementServersRequest.php | 45 +- .../src/V1/ListManagementServersResponse.php | 8 +- BackupDr/src/V1/ManagementServer.php | 8 +- .../BackupDR => BackupDr/src}/V1/Metadata.php | 0 .../src}/V1/NetworkInterface.php | 0 .../V1/NetworkInterface/Ipv6AccessType.php | 2 - .../src}/V1/NetworkInterface/NicType.php | 2 - .../src}/V1/NetworkInterface/StackType.php | 2 - .../src}/V1/NetworkPerformanceConfig.php | 0 .../src}/V1/NetworkPerformanceConfig/Tier.php | 2 - BackupDr/src/V1/OperationMetadata.php | 8 +- .../src}/V1/RestoreBackupRequest.php | 0 .../src}/V1/RestoreBackupResponse.php | 0 .../src}/V1/RuleConfigInfo.php | 0 .../V1/RuleConfigInfo/LastBackupState.php | 2 - .../src}/V1/Scheduling.php | 0 .../Scheduling/InstanceTerminationAction.php | 2 - .../src}/V1/Scheduling/NodeAffinity.php | 2 - .../V1/Scheduling/NodeAffinity/Operator.php | 2 - .../src}/V1/Scheduling/OnHostMaintenance.php | 2 - .../src}/V1/Scheduling/ProvisioningModel.php | 2 - .../src}/V1/SchedulingDuration.php | 0 .../src}/V1/ServiceAccount.php | 0 .../src}/V1/ServiceLockInfo.php | 0 .../src}/V1/StandardSchedule.php | 0 .../V1/StandardSchedule/RecurrenceType.php | 2 - .../BackupDR => BackupDr/src}/V1/Tags.php | 0 .../src}/V1/TargetResource.php | 0 .../src}/V1/TriggerBackupRequest.php | 0 .../src}/V1/UpdateBackupRequest.php | 0 .../src}/V1/UpdateBackupVaultRequest.php | 0 .../src}/V1/UpdateDataSourceRequest.php | 0 .../src}/V1/WeekDayOfMonth.php | 0 .../src}/V1/WeekDayOfMonth/WeekOfMonth.php | 2 - BackupDr/src/V1/gapic_metadata.json | 115 + .../V1/resources/backup_dr_client_config.json | 115 + .../resources/backup_dr_descriptor_config.php | 416 ++ .../backup_dr_rest_client_config.php | 282 ++ .../Unit/V1/Client/BackupDRClientTest.php | 2800 +++++++++++++- .../Google/Cloud/Backupdr/V1/Backupdr.php | Bin 11158 -> 0 bytes .../V1/CreateManagementServerRequest.php | 257 -- .../V1/DeleteManagementServerRequest.php | 155 - .../V1/GetManagementServerRequest.php | 86 - .../V1/ListManagementServersRequest.php | 266 -- .../V1/ListManagementServersResponse.php | 159 - .../Cloud/BackupDR/V1/ManagementServer.php | 716 ---- .../V1/ManagementServer/InstanceState.php | 102 - .../V1/ManagementServer/InstanceType.php | 57 - .../Cloud/BackupDR/V1/ManagementURI.php | 101 - .../Cloud/BackupDR/V1/NetworkConfig.php | 109 - .../BackupDR/V1/NetworkConfig/PeeringMode.php | 59 - .../Cloud/BackupDR/V1/OperationMetadata.php | 345 -- .../WorkforceIdentityBasedManagementURI.php | 101 - .../WorkforceIdentityBasedOAuth2ClientID.php | 101 - .../create_management_server.php | 96 - .../delete_management_server.php | 84 - .../V1/BackupDRClient/get_iam_policy.php | 72 - .../V1/BackupDRClient/get_location.php | 57 - .../BackupDRClient/get_management_server.php | 76 - .../V1/BackupDRClient/list_locations.php | 62 - .../list_management_servers.php | 81 - .../V1/BackupDRClient/set_iam_policy.php | 77 - .../BackupDRClient/test_iam_permissions.php | 84 - .../v1/src/V1/Client/BackupDRClient.php | 1307 ------- .../BackupDr/v1/src/V1/gapic_metadata.json | 178 - .../V1/resources/backup_dr_client_config.json | 204 - .../resources/backup_dr_descriptor_config.php | 591 --- .../backup_dr_rest_client_config.php | 467 --- .../Unit/V1/Client/BackupDRClientTest.php | 3373 ----------------- 183 files changed, 4435 insertions(+), 9671 deletions(-) rename {owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr => BackupDr/metadata}/V1/Backupplan.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr => BackupDr/metadata}/V1/Backupplanassociation.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr => BackupDr/metadata}/V1/Backupvault.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr => BackupDr/metadata}/V1/BackupvaultBa.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr => BackupDr/metadata}/V1/BackupvaultGce.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/create_backup_plan.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/create_backup_plan_association.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/create_backup_vault.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/delete_backup.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/delete_backup_plan.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/delete_backup_plan_association.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/delete_backup_vault.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/get_backup.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/get_backup_plan.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/get_backup_plan_association.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/get_backup_vault.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/get_data_source.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/list_backup_plan_associations.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/list_backup_plans.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/list_backup_vaults.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/list_backups.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/list_data_sources.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/restore_backup.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/trigger_backup.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/update_backup.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/update_backup_vault.php (100%) rename {owl-bot-staging/BackupDr/v1 => BackupDr}/samples/V1/BackupDRClient/update_data_source.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AcceleratorConfig.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AccessConfig.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AccessConfig/AccessType.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AccessConfig/NetworkTier.php (91%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AdvancedMachineFeatures.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AliasIpRange.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AllocationAffinity.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AllocationAffinity/Type.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AttachedDisk.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AttachedDisk/DiskInterface.php (91%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AttachedDisk/DiskMode.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AttachedDisk/DiskSavedState.php (89%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AttachedDisk/DiskType.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/AttachedDisk/InitializeParams.php (95%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Backup.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Backup/BackupType.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Backup/GCPBackupPlanInfo.php (95%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Backup/State.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupApplianceBackupConfig.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupApplianceBackupProperties.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupApplianceLockInfo.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupConfigInfo.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupConfigInfo/LastBackupState.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupConfigState.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupLock.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupPlan.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupPlan/State.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupPlanAssociation.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupPlanAssociation/State.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupRule.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupVault.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupVault/AccessRestriction.php (91%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupVault/State.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupVaultView.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupView.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/BackupWindow.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ComputeInstanceBackupProperties.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ComputeInstanceDataSourceProperties.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ComputeInstanceRestoreProperties.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ComputeInstanceTargetEnvironment.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ConfidentialInstanceConfig.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/CreateBackupPlanAssociationRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/CreateBackupPlanRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/CreateBackupVaultRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/CustomerEncryptionKey.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DataSource.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DataSource/State.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DataSourceBackupApplianceApplication.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DataSourceGcpResource.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DeleteBackupPlanAssociationRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DeleteBackupPlanRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DeleteBackupRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DeleteBackupVaultRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/DisplayDevice.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Entry.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/FetchUsableBackupVaultsRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/FetchUsableBackupVaultsResponse.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GcpBackupConfig.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GcpResource.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GetBackupPlanAssociationRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GetBackupPlanRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GetBackupRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GetBackupVaultRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GetDataSourceRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GuestOsFeature.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/GuestOsFeature/FeatureType.php (96%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/InstanceParams.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/KeyRevocationActionType.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupPlanAssociationsRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupPlanAssociationsResponse.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupPlansRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupPlansResponse.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupVaultsRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupVaultsResponse.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupsRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListBackupsResponse.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListDataSourcesRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ListDataSourcesResponse.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Metadata.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/NetworkInterface.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/NetworkInterface/Ipv6AccessType.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/NetworkInterface/NicType.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/NetworkInterface/StackType.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/NetworkPerformanceConfig.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/NetworkPerformanceConfig/Tier.php (91%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/RestoreBackupRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/RestoreBackupResponse.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/RuleConfigInfo.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/RuleConfigInfo/LastBackupState.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Scheduling.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Scheduling/InstanceTerminationAction.php (89%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Scheduling/NodeAffinity.php (96%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Scheduling/NodeAffinity/Operator.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Scheduling/OnHostMaintenance.php (91%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Scheduling/ProvisioningModel.php (90%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/SchedulingDuration.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ServiceAccount.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/ServiceLockInfo.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/StandardSchedule.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/StandardSchedule/RecurrenceType.php (92%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/Tags.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/TargetResource.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/TriggerBackupRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/UpdateBackupRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/UpdateBackupVaultRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/UpdateDataSourceRequest.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/WeekDayOfMonth.php (100%) rename {owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR => BackupDr/src}/V1/WeekDayOfMonth/WeekOfMonth.php (92%) delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupdr.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateManagementServerRequest.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteManagementServerRequest.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetManagementServerRequest.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersRequest.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersResponse.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceState.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceType.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementURI.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig/PeeringMode.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedManagementURI.php delete mode 100644 owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedOAuth2ClientID.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_management_server.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_management_server.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_iam_policy.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_location.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_management_server.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_locations.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_management_servers.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/set_iam_policy.php delete mode 100644 owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/BackupDr/v1/src/V1/Client/BackupDRClient.php delete mode 100644 owl-bot-staging/BackupDr/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_client_config.json delete mode 100644 owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_descriptor_config.php delete mode 100644 owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_rest_client_config.php delete mode 100644 owl-bot-staging/BackupDr/v1/tests/Unit/V1/Client/BackupDRClientTest.php diff --git a/BackupDr/metadata/V1/Backupdr.php b/BackupDr/metadata/V1/Backupdr.php index ad9d53d4795104ebe54e55f0f4947c64580359cd..fde6b0d8cfbdf7d0c8a52d61ff14ec9a42a21a7e 100644 GIT binary patch literal 11158 zcmb_iO>7&-70!ybEDilbj}x1b?PNncuuRxwr2NyiVoIbH+LlC6KY?B0B*wcSFO)J4NG9NjY-YHeTjwhguA*q&Xtn`*7SxoJ3R-QH=L zO~c8kYGFlPURhI%h0@wf;Og3Kr*7obE!*B|8rgc&Za1YB<^58UJ^Nj){<^ z?-*`NuN&%Od49?8^oH)~)kW%FT_En&dG21_n7M&ay{WsdDz2eNNQHl`cCBgFRoBx! z`0ujmYNlm+rrtC^1QfT_O}*(F;M{Aw*|zGQXEzfq!V4BNq8J@p< zX*-8-Em@oPXl@mQGi+#VJsjeEYBhCh___Oy0(`XVCSCKVA8=Q1H%Hio`?j^^v@OfD zwyG;FlC`7lyiaJLQ*o!|?GKN@cU?0fg*|Xjjt2Pc_fhDuaMNK|HbX6hUtLT{NMU?eM;SWUes-Pk15*J_;m z+~9nVfe8%fH=mboI-JJ*)>VFs#^Ot4AeV%z-1M~}OeI2cuk-*f$~ta)iQ6^hjGERqgYaWGfnvZh8Z`wJOYNac?*Zsd8;WSD0lucU zKd-w+qjR+C6*RSJIXm%k+n#0R zp;W+E(FJ*GTPJrlmM5Coknw@3Ja><&H2bFrB?64AhO=upu<1ugd%%Yr|2z+yK7o@c z-rz+Sv@SU*ASn1A8gJ?~qv>JTU=$%j)A7Ax5Zn-6chM1Vzhxv(QvSXvCh3u;Oi$P)3zQeSmNjr^ zaTn0ZE;__%5Y;Qg3=3RkKwOYgl7Eznu&<1ZT8)sgn{Np^!L8`=!-*Au@n^k{j*|Y! zNFJjr@mBPZfiojZMy$jt@n;z3&;%C^H#tEW(Qgqtw1EsThEJm-(2;H>Pe3$WaxS7o z506iY+cCV0u12m}kKbv!ZgbHf!`H1dAsN)?(eawD0V_Y)rxJhxE=z0-TI51o;6lZ6 zwbqAj@(i7}m&)_du5RefHebD|PCqmGEci{(>87ruxRfwBj$#jueU_*A1UkA)Mq#>^ z8+%Jh<wMubyZKYBKMg15`f*6Bt zF@6C}`Gde%Aj6&dd>lMvK zisgKXh<@TIK84~-`O@-Qahb%L7$?INE0vW>;#lsd%9r_{C}`Sm9az-?MRzmsfRycK zD83Kd^DU$9x!Fhj*Fm;v*ICP!eI$M!WP|)=+y;l>l1sJmAbmQx#I0r%-Ir4TP|$_@ zrt2;F1%lgFjQ88nwBg%m97+fzHy7Dgfc9VI(|CAPXVGK}3Z3S{qZZxrql6*~K8Fy! z?%59wD@lZqXHXK2Z<;goAa_*z&mmmsE&!bnbO882~zE86S|63uqZCTEL*T$J-W^ ziu$%*YZ?F*QZH4lqNzorXW_-V&vleGzUsqsDfKUay+F%TcbsB|r{CF^(6c=YM=HEu zw#V>YB+-zsE#2#pmX?Vv5XNDwB$EW(NPU1V7L2Ch8BtK5axn>2rI~$rO6tckblQKa z5{DC{#><@n=|_jC@iS<`uo@#Z6VNnzx&tQ)LHfi_^yhrpShlb#B6OM`)3(o>P@%d5vX(J8&rfU^`EPCMXK zWz*)R^quI`=~=Q2Jh|~9$RoesWyPjmM`uFr4Js(JPqJu&9RU?8_%8~2E>r?=p9V10 zf#=RtpAIa-k7-Tn&XYXX(~my;;)i2z;@8PT+#@Ejw|xCiOS+#9(R=(m1)T{|5Bys6 zqKB9ZI3uWBs_-OFo9>SINf#aweMqrNAK*{M(AjW#!hO~@+(V$aD6mTprWv1Vsh=y4 z^Dl=yMD!-`ll*nIA=i53t@jFO5nYPAsl#n$u2&%OKNWN~T+#ZiPPoUAtMmTjd>TE+ zpNoNq^b|8gPkeCL3P~JDGvFh0;C~7_&32S!>IOO4!n0x*dmnCkjEBVbG3>mG;_@tE zkS_5}XZ@N+k36o)e~7KVoqA=MtYxkgm79a^o1Ag8QSomTlpsPePcJePJQIz)+g1SY zvsk?@T!QkQ5;TiP27~{upmTQ&ufDzRl8&YWMW08q2p0k7?P&awo*dIsC#E@kbL0)$ z4DjGzDCi`}rGyJ-ql4?T6lh+Kc96zRy(7!1*o%ItRFf!^1tt9ovS^*2C`iNh%c34* z5%B>1{QhuRlw<+&^xp=!rBqyfmSYLaCL`Ji3kN2Imn!j%FeT zjLec3bRz0s!&5orM=%%8MC0f%6euo7+XthjKmdY@B*Gqk$>o?yQhhXr5-d-GIr`~y zx2*_%KuUcADfJ>k(i~xR>0ARARAaBTu5~BWgW0=uizJ&7@~I1VE-np&|D?bnj$fo) zd@Xt>Br^g1`jFO~c@H|7cNf1qGV{8?a9+CjR|=Z+H5&Knb$ug&L5;@1^d|M5%sUbE zVR1KWnICBoem{Zb(ya~BkFT?A}e)8FEJ0$S$G5KU9rgMZ5`K8Xbp1dj*T|N0N zn)0kxhaM0k~IB7 zK~q6j)dkAMH==0~?Im#a;Z#3op2zn(^H{(fI*(L{5 z6a8lTY4(>VEzO{UZ|AGL1tO`##`(#QGE6TFJHH8UdrLCQ;0render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + 'datasource' => $datasource, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup_plan + * resource. + * + * @param string $project + * @param string $location + * @param string $backupPlan + * + * @return string The formatted backup_plan resource. + */ + public static function backupPlanName(string $project, string $location, string $backupPlan): string + { + return self::getPathTemplate('backupPlan')->render([ + 'project' => $project, + 'location' => $location, + 'backup_plan' => $backupPlan, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * backup_plan_association resource. + * + * @param string $project + * @param string $location + * @param string $backupPlanAssociation + * + * @return string The formatted backup_plan_association resource. + */ + public static function backupPlanAssociationName( + string $project, + string $location, + string $backupPlanAssociation + ): string { + return self::getPathTemplate('backupPlanAssociation')->render([ + 'project' => $project, + 'location' => $location, + 'backup_plan_association' => $backupPlanAssociation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup_vault + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * + * @return string The formatted backup_vault resource. + */ + public static function backupVaultName(string $project, string $location, string $backupvault): string + { + return self::getPathTemplate('backupVault')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_source + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * @param string $datasource + * + * @return string The formatted data_source resource. + */ + public static function dataSourceName( + string $project, + string $location, + string $backupvault, + string $datasource + ): string { + return self::getPathTemplate('dataSource')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + 'datasource' => $datasource, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -210,6 +374,11 @@ public static function managementServerName(string $project, string $location, s * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - backup: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup} + * - backupPlan: projects/{project}/locations/{location}/backupPlans/{backup_plan} + * - backupPlanAssociation: projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association} + * - backupVault: projects/{project}/locations/{location}/backupVaults/{backupvault} + * - dataSource: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} * - location: projects/{project}/locations/{location} * - managementServer: projects/{project}/locations/{location}/managementServers/{managementserver} * @@ -303,6 +472,86 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * Create a BackupPlan + * + * The async variant is {@see BackupDRClient::createBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_plan.php + * + * @param CreateBackupPlanRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupPlan(CreateBackupPlanRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Create a BackupPlanAssociation + * + * The async variant is {@see BackupDRClient::createBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_plan_association.php + * + * @param CreateBackupPlanAssociationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupPlanAssociation( + CreateBackupPlanAssociationRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Creates a new BackupVault in a given project and location. + * + * The async variant is {@see BackupDRClient::createBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_vault.php + * + * @param CreateBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupVault(CreateBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackupVault', $request, $callOptions)->wait(); + } + /** * Creates a new ManagementServer in a given project and location. * @@ -331,6 +580,112 @@ public function createManagementServer( return $this->startApiCall('CreateManagementServer', $request, $callOptions)->wait(); } + /** + * Deletes a Backup. + * + * The async variant is {@see BackupDRClient::deleteBackupAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup.php + * + * @param DeleteBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackup(DeleteBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackup', $request, $callOptions)->wait(); + } + + /** + * Deletes a single BackupPlan. + * + * The async variant is {@see BackupDRClient::deleteBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_plan.php + * + * @param DeleteBackupPlanRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupPlan(DeleteBackupPlanRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Deletes a single BackupPlanAssociation. + * + * The async variant is {@see BackupDRClient::deleteBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_plan_association.php + * + * @param DeleteBackupPlanAssociationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupPlanAssociation( + DeleteBackupPlanAssociationRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Deletes a BackupVault. + * + * The async variant is {@see BackupDRClient::deleteBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_vault.php + * + * @param DeleteBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupVault(DeleteBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackupVault', $request, $callOptions)->wait(); + } + /** * Deletes a single ManagementServer. * @@ -359,6 +714,168 @@ public function deleteManagementServer( return $this->startApiCall('DeleteManagementServer', $request, $callOptions)->wait(); } + /** + * FetchUsableBackupVaults lists usable BackupVaults in a given project and + * location. Usable BackupVault are the ones that user has + * backupdr.backupVaults.get permission. + * + * The async variant is {@see BackupDRClient::fetchUsableBackupVaultsAsync()} . + * + * @example samples/V1/BackupDRClient/fetch_usable_backup_vaults.php + * + * @param FetchUsableBackupVaultsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchUsableBackupVaults( + FetchUsableBackupVaultsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('FetchUsableBackupVaults', $request, $callOptions); + } + + /** + * Gets details of a Backup. + * + * The async variant is {@see BackupDRClient::getBackupAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup.php + * + * @param GetBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Backup + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackup(GetBackupRequest $request, array $callOptions = []): Backup + { + return $this->startApiCall('GetBackup', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single BackupPlan. + * + * The async variant is {@see BackupDRClient::getBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_plan.php + * + * @param GetBackupPlanRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackupPlan + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupPlan(GetBackupPlanRequest $request, array $callOptions = []): BackupPlan + { + return $this->startApiCall('GetBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single BackupPlanAssociation. + * + * The async variant is {@see BackupDRClient::getBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_plan_association.php + * + * @param GetBackupPlanAssociationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackupPlanAssociation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupPlanAssociation( + GetBackupPlanAssociationRequest $request, + array $callOptions = [] + ): BackupPlanAssociation { + return $this->startApiCall('GetBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Gets details of a BackupVault. + * + * The async variant is {@see BackupDRClient::getBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_vault.php + * + * @param GetBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackupVault + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupVault(GetBackupVaultRequest $request, array $callOptions = []): BackupVault + { + return $this->startApiCall('GetBackupVault', $request, $callOptions)->wait(); + } + + /** + * Gets details of a DataSource. + * + * The async variant is {@see BackupDRClient::getDataSourceAsync()} . + * + * @example samples/V1/BackupDRClient/get_data_source.php + * + * @param GetDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DataSource + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataSource(GetDataSourceRequest $request, array $callOptions = []): DataSource + { + return $this->startApiCall('GetDataSource', $request, $callOptions)->wait(); + } + /** * Gets details of a single ManagementServer. * @@ -385,6 +902,138 @@ public function getManagementServer(GetManagementServerRequest $request, array $ return $this->startApiCall('GetManagementServer', $request, $callOptions)->wait(); } + /** + * Lists BackupPlanAssociations in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupPlanAssociationsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_plan_associations.php + * + * @param ListBackupPlanAssociationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupPlanAssociations( + ListBackupPlanAssociationsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListBackupPlanAssociations', $request, $callOptions); + } + + /** + * Lists BackupPlans in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupPlansAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_plans.php + * + * @param ListBackupPlansRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupPlans(ListBackupPlansRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackupPlans', $request, $callOptions); + } + + /** + * Lists BackupVaults in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupVaultsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_vaults.php + * + * @param ListBackupVaultsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupVaults(ListBackupVaultsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackupVaults', $request, $callOptions); + } + + /** + * Lists Backups in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backups.php + * + * @param ListBackupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackups(ListBackupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackups', $request, $callOptions); + } + + /** + * Lists DataSources in a given project and location. + * + * The async variant is {@see BackupDRClient::listDataSourcesAsync()} . + * + * @example samples/V1/BackupDRClient/list_data_sources.php + * + * @param ListDataSourcesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDataSources(ListDataSourcesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataSources', $request, $callOptions); + } + /** * Lists ManagementServers in a given project and location. * @@ -413,6 +1062,136 @@ public function listManagementServers( return $this->startApiCall('ListManagementServers', $request, $callOptions); } + /** + * Restore from a Backup + * + * The async variant is {@see BackupDRClient::restoreBackupAsync()} . + * + * @example samples/V1/BackupDRClient/restore_backup.php + * + * @param RestoreBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreBackup(RestoreBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreBackup', $request, $callOptions)->wait(); + } + + /** + * Triggers a new Backup. + * + * The async variant is {@see BackupDRClient::triggerBackupAsync()} . + * + * @example samples/V1/BackupDRClient/trigger_backup.php + * + * @param TriggerBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function triggerBackup(TriggerBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TriggerBackup', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a Backup. + * + * The async variant is {@see BackupDRClient::updateBackupAsync()} . + * + * @example samples/V1/BackupDRClient/update_backup.php + * + * @param UpdateBackupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackup(UpdateBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateBackup', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a BackupVault. + * + * The async variant is {@see BackupDRClient::updateBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/update_backup_vault.php + * + * @param UpdateBackupVaultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackupVault(UpdateBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateBackupVault', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a DataSource. + * + * The async variant is {@see BackupDRClient::updateDataSourceAsync()} . + * + * @example samples/V1/BackupDRClient/update_data_source.php + * + * @param UpdateDataSourceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataSource(UpdateDataSourceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDataSource', $request, $callOptions)->wait(); + } + /** * Gets information about a location. * diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceBackupProperties.php b/BackupDr/src/V1/ComputeInstanceBackupProperties.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceBackupProperties.php rename to BackupDr/src/V1/ComputeInstanceBackupProperties.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceDataSourceProperties.php b/BackupDr/src/V1/ComputeInstanceDataSourceProperties.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceDataSourceProperties.php rename to BackupDr/src/V1/ComputeInstanceDataSourceProperties.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties.php b/BackupDr/src/V1/ComputeInstanceRestoreProperties.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties.php rename to BackupDr/src/V1/ComputeInstanceRestoreProperties.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php b/BackupDr/src/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php similarity index 92% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php rename to BackupDr/src/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php index 8c0f3a4e5c74..333ed1ee11a8 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php +++ b/BackupDr/src/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstancePrivateIpv6GoogleAccess::class, \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties_InstancePrivateIpv6GoogleAccess::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceTargetEnvironment.php b/BackupDr/src/V1/ComputeInstanceTargetEnvironment.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ComputeInstanceTargetEnvironment.php rename to BackupDr/src/V1/ComputeInstanceTargetEnvironment.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ConfidentialInstanceConfig.php b/BackupDr/src/V1/ConfidentialInstanceConfig.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ConfidentialInstanceConfig.php rename to BackupDr/src/V1/ConfidentialInstanceConfig.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanAssociationRequest.php b/BackupDr/src/V1/CreateBackupPlanAssociationRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanAssociationRequest.php rename to BackupDr/src/V1/CreateBackupPlanAssociationRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanRequest.php b/BackupDr/src/V1/CreateBackupPlanRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupPlanRequest.php rename to BackupDr/src/V1/CreateBackupPlanRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupVaultRequest.php b/BackupDr/src/V1/CreateBackupVaultRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CreateBackupVaultRequest.php rename to BackupDr/src/V1/CreateBackupVaultRequest.php diff --git a/BackupDr/src/V1/CreateManagementServerRequest.php b/BackupDr/src/V1/CreateManagementServerRequest.php index 4f329ab68f27..a1eb23931ba0 100644 --- a/BackupDr/src/V1/CreateManagementServerRequest.php +++ b/BackupDr/src/V1/CreateManagementServerRequest.php @@ -17,8 +17,8 @@ class CreateManagementServerRequest extends \Google\Protobuf\Internal\Message { /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -56,8 +56,8 @@ class CreateManagementServerRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. Please see + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. Please see * {@see BackupDRClient::locationName()} for help formatting this field. * @param \Google\Cloud\BackupDR\V1\ManagementServer $managementServer Required. A [management server * resource][google.cloud.backupdr.v1.ManagementServer] @@ -84,8 +84,8 @@ public static function build(string $parent, \Google\Cloud\BackupDR\V1\Managemen * * @type string $parent * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * @type string $management_server_id * Required. The name of the management server to create. The name must be * unique for the specified project and location. @@ -113,8 +113,8 @@ public function __construct($data = NULL) { /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -126,8 +126,8 @@ public function getParent() /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CustomerEncryptionKey.php b/BackupDr/src/V1/CustomerEncryptionKey.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/CustomerEncryptionKey.php rename to BackupDr/src/V1/CustomerEncryptionKey.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource.php b/BackupDr/src/V1/DataSource.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource.php rename to BackupDr/src/V1/DataSource.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource/State.php b/BackupDr/src/V1/DataSource/State.php similarity index 92% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource/State.php rename to BackupDr/src/V1/DataSource/State.php index 3cec4aa57249..900f3b1ef95a 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSource/State.php +++ b/BackupDr/src/V1/DataSource/State.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\BackupDR\V1\DataSource_State::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceBackupApplianceApplication.php b/BackupDr/src/V1/DataSourceBackupApplianceApplication.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceBackupApplianceApplication.php rename to BackupDr/src/V1/DataSourceBackupApplianceApplication.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceGcpResource.php b/BackupDr/src/V1/DataSourceGcpResource.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DataSourceGcpResource.php rename to BackupDr/src/V1/DataSourceGcpResource.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanAssociationRequest.php b/BackupDr/src/V1/DeleteBackupPlanAssociationRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanAssociationRequest.php rename to BackupDr/src/V1/DeleteBackupPlanAssociationRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanRequest.php b/BackupDr/src/V1/DeleteBackupPlanRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupPlanRequest.php rename to BackupDr/src/V1/DeleteBackupPlanRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupRequest.php b/BackupDr/src/V1/DeleteBackupRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupRequest.php rename to BackupDr/src/V1/DeleteBackupRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupVaultRequest.php b/BackupDr/src/V1/DeleteBackupVaultRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteBackupVaultRequest.php rename to BackupDr/src/V1/DeleteBackupVaultRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DisplayDevice.php b/BackupDr/src/V1/DisplayDevice.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DisplayDevice.php rename to BackupDr/src/V1/DisplayDevice.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Entry.php b/BackupDr/src/V1/Entry.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Entry.php rename to BackupDr/src/V1/Entry.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsRequest.php b/BackupDr/src/V1/FetchUsableBackupVaultsRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsRequest.php rename to BackupDr/src/V1/FetchUsableBackupVaultsRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsResponse.php b/BackupDr/src/V1/FetchUsableBackupVaultsResponse.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/FetchUsableBackupVaultsResponse.php rename to BackupDr/src/V1/FetchUsableBackupVaultsResponse.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpBackupConfig.php b/BackupDr/src/V1/GcpBackupConfig.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpBackupConfig.php rename to BackupDr/src/V1/GcpBackupConfig.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpResource.php b/BackupDr/src/V1/GcpResource.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GcpResource.php rename to BackupDr/src/V1/GcpResource.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanAssociationRequest.php b/BackupDr/src/V1/GetBackupPlanAssociationRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanAssociationRequest.php rename to BackupDr/src/V1/GetBackupPlanAssociationRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanRequest.php b/BackupDr/src/V1/GetBackupPlanRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupPlanRequest.php rename to BackupDr/src/V1/GetBackupPlanRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupRequest.php b/BackupDr/src/V1/GetBackupRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupRequest.php rename to BackupDr/src/V1/GetBackupRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupVaultRequest.php b/BackupDr/src/V1/GetBackupVaultRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetBackupVaultRequest.php rename to BackupDr/src/V1/GetBackupVaultRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetDataSourceRequest.php b/BackupDr/src/V1/GetDataSourceRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetDataSourceRequest.php rename to BackupDr/src/V1/GetDataSourceRequest.php diff --git a/BackupDr/src/V1/GetManagementServerRequest.php b/BackupDr/src/V1/GetManagementServerRequest.php index 4787333aa02d..7c83be3986fc 100644 --- a/BackupDr/src/V1/GetManagementServerRequest.php +++ b/BackupDr/src/V1/GetManagementServerRequest.php @@ -17,7 +17,7 @@ class GetManagementServerRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetManagementServerRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. * * @return \Google\Cloud\BackupDR\V1\GetManagementServerRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature.php b/BackupDr/src/V1/GuestOsFeature.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature.php rename to BackupDr/src/V1/GuestOsFeature.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature/FeatureType.php b/BackupDr/src/V1/GuestOsFeature/FeatureType.php similarity index 96% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature/FeatureType.php rename to BackupDr/src/V1/GuestOsFeature/FeatureType.php index 1eaa457b98e2..dae448e1271f 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GuestOsFeature/FeatureType.php +++ b/BackupDr/src/V1/GuestOsFeature/FeatureType.php @@ -143,6 +143,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FeatureType::class, \Google\Cloud\BackupDR\V1\GuestOsFeature_FeatureType::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/InstanceParams.php b/BackupDr/src/V1/InstanceParams.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/InstanceParams.php rename to BackupDr/src/V1/InstanceParams.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/KeyRevocationActionType.php b/BackupDr/src/V1/KeyRevocationActionType.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/KeyRevocationActionType.php rename to BackupDr/src/V1/KeyRevocationActionType.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsRequest.php b/BackupDr/src/V1/ListBackupPlanAssociationsRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsRequest.php rename to BackupDr/src/V1/ListBackupPlanAssociationsRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsResponse.php b/BackupDr/src/V1/ListBackupPlanAssociationsResponse.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlanAssociationsResponse.php rename to BackupDr/src/V1/ListBackupPlanAssociationsResponse.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansRequest.php b/BackupDr/src/V1/ListBackupPlansRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansRequest.php rename to BackupDr/src/V1/ListBackupPlansRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansResponse.php b/BackupDr/src/V1/ListBackupPlansResponse.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupPlansResponse.php rename to BackupDr/src/V1/ListBackupPlansResponse.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsRequest.php b/BackupDr/src/V1/ListBackupVaultsRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsRequest.php rename to BackupDr/src/V1/ListBackupVaultsRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsResponse.php b/BackupDr/src/V1/ListBackupVaultsResponse.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupVaultsResponse.php rename to BackupDr/src/V1/ListBackupVaultsResponse.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsRequest.php b/BackupDr/src/V1/ListBackupsRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsRequest.php rename to BackupDr/src/V1/ListBackupsRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsResponse.php b/BackupDr/src/V1/ListBackupsResponse.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListBackupsResponse.php rename to BackupDr/src/V1/ListBackupsResponse.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesRequest.php b/BackupDr/src/V1/ListDataSourcesRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesRequest.php rename to BackupDr/src/V1/ListDataSourcesRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesResponse.php b/BackupDr/src/V1/ListDataSourcesResponse.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListDataSourcesResponse.php rename to BackupDr/src/V1/ListDataSourcesResponse.php diff --git a/BackupDr/src/V1/ListManagementServersRequest.php b/BackupDr/src/V1/ListManagementServersRequest.php index 37886b801be4..963e2af63f5e 100644 --- a/BackupDr/src/V1/ListManagementServersRequest.php +++ b/BackupDr/src/V1/ListManagementServersRequest.php @@ -17,10 +17,11 @@ class ListManagementServersRequest extends \Google\Protobuf\Internal\Message { /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -53,10 +54,11 @@ class ListManagementServersRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. Please see + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. Please see * {@see BackupDRClient::locationName()} for help formatting this field. * * @return \Google\Cloud\BackupDR\V1\ListManagementServersRequest @@ -77,10 +79,11 @@ public static function build(string $parent): self * * @type string $parent * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * @type int $page_size * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. @@ -99,10 +102,11 @@ public function __construct($data = NULL) { /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -114,10 +118,11 @@ public function getParent() /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/BackupDr/src/V1/ListManagementServersResponse.php b/BackupDr/src/V1/ListManagementServersResponse.php index fa2d796a5d0e..84bd573686db 100644 --- a/BackupDr/src/V1/ListManagementServersResponse.php +++ b/BackupDr/src/V1/ListManagementServersResponse.php @@ -18,7 +18,7 @@ class ListManagementServersResponse extends \Google\Protobuf\Internal\Message /** * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * 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 @@ -49,7 +49,7 @@ class ListManagementServersResponse extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $management_servers * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * 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 @@ -68,7 +68,7 @@ public function __construct($data = NULL) { /** * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * 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 @@ -85,7 +85,7 @@ public function getManagementServers() /** * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * 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 diff --git a/BackupDr/src/V1/ManagementServer.php b/BackupDr/src/V1/ManagementServer.php index 47545858a697..70295addc1c0 100644 --- a/BackupDr/src/V1/ManagementServer.php +++ b/BackupDr/src/V1/ManagementServer.php @@ -92,7 +92,7 @@ class ManagementServer extends \Google\Protobuf\Internal\Message /** * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * 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). * @@ -164,7 +164,7 @@ class ManagementServer extends \Google\Protobuf\Internal\Message * @type string $oauth2_client_id * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * 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). * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $workforce_identity_based_oauth2_client_id @@ -528,7 +528,7 @@ public function setEtag($var) /** * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * 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). * @@ -543,7 +543,7 @@ public function getOauth2ClientId() /** * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * 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). * diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Metadata.php b/BackupDr/src/V1/Metadata.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Metadata.php rename to BackupDr/src/V1/Metadata.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface.php b/BackupDr/src/V1/NetworkInterface.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface.php rename to BackupDr/src/V1/NetworkInterface.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/Ipv6AccessType.php b/BackupDr/src/V1/NetworkInterface/Ipv6AccessType.php similarity index 90% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/Ipv6AccessType.php rename to BackupDr/src/V1/NetworkInterface/Ipv6AccessType.php index 3fd3019ef1d9..0e693955e272 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/Ipv6AccessType.php +++ b/BackupDr/src/V1/NetworkInterface/Ipv6AccessType.php @@ -60,6 +60,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Ipv6AccessType::class, \Google\Cloud\BackupDR\V1\NetworkInterface_Ipv6AccessType::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/NicType.php b/BackupDr/src/V1/NetworkInterface/NicType.php similarity index 90% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/NicType.php rename to BackupDr/src/V1/NetworkInterface/NicType.php index 692fba7a610b..68e6feafb6d2 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/NicType.php +++ b/BackupDr/src/V1/NetworkInterface/NicType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NicType::class, \Google\Cloud\BackupDR\V1\NetworkInterface_NicType::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/StackType.php b/BackupDr/src/V1/NetworkInterface/StackType.php similarity index 90% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/StackType.php rename to BackupDr/src/V1/NetworkInterface/StackType.php index 9a2933d8f880..3fa4b59c862e 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkInterface/StackType.php +++ b/BackupDr/src/V1/NetworkInterface/StackType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StackType::class, \Google\Cloud\BackupDR\V1\NetworkInterface_StackType::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig.php b/BackupDr/src/V1/NetworkPerformanceConfig.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig.php rename to BackupDr/src/V1/NetworkPerformanceConfig.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig/Tier.php b/BackupDr/src/V1/NetworkPerformanceConfig/Tier.php similarity index 91% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig/Tier.php rename to BackupDr/src/V1/NetworkPerformanceConfig/Tier.php index 4ed540cb417e..e53e32fa05fb 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkPerformanceConfig/Tier.php +++ b/BackupDr/src/V1/NetworkPerformanceConfig/Tier.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig_Tier::class); diff --git a/BackupDr/src/V1/OperationMetadata.php b/BackupDr/src/V1/OperationMetadata.php index 822d7b9a09a9..e880bbc7986d 100644 --- a/BackupDr/src/V1/OperationMetadata.php +++ b/BackupDr/src/V1/OperationMetadata.php @@ -50,7 +50,7 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -90,7 +90,7 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * @type string $api_version * Output only. API version used to start the operation. * @type array|\Google\Protobuf\Internal\MapField $additional_info @@ -258,7 +258,7 @@ public function setStatusMessage($var) * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return bool @@ -273,7 +273,7 @@ public function getRequestedCancellation() * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param bool $var diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupRequest.php b/BackupDr/src/V1/RestoreBackupRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupRequest.php rename to BackupDr/src/V1/RestoreBackupRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupResponse.php b/BackupDr/src/V1/RestoreBackupResponse.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RestoreBackupResponse.php rename to BackupDr/src/V1/RestoreBackupResponse.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo.php b/BackupDr/src/V1/RuleConfigInfo.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo.php rename to BackupDr/src/V1/RuleConfigInfo.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo/LastBackupState.php b/BackupDr/src/V1/RuleConfigInfo/LastBackupState.php similarity index 92% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo/LastBackupState.php rename to BackupDr/src/V1/RuleConfigInfo/LastBackupState.php index 2d60713fc717..b8df1c268358 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/RuleConfigInfo/LastBackupState.php +++ b/BackupDr/src/V1/RuleConfigInfo/LastBackupState.php @@ -74,6 +74,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LastBackupState::class, \Google\Cloud\BackupDR\V1\RuleConfigInfo_LastBackupState::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling.php b/BackupDr/src/V1/Scheduling.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling.php rename to BackupDr/src/V1/Scheduling.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/InstanceTerminationAction.php b/BackupDr/src/V1/Scheduling/InstanceTerminationAction.php similarity index 89% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/InstanceTerminationAction.php rename to BackupDr/src/V1/Scheduling/InstanceTerminationAction.php index b2ec47683f00..cd01151b99d2 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/InstanceTerminationAction.php +++ b/BackupDr/src/V1/Scheduling/InstanceTerminationAction.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceTerminationAction::class, \Google\Cloud\BackupDR\V1\Scheduling_InstanceTerminationAction::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity.php b/BackupDr/src/V1/Scheduling/NodeAffinity.php similarity index 96% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity.php rename to BackupDr/src/V1/Scheduling/NodeAffinity.php index 766243220a05..9068885d9fa7 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity.php +++ b/BackupDr/src/V1/Scheduling/NodeAffinity.php @@ -154,6 +154,4 @@ public function setValues($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NodeAffinity::class, \Google\Cloud\BackupDR\V1\Scheduling_NodeAffinity::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity/Operator.php b/BackupDr/src/V1/Scheduling/NodeAffinity/Operator.php similarity index 90% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity/Operator.php rename to BackupDr/src/V1/Scheduling/NodeAffinity/Operator.php index 97cd529b7742..3117fed94931 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/NodeAffinity/Operator.php +++ b/BackupDr/src/V1/Scheduling/NodeAffinity/Operator.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Operator::class, \Google\Cloud\BackupDR\V1\Scheduling_NodeAffinity_Operator::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/OnHostMaintenance.php b/BackupDr/src/V1/Scheduling/OnHostMaintenance.php similarity index 91% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/OnHostMaintenance.php rename to BackupDr/src/V1/Scheduling/OnHostMaintenance.php index 32a98fdc8fc0..9a388fd66a95 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/OnHostMaintenance.php +++ b/BackupDr/src/V1/Scheduling/OnHostMaintenance.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(OnHostMaintenance::class, \Google\Cloud\BackupDR\V1\Scheduling_OnHostMaintenance::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/ProvisioningModel.php b/BackupDr/src/V1/Scheduling/ProvisioningModel.php similarity index 90% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/ProvisioningModel.php rename to BackupDr/src/V1/Scheduling/ProvisioningModel.php index 24e887699528..50d92477518f 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Scheduling/ProvisioningModel.php +++ b/BackupDr/src/V1/Scheduling/ProvisioningModel.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ProvisioningModel::class, \Google\Cloud\BackupDR\V1\Scheduling_ProvisioningModel::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/SchedulingDuration.php b/BackupDr/src/V1/SchedulingDuration.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/SchedulingDuration.php rename to BackupDr/src/V1/SchedulingDuration.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceAccount.php b/BackupDr/src/V1/ServiceAccount.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceAccount.php rename to BackupDr/src/V1/ServiceAccount.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceLockInfo.php b/BackupDr/src/V1/ServiceLockInfo.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ServiceLockInfo.php rename to BackupDr/src/V1/ServiceLockInfo.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule.php b/BackupDr/src/V1/StandardSchedule.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule.php rename to BackupDr/src/V1/StandardSchedule.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule/RecurrenceType.php b/BackupDr/src/V1/StandardSchedule/RecurrenceType.php similarity index 92% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule/RecurrenceType.php rename to BackupDr/src/V1/StandardSchedule/RecurrenceType.php index 2c80f3b55a38..4ee2035fcff1 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/StandardSchedule/RecurrenceType.php +++ b/BackupDr/src/V1/StandardSchedule/RecurrenceType.php @@ -80,6 +80,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RecurrenceType::class, \Google\Cloud\BackupDR\V1\StandardSchedule_RecurrenceType::class); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Tags.php b/BackupDr/src/V1/Tags.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/Tags.php rename to BackupDr/src/V1/Tags.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TargetResource.php b/BackupDr/src/V1/TargetResource.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TargetResource.php rename to BackupDr/src/V1/TargetResource.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TriggerBackupRequest.php b/BackupDr/src/V1/TriggerBackupRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/TriggerBackupRequest.php rename to BackupDr/src/V1/TriggerBackupRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupRequest.php b/BackupDr/src/V1/UpdateBackupRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupRequest.php rename to BackupDr/src/V1/UpdateBackupRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupVaultRequest.php b/BackupDr/src/V1/UpdateBackupVaultRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateBackupVaultRequest.php rename to BackupDr/src/V1/UpdateBackupVaultRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateDataSourceRequest.php b/BackupDr/src/V1/UpdateDataSourceRequest.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/UpdateDataSourceRequest.php rename to BackupDr/src/V1/UpdateDataSourceRequest.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth.php b/BackupDr/src/V1/WeekDayOfMonth.php similarity index 100% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth.php rename to BackupDr/src/V1/WeekDayOfMonth.php diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth/WeekOfMonth.php b/BackupDr/src/V1/WeekDayOfMonth/WeekOfMonth.php similarity index 92% rename from owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth/WeekOfMonth.php rename to BackupDr/src/V1/WeekDayOfMonth/WeekOfMonth.php index e0affc57f6a4..261806c3b318 100644 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WeekDayOfMonth/WeekOfMonth.php +++ b/BackupDr/src/V1/WeekDayOfMonth/WeekOfMonth.php @@ -81,6 +81,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(WeekOfMonth::class, \Google\Cloud\BackupDR\V1\WeekDayOfMonth_WeekOfMonth::class); diff --git a/BackupDr/src/V1/gapic_metadata.json b/BackupDr/src/V1/gapic_metadata.json index 37b3567fa87d..130c7f38a667 100644 --- a/BackupDr/src/V1/gapic_metadata.json +++ b/BackupDr/src/V1/gapic_metadata.json @@ -10,26 +10,141 @@ "grpc": { "libraryClient": "BackupDRGapicClient", "rpcs": { + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, "CreateManagementServer": { "methods": [ "createManagementServer" ] }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, "DeleteManagementServer": { "methods": [ "deleteManagementServer" ] }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, "GetManagementServer": { "methods": [ "getManagementServer" ] }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans" + ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources" + ] + }, "ListManagementServers": { "methods": [ "listManagementServers" ] }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, "GetLocation": { "methods": [ "getLocation" diff --git a/BackupDr/src/V1/resources/backup_dr_client_config.json b/BackupDr/src/V1/resources/backup_dr_client_config.json index 5c162679d6d7..c505f44b1add 100644 --- a/BackupDr/src/V1/resources/backup_dr_client_config.json +++ b/BackupDr/src/V1/resources/backup_dr_client_config.json @@ -38,26 +38,141 @@ } }, "methods": { + "CreateBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CreateManagementServer": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "DeleteManagementServer": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "FetchUsableBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetManagementServer": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListBackupPlanAssociations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListBackupPlans": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListManagementServers": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "RestoreBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TriggerBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "GetLocation": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/BackupDr/src/V1/resources/backup_dr_descriptor_config.php b/BackupDr/src/V1/resources/backup_dr_descriptor_config.php index 44417b94b54a..669fa4bd998c 100644 --- a/BackupDr/src/V1/resources/backup_dr_descriptor_config.php +++ b/BackupDr/src/V1/resources/backup_dr_descriptor_config.php @@ -23,6 +23,63 @@ return [ 'interfaces' => [ 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateBackupPlan' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlan', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackupPlanAssociation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateManagementServer' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\BackupDR\V1\ManagementServer', @@ -42,6 +99,82 @@ ], ], ], + 'DeleteBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlan' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlanAssociation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteManagementServer' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -61,6 +194,184 @@ ], ], ], + 'RestoreBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\RestoreBackupResponse', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'TriggerBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'backup.name', + 'fieldAccessors' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'UpdateBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'backup_vault.name', + 'fieldAccessors' => [ + 'getBackupVault', + 'getName', + ], + ], + ], + ], + 'UpdateDataSource' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\DataSource', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'data_source.name', + 'fieldAccessors' => [ + 'getDataSource', + 'getName', + ], + ], + ], + ], + 'FetchUsableBackupVaults' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupVaults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\Backup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlan' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlan', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlanAssociation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupVault' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupVault', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\DataSource', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetManagementServer' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\BackupDR\V1\ManagementServer', @@ -73,6 +384,106 @@ ], ], ], + 'ListBackupPlanAssociations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupPlanAssociations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupPlans' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupPlans', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlansResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupVaults' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupVaults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupVaultsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataSources' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataSources', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListDataSourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListManagementServers' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -167,6 +578,11 @@ 'interfaceOverride' => 'google.iam.v1.IAMPolicy', ], 'templateMap' => [ + 'backup' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}', + 'backupPlan' => 'projects/{project}/locations/{location}/backupPlans/{backup_plan}', + 'backupPlanAssociation' => 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}', + 'backupVault' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}', + 'dataSource' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}', 'location' => 'projects/{project}/locations/{location}', 'managementServer' => 'projects/{project}/locations/{location}/managementServers/{managementserver}', ], diff --git a/BackupDr/src/V1/resources/backup_dr_rest_client_config.php b/BackupDr/src/V1/resources/backup_dr_rest_client_config.php index 41f4e3a9cf92..072b35af529f 100644 --- a/BackupDr/src/V1/resources/backup_dr_rest_client_config.php +++ b/BackupDr/src/V1/resources/backup_dr_rest_client_config.php @@ -23,6 +23,51 @@ return [ 'interfaces' => [ 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateBackupPlan' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', + 'body' => 'backup_plan', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_plan_id', + ], + ], + 'CreateBackupPlanAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', + 'body' => 'backup_plan_association', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_plan_association_id', + ], + ], + 'CreateBackupVault' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', + 'body' => 'backup_vault', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_vault_id', + ], + ], 'CreateManagementServer' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', @@ -38,6 +83,50 @@ 'management_server_id', ], ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlan' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlanAssociation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupVault' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteManagementServer' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', @@ -49,6 +138,72 @@ ], ], ], + 'FetchUsableBackupVaults' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlan' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlanAssociation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupVault' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetManagementServer' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', @@ -60,6 +215,61 @@ ], ], ], + 'ListBackupPlanAssociations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupPlans' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupVaults' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataSources' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListManagementServers' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', @@ -71,6 +281,78 @@ ], ], ], + 'RestoreBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'TriggerBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'body' => 'backup', + 'placeholders' => [ + 'backup.name' => [ + 'getters' => [ + 'getBackup', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateBackupVault' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}', + 'body' => 'backup_vault', + 'placeholders' => [ + 'backup_vault.name' => [ + 'getters' => [ + 'getBackupVault', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateDataSource' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}', + 'body' => 'data_source', + 'placeholders' => [ + 'data_source.name' => [ + 'getters' => [ + 'getDataSource', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], ], 'google.cloud.location.Locations' => [ 'GetLocation' => [ diff --git a/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php b/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php index 899c1b728151..f836c6098019 100644 --- a/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php +++ b/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php @@ -26,13 +26,48 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\BackupDR\V1\Backup; +use Google\Cloud\BackupDR\V1\BackupPlan; +use Google\Cloud\BackupDR\V1\BackupPlanAssociation; +use Google\Cloud\BackupDR\V1\BackupVault; use Google\Cloud\BackupDR\V1\Client\BackupDRClient; +use Google\Cloud\BackupDR\V1\CreateBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\CreateBackupPlanRequest; +use Google\Cloud\BackupDR\V1\CreateBackupVaultRequest; use Google\Cloud\BackupDR\V1\CreateManagementServerRequest; +use Google\Cloud\BackupDR\V1\DataSource; +use Google\Cloud\BackupDR\V1\DeleteBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupPlanRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupVaultRequest; use Google\Cloud\BackupDR\V1\DeleteManagementServerRequest; +use Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsRequest; +use Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsResponse; +use Google\Cloud\BackupDR\V1\GetBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\GetBackupPlanRequest; +use Google\Cloud\BackupDR\V1\GetBackupRequest; +use Google\Cloud\BackupDR\V1\GetBackupVaultRequest; +use Google\Cloud\BackupDR\V1\GetDataSourceRequest; use Google\Cloud\BackupDR\V1\GetManagementServerRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsResponse; +use Google\Cloud\BackupDR\V1\ListBackupPlansRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlansResponse; +use Google\Cloud\BackupDR\V1\ListBackupVaultsRequest; +use Google\Cloud\BackupDR\V1\ListBackupVaultsResponse; +use Google\Cloud\BackupDR\V1\ListBackupsRequest; +use Google\Cloud\BackupDR\V1\ListBackupsResponse; +use Google\Cloud\BackupDR\V1\ListDataSourcesRequest; +use Google\Cloud\BackupDR\V1\ListDataSourcesResponse; use Google\Cloud\BackupDR\V1\ListManagementServersRequest; use Google\Cloud\BackupDR\V1\ListManagementServersResponse; use Google\Cloud\BackupDR\V1\ManagementServer; +use Google\Cloud\BackupDR\V1\RestoreBackupRequest; +use Google\Cloud\BackupDR\V1\RestoreBackupResponse; +use Google\Cloud\BackupDR\V1\TriggerBackupRequest; +use Google\Cloud\BackupDR\V1\UpdateBackupRequest; +use Google\Cloud\BackupDR\V1\UpdateBackupVaultRequest; +use Google\Cloud\BackupDR\V1\UpdateDataSourceRequest; use Google\Cloud\Iam\V1\GetIamPolicyRequest; use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\SetIamPolicyRequest; @@ -46,6 +81,8 @@ use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; +use Google\Protobuf\Duration; +use Google\Protobuf\FieldMask; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -81,7 +118,7 @@ private function createClient(array $options = []) } /** @test */ - public function createManagementServerTest() + public function createBackupPlanTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -98,38 +135,2387 @@ public function createManagementServerTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setName('operations/createBackupPlanTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setName('operations/createBackupPlanTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServer($request); + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanId(); + $this->assertProtobufEquals($backupPlanId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlan(); + $this->assertProtobufEquals($backupPlan, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) + ->setParent($formattedParent) + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupPlanAssociationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = 'backupPlanAssociationId133124978'; + $backupPlanAssociation = new BackupPlanAssociation(); + $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; + $backupPlanAssociation->setResource($backupPlanAssociationResource); + $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + $response = $gapicClient->createBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlanAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanAssociationId(); + $this->assertProtobufEquals($backupPlanAssociationId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanAssociation(); + $this->assertProtobufEquals($backupPlanAssociation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = 'backupPlanAssociationId133124978'; + $backupPlanAssociation = new BackupPlanAssociation(); + $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; + $backupPlanAssociation->setResource($backupPlanAssociationResource); + $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + $response = $gapicClient->createBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupVaultTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $deletable = true; + $etag = 'etag3123477'; + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = 'backupVaultId467030053'; + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + $response = $gapicClient->createBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVaultId(); + $this->assertProtobufEquals($backupVaultId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVault(); + $this->assertProtobufEquals($backupVault, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupVaultExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = 'backupVaultId467030053'; + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + $response = $gapicClient->createBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $satisfiesPzi = false; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServerId(); + $this->assertProtobufEquals($managementServerId, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServer(); + $this->assertProtobufEquals($managementServer, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new DeleteBackupRequest())->setName($formattedName); + $response = $gapicClient->deleteBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new DeleteBackupRequest())->setName($formattedName); + $response = $gapicClient->deleteBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupPlanTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new DeleteBackupPlanRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlan', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new DeleteBackupPlanRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupPlanAssociationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new DeleteBackupPlanAssociationRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlanAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new DeleteBackupPlanAssociationRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupVaultTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new DeleteBackupVaultRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupVaultExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new DeleteBackupVaultRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest())->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest())->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function fetchUsableBackupVaultsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupVaultsElement = new BackupVault(); + $backupVaults = [$backupVaultsElement]; + $expectedResponse = new FetchUsableBackupVaultsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupVaults($backupVaults); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchUsableBackupVaultsRequest())->setParent($formattedParent); + $response = $gapicClient->fetchUsableBackupVaults($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/FetchUsableBackupVaults', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchUsableBackupVaultsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchUsableBackupVaultsRequest())->setParent($formattedParent); + try { + $gapicClient->fetchUsableBackupVaults($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new GetBackupRequest())->setName($formattedName); + $response = $gapicClient->getBackup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new GetBackupRequest())->setName($formattedName); + try { + $gapicClient->getBackup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; + $etag = 'etag3123477'; + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new GetBackupPlanRequest())->setName($formattedName); + $response = $gapicClient->getBackupPlan($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupPlan', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new GetBackupPlanRequest())->setName($formattedName); + try { + $gapicClient->getBackupPlan($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name2); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new GetBackupPlanAssociationRequest())->setName($formattedName); + $response = $gapicClient->getBackupPlanAssociation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupPlanAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanAssociationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new GetBackupPlanAssociationRequest())->setName($formattedName); + try { + $gapicClient->getBackupPlanAssociation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupVaultTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $deletable = true; + $etag = 'etag3123477'; + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new GetBackupVaultRequest())->setName($formattedName); + $response = $gapicClient->getBackupVault($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupVault', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupVaultExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new GetBackupVaultRequest())->setName($formattedName); + try { + $gapicClient->getBackupVault($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $backupCount = 336678994; + $etag = 'etag3123477'; + $totalStoredBytes = 1181597162; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name2); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setEtag($etag); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest())->setName($formattedName); + $response = $gapicClient->getDataSource($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetDataSource', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest())->setName($formattedName); + try { + $gapicClient->getDataSource($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getManagementServerTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $satisfiesPzi = false; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest())->setName($formattedName); + $response = $gapicClient->getManagementServer($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetManagementServer', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getManagementServerExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest())->setName($formattedName); + try { + $gapicClient->getManagementServer($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlanAssociationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupPlanAssociationsElement = new BackupPlanAssociation(); + $backupPlanAssociations = [$backupPlanAssociationsElement]; + $expectedResponse = new ListBackupPlanAssociationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupPlanAssociations($backupPlanAssociations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlanAssociationsRequest())->setParent($formattedParent); + $response = $gapicClient->listBackupPlanAssociations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupPlanAssociations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlanAssociations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlanAssociationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlanAssociationsRequest())->setParent($formattedParent); + try { + $gapicClient->listBackupPlanAssociations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlansTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupPlansElement = new BackupPlan(); + $backupPlans = [$backupPlansElement]; + $expectedResponse = new ListBackupPlansResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupPlans($backupPlans); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlansRequest())->setParent($formattedParent); + $response = $gapicClient->listBackupPlans($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupPlans()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlans', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlansExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlansRequest())->setParent($formattedParent); + try { + $gapicClient->listBackupPlans($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupVaultsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupVaultsElement = new BackupVault(); + $backupVaults = [$backupVaultsElement]; + $expectedResponse = new ListBackupVaultsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupVaults($backupVaults); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupVaultsRequest())->setParent($formattedParent); + $response = $gapicClient->listBackupVaults($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupVaults', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupVaultsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupVaultsRequest())->setParent($formattedParent); + try { + $gapicClient->listBackupVaults($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupsElement = new Backup(); + $backups = [$backupsElement]; + $expectedResponse = new ListBackupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackups($backups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new ListBackupsRequest())->setParent($formattedParent); + $response = $gapicClient->listBackups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new ListBackupsRequest())->setParent($formattedParent); + try { + $gapicClient->listBackups($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataSourcesElement = new DataSource(); + $dataSources = [$dataSourcesElement]; + $expectedResponse = new ListDataSourcesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataSources($dataSources); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new ListDataSourcesRequest())->setParent($formattedParent); + $response = $gapicClient->listDataSources($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataSources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListDataSources', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new ListDataSourcesRequest())->setParent($formattedParent); + try { + $gapicClient->listDataSources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagementServersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managementServersElement = new ManagementServer(); + $managementServers = [$managementServersElement]; + $expectedResponse = new ListManagementServersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagementServers($managementServers); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest())->setParent($formattedParent); + $response = $gapicClient->listManagementServers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagementServers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListManagementServers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagementServersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest())->setParent($formattedParent); + try { + $gapicClient->listManagementServers($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restoreBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new RestoreBackupResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new RestoreBackupRequest())->setName($formattedName); + $response = $gapicClient->restoreBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/RestoreBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new RestoreBackupRequest())->setName($formattedName); + $response = $gapicClient->restoreBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function triggerBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/triggerBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name2); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/triggerBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $ruleId = 'ruleId1548659006'; + $request = (new TriggerBackupRequest())->setName($formattedName)->setRuleId($ruleId); + $response = $gapicClient->triggerBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -138,15 +2524,13 @@ public function createManagementServerTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServerId(); - $this->assertProtobufEquals($managementServerId, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServer(); - $this->assertProtobufEquals($managementServer, $actualValue); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/TriggerBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getRuleId(); + $this->assertProtobufEquals($ruleId, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -165,7 +2549,7 @@ public function createManagementServerTest() } /** @test */ - public function createManagementServerExceptionTest() + public function triggerBackupExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -182,7 +2566,7 @@ public function createManagementServerExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setName('operations/triggerBackupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -199,20 +2583,18 @@ public function createManagementServerExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) - ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServer($request); + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $ruleId = 'ruleId1548659006'; + $request = (new TriggerBackupRequest())->setName($formattedName)->setRuleId($ruleId); + $response = $gapicClient->triggerBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -231,7 +2613,7 @@ public function createManagementServerExceptionTest() } /** @test */ - public function deleteManagementServerTest() + public function updateBackupTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -248,21 +2630,30 @@ public function deleteManagementServerTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setName('operations/updateBackupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteManagementServerTest'); + $completeOperation->setName('operations/updateBackupTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new DeleteManagementServerRequest())->setName($formattedName); - $response = $gapicClient->deleteManagementServer($request); + $updateMask = new FieldMask(); + $backup = new Backup(); + $request = (new UpdateBackupRequest())->setUpdateMask($updateMask)->setBackup($backup); + $response = $gapicClient->updateBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -271,11 +2662,13 @@ public function deleteManagementServerTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteManagementServer', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/updateBackupTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -294,7 +2687,7 @@ public function deleteManagementServerTest() } /** @test */ - public function deleteManagementServerExceptionTest() + public function updateBackupExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -311,7 +2704,7 @@ public function deleteManagementServerExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setName('operations/updateBackupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -328,13 +2721,14 @@ public function deleteManagementServerExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new DeleteManagementServerRequest())->setName($formattedName); - $response = $gapicClient->deleteManagementServer($request); + $updateMask = new FieldMask(); + $backup = new Backup(); + $request = (new UpdateBackupRequest())->setUpdateMask($updateMask)->setBackup($backup); + $response = $gapicClient->updateBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/updateBackupTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -353,49 +2747,110 @@ public function deleteManagementServerExceptionTest() } /** @test */ - public function getManagementServerTest() + public function updateBackupVaultTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; $description = 'description-1724546052'; + $deletable = true; $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); - $expectedResponse->setName($name2); + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name); $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new GetManagementServerRequest())->setName($formattedName); - $response = $gapicClient->getManagementServer($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetManagementServer', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $updateMask = new FieldMask(); + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest())->setUpdateMask($updateMask)->setBackupVault($backupVault); + $response = $gapicClient->updateBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVault(); + $this->assertProtobufEquals($backupVault, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getManagementServerExceptionTest() + public function updateBackupVaultExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -408,65 +2863,130 @@ public function getManagementServerExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new GetManagementServerRequest())->setName($formattedName); + $updateMask = new FieldMask(); + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest())->setUpdateMask($updateMask)->setBackupVault($backupVault); + $response = $gapicClient->updateBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); try { - $gapicClient->getManagementServer($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listManagementServersTest() + public function updateDataSourceTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $nextPageToken = ''; - $managementServersElement = new ManagementServer(); - $managementServers = [$managementServersElement]; - $expectedResponse = new ListManagementServersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setManagementServers($managementServers); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDataSourceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $backupCount = 336678994; + $etag = 'etag3123477'; + $totalStoredBytes = 1181597162; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setEtag($etag); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDataSourceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListManagementServersRequest())->setParent($formattedParent); - $response = $gapicClient->listManagementServers($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getManagementServers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListManagementServers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); + $updateMask = new FieldMask(); + $dataSource = new DataSource(); + $request = (new UpdateDataSourceRequest())->setUpdateMask($updateMask)->setDataSource($dataSource); + $response = $gapicClient->updateDataSource($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateDataSource', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listManagementServersExceptionTest() + public function updateDataSourceExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDataSourceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -479,21 +2999,31 @@ public function listManagementServersExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListManagementServersRequest())->setParent($formattedParent); + $updateMask = new FieldMask(); + $dataSource = new DataSource(); + $request = (new UpdateDataSourceRequest())->setUpdateMask($updateMask)->setDataSource($dataSource); + $response = $gapicClient->updateDataSource($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); try { - $gapicClient->listManagementServers($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ @@ -830,7 +3360,7 @@ public function testIamPermissionsExceptionTest() } /** @test */ - public function createManagementServerAsyncTest() + public function createBackupPlanAsyncTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -847,38 +3377,44 @@ public function createManagementServerAsyncTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setName('operations/createBackupPlanTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setName('operations/createBackupPlanTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServerAsync($request)->wait(); + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlanAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -887,15 +3423,15 @@ public function createManagementServerAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServerId(); - $this->assertProtobufEquals($managementServerId, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServer(); - $this->assertProtobufEquals($managementServer, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanId(); + $this->assertProtobufEquals($backupPlanId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlan(); + $this->assertProtobufEquals($backupPlan, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); diff --git a/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupdr.php b/owl-bot-staging/BackupDr/v1/proto/src/GPBMetadata/Google/Cloud/Backupdr/V1/Backupdr.php deleted file mode 100644 index fde6b0d8cfbdf7d0c8a52d61ff14ec9a42a21a7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11158 zcmb_iO>7&-70!ybEDilbj}x1b?PNncuuRxwr2NyiVoIbH+LlC6KY?B0B*wcSFO)J4NG9NjY-YHeTjwhguA*q&Xtn`*7SxoJ3R-QH=L zO~c8kYGFlPURhI%h0@wf;Og3Kr*7obE!*B|8rgc&Za1YB<^58UJ^Nj){<^ z?-*`NuN&%Od49?8^oH)~)kW%FT_En&dG21_n7M&ay{WsdDz2eNNQHl`cCBgFRoBx! z`0ujmYNlm+rrtC^1QfT_O}*(F;M{Aw*|zGQXEzfq!V4BNq8J@p< zX*-8-Em@oPXl@mQGi+#VJsjeEYBhCh___Oy0(`XVCSCKVA8=Q1H%Hio`?j^^v@OfD zwyG;FlC`7lyiaJLQ*o!|?GKN@cU?0fg*|Xjjt2Pc_fhDuaMNK|HbX6hUtLT{NMU?eM;SWUes-Pk15*J_;m z+~9nVfe8%fH=mboI-JJ*)>VFs#^Ot4AeV%z-1M~}OeI2cuk-*f$~ta)iQ6^hjGERqgYaWGfnvZh8Z`wJOYNac?*Zsd8;WSD0lucU zKd-w+qjR+C6*RSJIXm%k+n#0R zp;W+E(FJ*GTPJrlmM5Coknw@3Ja><&H2bFrB?64AhO=upu<1ugd%%Yr|2z+yK7o@c z-rz+Sv@SU*ASn1A8gJ?~qv>JTU=$%j)A7Ax5Zn-6chM1Vzhxv(QvSXvCh3u;Oi$P)3zQeSmNjr^ zaTn0ZE;__%5Y;Qg3=3RkKwOYgl7Eznu&<1ZT8)sgn{Np^!L8`=!-*Au@n^k{j*|Y! zNFJjr@mBPZfiojZMy$jt@n;z3&;%C^H#tEW(Qgqtw1EsThEJm-(2;H>Pe3$WaxS7o z506iY+cCV0u12m}kKbv!ZgbHf!`H1dAsN)?(eawD0V_Y)rxJhxE=z0-TI51o;6lZ6 zwbqAj@(i7}m&)_du5RefHebD|PCqmGEci{(>87ruxRfwBj$#jueU_*A1UkA)Mq#>^ z8+%Jh<wMubyZKYBKMg15`f*6Bt zF@6C}`Gde%Aj6&dd>lMvK zisgKXh<@TIK84~-`O@-Qahb%L7$?INE0vW>;#lsd%9r_{C}`Sm9az-?MRzmsfRycK zD83Kd^DU$9x!Fhj*Fm;v*ICP!eI$M!WP|)=+y;l>l1sJmAbmQx#I0r%-Ir4TP|$_@ zrt2;F1%lgFjQ88nwBg%m97+fzHy7Dgfc9VI(|CAPXVGK}3Z3S{qZZxrql6*~K8Fy! z?%59wD@lZqXHXK2Z<;goAa_*z&mmmsE&!bnbO882~zE86S|63uqZCTEL*T$J-W^ ziu$%*YZ?F*QZH4lqNzorXW_-V&vleGzUsqsDfKUay+F%TcbsB|r{CF^(6c=YM=HEu zw#V>YB+-zsE#2#pmX?Vv5XNDwB$EW(NPU1V7L2Ch8BtK5axn>2rI~$rO6tckblQKa z5{DC{#><@n=|_jC@iS<`uo@#Z6VNnzx&tQ)LHfi_^yhrpShlb#B6OM`)3(o>P@%d5vX(J8&rfU^`EPCMXK zWz*)R^quI`=~=Q2Jh|~9$RoesWyPjmM`uFr4Js(JPqJu&9RU?8_%8~2E>r?=p9V10 zf#=RtpAIa-k7-Tn&XYXX(~my;;)i2z;@8PT+#@Ejw|xCiOS+#9(R=(m1)T{|5Bys6 zqKB9ZI3uWBs_-OFo9>SINf#aweMqrNAK*{M(AjW#!hO~@+(V$aD6mTprWv1Vsh=y4 z^Dl=yMD!-`ll*nIA=i53t@jFO5nYPAsl#n$u2&%OKNWN~T+#ZiPPoUAtMmTjd>TE+ zpNoNq^b|8gPkeCL3P~JDGvFh0;C~7_&32S!>IOO4!n0x*dmnCkjEBVbG3>mG;_@tE zkS_5}XZ@N+k36o)e~7KVoqA=MtYxkgm79a^o1Ag8QSomTlpsPePcJePJQIz)+g1SY zvsk?@T!QkQ5;TiP27~{upmTQ&ufDzRl8&YWMW08q2p0k7?P&awo*dIsC#E@kbL0)$ z4DjGzDCi`}rGyJ-ql4?T6lh+Kc96zRy(7!1*o%ItRFf!^1tt9ovS^*2C`iNh%c34* z5%B>1{QhuRlw<+&^xp=!rBqyfmSYLaCL`Ji3kN2Imn!j%FeT zjLec3bRz0s!&5orM=%%8MC0f%6euo7+XthjKmdY@B*Gqk$>o?yQhhXr5-d-GIr`~y zx2*_%KuUcADfJ>k(i~xR>0ARARAaBTu5~BWgW0=uizJ&7@~I1VE-np&|D?bnj$fo) zd@Xt>Br^g1`jFO~c@H|7cNf1qGV{8?a9+CjR|=Z+H5&Knb$ug&L5;@1^d|M5%sUbE zVR1KWnICBoem{Zb(ya~BkFT?A}e)8FEJ0$S$G5KU9rgMZ5`K8Xbp1dj*T|N0N zn)0kxhaM0k~IB7 zK~q6j)dkAMH==0~?Im#a;Z#3op2zn(^H{(fI*(L{5 z6a8lTY4(>VEzO{UZ|AGL1tO`##`(#QGE6TFJHH8UdrLCQ;0google.cloud.backupdr.v1.CreateManagementServerRequest - */ -class CreateManagementServerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The management server project and location in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - * locations map to Google Cloud regions, for example **us-central1**. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * - * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $management_server_id = ''; - /** - * Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $management_server = null; - /** - * 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). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The management server project and location in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - * locations map to Google Cloud regions, for example **us-central1**. Please see - * {@see BackupDRClient::locationName()} for help formatting this field. - * @param \Google\Cloud\BackupDR\V1\ManagementServer $managementServer Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * @param string $managementServerId Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * - * @return \Google\Cloud\BackupDR\V1\CreateManagementServerRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\BackupDR\V1\ManagementServer $managementServer, string $managementServerId): self - { - return (new self()) - ->setParent($parent) - ->setManagementServer($managementServer) - ->setManagementServerId($managementServerId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The management server project and location in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - * locations map to Google Cloud regions, for example **us-central1**. - * @type string $management_server_id - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * @type \Google\Cloud\BackupDR\V1\ManagementServer $management_server - * Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * @type string $request_id - * 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). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Required. The management server project and location in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - * locations map to Google Cloud regions, for example **us-central1**. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The management server project and location in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - * locations map to Google Cloud regions, for example **us-central1**. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * - * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getManagementServerId() - { - return $this->management_server_id; - } - - /** - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * - * Generated from protobuf field string management_server_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setManagementServerId($var) - { - GPBUtil::checkString($var, True); - $this->management_server_id = $var; - - return $this; - } - - /** - * Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BackupDR\V1\ManagementServer|null - */ - public function getManagementServer() - { - return $this->management_server; - } - - public function hasManagementServer() - { - return isset($this->management_server); - } - - public function clearManagementServer() - { - unset($this->management_server); - } - - /** - * Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer management_server = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BackupDR\V1\ManagementServer $var - * @return $this - */ - public function setManagementServer($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ManagementServer::class); - $this->management_server = $var; - - return $this; - } - - /** - * 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). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * 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). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteManagementServerRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteManagementServerRequest.php deleted file mode 100644 index c8bc344f88f3..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/DeleteManagementServerRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.backupdr.v1.DeleteManagementServerRequest - */ -class DeleteManagementServerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * 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). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * @param string $name Required. Name of the resource - * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. - * - * @return \Google\Cloud\BackupDR\V1\DeleteManagementServerRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource - * @type string $request_id - * 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). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the resource - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * 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). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * 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). - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetManagementServerRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetManagementServerRequest.php deleted file mode 100644 index 7c83be3986fc..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/GetManagementServerRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.backupdr.v1.GetManagementServerRequest - */ -class GetManagementServerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the management server resource name, in the format - * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the management server resource name, in the format - * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' - * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. - * - * @return \Google\Cloud\BackupDR\V1\GetManagementServerRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the management server resource name, in the format - * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the management server resource name, in the format - * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the management server resource name, in the format - * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersRequest.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersRequest.php deleted file mode 100644 index 963e2af63f5e..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersRequest.php +++ /dev/null @@ -1,266 +0,0 @@ -google.cloud.backupdr.v1.ListManagementServersRequest - */ -class ListManagementServersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filtering results. - * - * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = null; - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = null; - - /** - * @param string $parent Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. Please see - * {@see BackupDRClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\BackupDR\V1\ListManagementServersRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - * @type int $page_size - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @type string $page_token - * Optional. A token identifying a page of results the server should return. - * @type string $filter - * Optional. Filtering results. - * @type string $order_by - * Optional. Hint for how to order the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Filtering results. - * - * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return isset($this->filter) ? $this->filter : ''; - } - - public function hasFilter() - { - return isset($this->filter); - } - - public function clearFilter() - { - unset($this->filter); - } - - /** - * Optional. Filtering results. - * - * Generated from protobuf field optional string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return isset($this->order_by) ? $this->order_by : ''; - } - - public function hasOrderBy() - { - return isset($this->order_by); - } - - public function clearOrderBy() - { - unset($this->order_by); - } - - /** - * Optional. Hint for how to order the results. - * - * Generated from protobuf field optional string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersResponse.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersResponse.php deleted file mode 100644 index 84bd573686db..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ListManagementServersResponse.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.backupdr.v1.ListManagementServersResponse - */ -class ListManagementServersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * 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. - * - * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; - */ - private $management_servers; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $management_servers - * 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. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * 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. - * - * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getManagementServers() - { - return $this->management_servers; - } - - /** - * 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. - * - * Generated from protobuf field repeated .google.cloud.backupdr.v1.ManagementServer management_servers = 1; - * @param array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setManagementServers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\ManagementServer::class); - $this->management_servers = $arr; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer.php deleted file mode 100644 index 70295addc1c0..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer.php +++ /dev/null @@ -1,716 +0,0 @@ -google.cloud.backupdr.v1.ManagementServer - */ -class ManagementServer extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Identifier. The resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Optional. The description of the ManagementServer instance (2048 characters - * or less). - * - * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * 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. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. The type of the ManagementServer resource. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $type = 0; - /** - * 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. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $management_uri = null; - /** - * 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. - * - * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $workforce_identity_based_management_uri = null; - /** - * Output only. The ManagementServer state. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Required. VPC networks to which the ManagementServer instance is connected. - * For this version, only a single network is supported. - * - * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - private $networks; - /** - * Optional. Server specified ETag for the ManagementServer resource to - * prevent simultaneous updates from overwiting each other. - * - * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Output only. The OAuth 2.0 client id is required to make API calls to the - * BackupDR 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). - * - * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $oauth2_client_id = ''; - /** - * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. - * - * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $workforce_identity_based_oauth2_client_id = null; - /** - * Output only. The hostname or ip address of the exposed AGM endpoints, used - * by BAs to connect to BA proxy. - * - * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $ba_proxy_uri; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = null; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzi = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Identifier. The resource name. - * @type string $description - * Optional. The description of the ManagementServer instance (2048 characters - * or less). - * @type array|\Google\Protobuf\Internal\MapField $labels - * 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. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the instance was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the instance was updated. - * @type int $type - * Optional. The type of the ManagementServer resource. - * @type \Google\Cloud\BackupDR\V1\ManagementURI $management_uri - * 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. - * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI $workforce_identity_based_management_uri - * 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. - * @type int $state - * Output only. The ManagementServer state. - * @type array<\Google\Cloud\BackupDR\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $networks - * Required. VPC networks to which the ManagementServer instance is connected. - * For this version, only a single network is supported. - * @type string $etag - * Optional. Server specified ETag for the ManagementServer resource to - * prevent simultaneous updates from overwiting each other. - * @type string $oauth2_client_id - * Output only. The OAuth 2.0 client id is required to make API calls to the - * BackupDR 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). - * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $workforce_identity_based_oauth2_client_id - * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. - * @type array|\Google\Protobuf\Internal\RepeatedField $ba_proxy_uri - * Output only. The hostname or ip address of the exposed AGM endpoints, used - * by BAs to connect to BA proxy. - * @type \Google\Protobuf\BoolValue $satisfies_pzs - * Output only. Reserved for future use. - * @type bool $satisfies_pzi - * Output only. Reserved for future use. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Identifier. The resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Identifier. The resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The description of the ManagementServer instance (2048 characters - * or less). - * - * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. The description of the ManagementServer instance (2048 characters - * or less). - * - * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * 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. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * 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. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the instance was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the instance was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Optional. The type of the ManagementServer resource. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Optional. The type of the ManagementServer resource. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceType type = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ManagementServer\InstanceType::class); - $this->type = $var; - - return $this; - } - - /** - * 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. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\BackupDR\V1\ManagementURI|null - */ - public function getManagementUri() - { - return $this->management_uri; - } - - public function hasManagementUri() - { - return isset($this->management_uri); - } - - public function clearManagementUri() - { - unset($this->management_uri); - } - - /** - * 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. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementURI management_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\BackupDR\V1\ManagementURI $var - * @return $this - */ - public function setManagementUri($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ManagementURI::class); - $this->management_uri = $var; - - return $this; - } - - /** - * 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. - * - * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI|null - */ - public function getWorkforceIdentityBasedManagementUri() - { - return $this->workforce_identity_based_management_uri; - } - - public function hasWorkforceIdentityBasedManagementUri() - { - return isset($this->workforce_identity_based_management_uri); - } - - public function clearWorkforceIdentityBasedManagementUri() - { - unset($this->workforce_identity_based_management_uri); - } - - /** - * 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. - * - * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI $var - * @return $this - */ - public function setWorkforceIdentityBasedManagementUri($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedManagementURI::class); - $this->workforce_identity_based_management_uri = $var; - - return $this; - } - - /** - * Output only. The ManagementServer state. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The ManagementServer state. - * - * Generated from protobuf field .google.cloud.backupdr.v1.ManagementServer.InstanceState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ManagementServer\InstanceState::class); - $this->state = $var; - - return $this; - } - - /** - * Required. VPC networks to which the ManagementServer instance is connected. - * For this version, only a single network is supported. - * - * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNetworks() - { - return $this->networks; - } - - /** - * Required. VPC networks to which the ManagementServer instance is connected. - * For this version, only a single network is supported. - * - * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkConfig networks = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\BackupDR\V1\NetworkConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNetworks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\NetworkConfig::class); - $this->networks = $arr; - - return $this; - } - - /** - * Optional. Server specified ETag for the ManagementServer resource to - * prevent simultaneous updates from overwiting each other. - * - * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. Server specified ETag for the ManagementServer resource to - * prevent simultaneous updates from overwiting each other. - * - * Generated from protobuf field string etag = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Output only. The OAuth 2.0 client id is required to make API calls to the - * BackupDR 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). - * - * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getOauth2ClientId() - { - return $this->oauth2_client_id; - } - - /** - * Output only. The OAuth 2.0 client id is required to make API calls to the - * BackupDR 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). - * - * Generated from protobuf field string oauth2_client_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setOauth2ClientId($var) - { - GPBUtil::checkString($var, True); - $this->oauth2_client_id = $var; - - return $this; - } - - /** - * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. - * - * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID|null - */ - public function getWorkforceIdentityBasedOauth2ClientId() - { - return $this->workforce_identity_based_oauth2_client_id; - } - - public function hasWorkforceIdentityBasedOauth2ClientId() - { - return isset($this->workforce_identity_based_oauth2_client_id); - } - - public function clearWorkforceIdentityBasedOauth2ClientId() - { - unset($this->workforce_identity_based_oauth2_client_id); - } - - /** - * Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. - * - * Generated from protobuf field .google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID workforce_identity_based_oauth2_client_id = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $var - * @return $this - */ - public function setWorkforceIdentityBasedOauth2ClientId($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID::class); - $this->workforce_identity_based_oauth2_client_id = $var; - - return $this; - } - - /** - * Output only. The hostname or ip address of the exposed AGM endpoints, used - * by BAs to connect to BA proxy. - * - * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBaProxyUri() - { - return $this->ba_proxy_uri; - } - - /** - * Output only. The hostname or ip address of the exposed AGM endpoints, used - * by BAs to connect to BA proxy. - * - * Generated from protobuf field repeated string ba_proxy_uri = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBaProxyUri($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ba_proxy_uri = $arr; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\BoolValue|null - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - public function hasSatisfiesPzs() - { - return isset($this->satisfies_pzs); - } - - public function clearSatisfiesPzs() - { - unset($this->satisfies_pzs); - } - - /** - * Returns the unboxed value from getSatisfiesPzs() - - * Output only. Reserved for future use. - * - * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool|null - */ - public function getSatisfiesPzsUnwrapped() - { - return $this->readWrapperValue("satisfies_pzs"); - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\BoolValue $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. - - * Output only. Reserved for future use. - * - * Generated from protobuf field .google.protobuf.BoolValue satisfies_pzs = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool|null $var - * @return $this - */ - public function setSatisfiesPzsUnwrapped($var) - { - $this->writeWrapperValue("satisfies_pzs", $var); - return $this;} - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzi() - { - return $this->satisfies_pzi; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzi($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzi = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceState.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceState.php deleted file mode 100644 index 1973178f3721..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceState.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.backupdr.v1.ManagementServer.InstanceState - */ -class InstanceState -{ - /** - * State not set. - * - * Generated from protobuf enum INSTANCE_STATE_UNSPECIFIED = 0; - */ - const INSTANCE_STATE_UNSPECIFIED = 0; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The instance has been created and is fully usable. - * - * Generated from protobuf enum READY = 2; - */ - const 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. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The instance is being repaired and may be unstable. - * - * Generated from protobuf enum REPAIRING = 5; - */ - const REPAIRING = 5; - /** - * Maintenance is being performed on this instance. - * - * Generated from protobuf enum MAINTENANCE = 6; - */ - const MAINTENANCE = 6; - /** - * The instance is experiencing an issue and might be unusable. You can get - * further details from the statusMessage field of Instance resource. - * - * Generated from protobuf enum ERROR = 7; - */ - const ERROR = 7; - - private static $valueToName = [ - self::INSTANCE_STATE_UNSPECIFIED => 'INSTANCE_STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::READY => 'READY', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::REPAIRING => 'REPAIRING', - self::MAINTENANCE => 'MAINTENANCE', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceState::class, \Google\Cloud\BackupDR\V1\ManagementServer_InstanceState::class); - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceType.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceType.php deleted file mode 100644 index edb8d1ad4dcf..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementServer/InstanceType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.backupdr.v1.ManagementServer.InstanceType - */ -class InstanceType -{ - /** - * Instance type is not mentioned. - * - * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; - */ - const INSTANCE_TYPE_UNSPECIFIED = 0; - /** - * Instance for backup and restore management (i.e., AGM). - * - * Generated from protobuf enum BACKUP_RESTORE = 1; - */ - const BACKUP_RESTORE = 1; - - private static $valueToName = [ - self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', - self::BACKUP_RESTORE => 'BACKUP_RESTORE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceType::class, \Google\Cloud\BackupDR\V1\ManagementServer_InstanceType::class); - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementURI.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementURI.php deleted file mode 100644 index 5f9224ac9402..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/ManagementURI.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.backupdr.v1.ManagementURI - */ -class ManagementURI extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The ManagementServer AGM/RD WebUI URL. - * - * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $web_ui = ''; - /** - * Output only. The ManagementServer AGM/RD API URL. - * - * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $web_ui - * Output only. The ManagementServer AGM/RD WebUI URL. - * @type string $api - * Output only. The ManagementServer AGM/RD API URL. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The ManagementServer AGM/RD WebUI URL. - * - * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getWebUi() - { - return $this->web_ui; - } - - /** - * Output only. The ManagementServer AGM/RD WebUI URL. - * - * Generated from protobuf field string web_ui = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setWebUi($var) - { - GPBUtil::checkString($var, True); - $this->web_ui = $var; - - return $this; - } - - /** - * Output only. The ManagementServer AGM/RD API URL. - * - * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApi() - { - return $this->api; - } - - /** - * Output only. The ManagementServer AGM/RD API URL. - * - * Generated from protobuf field string api = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApi($var) - { - GPBUtil::checkString($var, True); - $this->api = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig.php deleted file mode 100644 index 93a42fa20272..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.backupdr.v1.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The resource name of the Google Compute Engine VPC network to - * which the ManagementServer instance is connected. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $network = ''; - /** - * Optional. The network connect mode of the ManagementServer instance. For - * this version, only PRIVATE_SERVICE_ACCESS is supported. - * - * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $peering_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * Optional. The resource name of the Google Compute Engine VPC network to - * which the ManagementServer instance is connected. - * @type int $peering_mode - * Optional. The network connect mode of the ManagementServer instance. For - * this version, only PRIVATE_SERVICE_ACCESS is supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The resource name of the Google Compute Engine VPC network to - * which the ManagementServer instance is connected. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Optional. The resource name of the Google Compute Engine VPC network to - * which the ManagementServer instance is connected. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Optional. The network connect mode of the ManagementServer instance. For - * this version, only PRIVATE_SERVICE_ACCESS is supported. - * - * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPeeringMode() - { - return $this->peering_mode; - } - - /** - * Optional. The network connect mode of the ManagementServer instance. For - * this version, only PRIVATE_SERVICE_ACCESS is supported. - * - * Generated from protobuf field .google.cloud.backupdr.v1.NetworkConfig.PeeringMode peering_mode = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPeeringMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkConfig\PeeringMode::class); - $this->peering_mode = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig/PeeringMode.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig/PeeringMode.php deleted file mode 100644 index 6c153e8bd600..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/NetworkConfig/PeeringMode.php +++ /dev/null @@ -1,59 +0,0 @@ -google.cloud.backupdr.v1.NetworkConfig.PeeringMode - */ -class PeeringMode -{ - /** - * Peering mode not set. - * - * Generated from protobuf enum PEERING_MODE_UNSPECIFIED = 0; - */ - const 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 Cloud BackupDR. - * - * Generated from protobuf enum PRIVATE_SERVICE_ACCESS = 1; - */ - const PRIVATE_SERVICE_ACCESS = 1; - - private static $valueToName = [ - self::PEERING_MODE_UNSPECIFIED => 'PEERING_MODE_UNSPECIFIED', - self::PRIVATE_SERVICE_ACCESS => 'PRIVATE_SERVICE_ACCESS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PeeringMode::class, \Google\Cloud\BackupDR\V1\NetworkConfig_PeeringMode::class); - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/OperationMetadata.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/OperationMetadata.php deleted file mode 100644 index e880bbc7986d..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/OperationMetadata.php +++ /dev/null @@ -1,345 +0,0 @@ -google.cloud.backupdr.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * 'Code.CANCELLED'. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - /** - * Output only. AdditionalInfo contains additional Info related to backup plan - * association resource. - * - * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $additional_info; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * 'Code.CANCELLED'. - * @type string $api_version - * Output only. API version used to start the operation. - * @type array|\Google\Protobuf\Internal\MapField $additional_info - * Output only. AdditionalInfo contains additional Info related to backup plan - * association resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * 'Code.CANCELLED'. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * 'Code.CANCELLED'. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - - /** - * Output only. AdditionalInfo contains additional Info related to backup plan - * association resource. - * - * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAdditionalInfo() - { - return $this->additional_info; - } - - /** - * Output only. AdditionalInfo contains additional Info related to backup plan - * association resource. - * - * Generated from protobuf field map additional_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAdditionalInfo($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->additional_info = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedManagementURI.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedManagementURI.php deleted file mode 100644 index d12b8eb71a64..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedManagementURI.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - */ -class WorkforceIdentityBasedManagementURI extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. First party Management URI for Google Identities. - * - * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $first_party_management_uri = ''; - /** - * Output only. Third party Management URI for External Identity Providers. - * - * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $third_party_management_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $first_party_management_uri - * Output only. First party Management URI for Google Identities. - * @type string $third_party_management_uri - * Output only. Third party Management URI for External Identity Providers. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Output only. First party Management URI for Google Identities. - * - * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getFirstPartyManagementUri() - { - return $this->first_party_management_uri; - } - - /** - * Output only. First party Management URI for Google Identities. - * - * Generated from protobuf field string first_party_management_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setFirstPartyManagementUri($var) - { - GPBUtil::checkString($var, True); - $this->first_party_management_uri = $var; - - return $this; - } - - /** - * Output only. Third party Management URI for External Identity Providers. - * - * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getThirdPartyManagementUri() - { - return $this->third_party_management_uri; - } - - /** - * Output only. Third party Management URI for External Identity Providers. - * - * Generated from protobuf field string third_party_management_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setThirdPartyManagementUri($var) - { - GPBUtil::checkString($var, True); - $this->third_party_management_uri = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedOAuth2ClientID.php b/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedOAuth2ClientID.php deleted file mode 100644 index dd38518e5411..000000000000 --- a/owl-bot-staging/BackupDr/v1/proto/src/Google/Cloud/BackupDR/V1/WorkforceIdentityBasedOAuth2ClientID.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - */ -class WorkforceIdentityBasedOAuth2ClientID extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. First party OAuth Client ID for Google Identities. - * - * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $first_party_oauth2_client_id = ''; - /** - * Output only. Third party OAuth Client ID for External Identity Providers. - * - * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $third_party_oauth2_client_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $first_party_oauth2_client_id - * Output only. First party OAuth Client ID for Google Identities. - * @type string $third_party_oauth2_client_id - * Output only. Third party OAuth Client ID for External Identity Providers. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Backupdr\V1\Backupdr::initOnce(); - parent::__construct($data); - } - - /** - * Output only. First party OAuth Client ID for Google Identities. - * - * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getFirstPartyOauth2ClientId() - { - return $this->first_party_oauth2_client_id; - } - - /** - * Output only. First party OAuth Client ID for Google Identities. - * - * Generated from protobuf field string first_party_oauth2_client_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setFirstPartyOauth2ClientId($var) - { - GPBUtil::checkString($var, True); - $this->first_party_oauth2_client_id = $var; - - return $this; - } - - /** - * Output only. Third party OAuth Client ID for External Identity Providers. - * - * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getThirdPartyOauth2ClientId() - { - return $this->third_party_oauth2_client_id; - } - - /** - * Output only. Third party OAuth Client ID for External Identity Providers. - * - * Generated from protobuf field string third_party_oauth2_client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setThirdPartyOauth2ClientId($var) - { - GPBUtil::checkString($var, True); - $this->third_party_oauth2_client_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_management_server.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_management_server.php deleted file mode 100644 index c453145930c7..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/create_management_server.php +++ /dev/null @@ -1,96 +0,0 @@ -setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) - ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $backupDRClient->createManagementServer($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ManagementServer $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = '[MANAGEMENT_SERVER_ID]'; - - create_management_server_sample($formattedParent, $managementServerId); -} -// [END backupdr_v1_generated_BackupDR_CreateManagementServer_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_management_server.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_management_server.php deleted file mode 100644 index 600741c46b66..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/delete_management_server.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $backupDRClient->deleteManagementServer($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = BackupDRClient::managementServerName( - '[PROJECT]', - '[LOCATION]', - '[MANAGEMENTSERVER]' - ); - - delete_management_server_sample($formattedName); -} -// [END backupdr_v1_generated_BackupDR_DeleteManagementServer_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_iam_policy.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_iam_policy.php deleted file mode 100644 index 051e2e471612..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $backupDRClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END backupdr_v1_generated_BackupDR_GetIamPolicy_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_location.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_location.php deleted file mode 100644 index 6e6c3ede82e1..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END backupdr_v1_generated_BackupDR_GetLocation_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_management_server.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_management_server.php deleted file mode 100644 index f7fa6231f8c0..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/get_management_server.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ManagementServer $response */ - $response = $backupDRClient->getManagementServer($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = BackupDRClient::managementServerName( - '[PROJECT]', - '[LOCATION]', - '[MANAGEMENTSERVER]' - ); - - get_management_server_sample($formattedName); -} -// [END backupdr_v1_generated_BackupDR_GetManagementServer_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_locations.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_locations.php deleted file mode 100644 index baacf567a7fa..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END backupdr_v1_generated_BackupDR_ListLocations_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_management_servers.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_management_servers.php deleted file mode 100644 index c1a2219808e9..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/list_management_servers.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $backupDRClient->listManagementServers($request); - - /** @var ManagementServer $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); - - list_management_servers_sample($formattedParent); -} -// [END backupdr_v1_generated_BackupDR_ListManagementServers_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/set_iam_policy.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/set_iam_policy.php deleted file mode 100644 index 5de0fc44b7fb..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $backupDRClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END backupdr_v1_generated_BackupDR_SetIamPolicy_sync] diff --git a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/test_iam_permissions.php b/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/test_iam_permissions.php deleted file mode 100644 index e9e41bb418a7..000000000000 --- a/owl-bot-staging/BackupDr/v1/samples/V1/BackupDRClient/test_iam_permissions.php +++ /dev/null @@ -1,84 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $backupDRClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END backupdr_v1_generated_BackupDR_TestIamPermissions_sync] diff --git a/owl-bot-staging/BackupDr/v1/src/V1/Client/BackupDRClient.php b/owl-bot-staging/BackupDr/v1/src/V1/Client/BackupDRClient.php deleted file mode 100644 index 3b2c92203bbb..000000000000 --- a/owl-bot-staging/BackupDr/v1/src/V1/Client/BackupDRClient.php +++ /dev/null @@ -1,1307 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/backup_dr_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/backup_dr_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/backup_dr_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/backup_dr_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Create the default operation client for the service. - * - * @param array $options ClientOptions for the client. - * - * @return OperationsClient - */ - private function createOperationsClient(array $options) - { - // Unset client-specific configuration options - unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); - - if (isset($options['operationsClient'])) { - return $options['operationsClient']; - } - - return new OperationsClient($options); - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $backupvault - * @param string $datasource - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName(string $project, string $location, string $backupvault, string $datasource, string $backup): string - { - return self::getPathTemplate('backup')->render([ - 'project' => $project, - 'location' => $location, - 'backupvault' => $backupvault, - 'datasource' => $datasource, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a backup_plan - * resource. - * - * @param string $project - * @param string $location - * @param string $backupPlan - * - * @return string The formatted backup_plan resource. - */ - public static function backupPlanName(string $project, string $location, string $backupPlan): string - { - return self::getPathTemplate('backupPlan')->render([ - 'project' => $project, - 'location' => $location, - 'backup_plan' => $backupPlan, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * backup_plan_association resource. - * - * @param string $project - * @param string $location - * @param string $backupPlanAssociation - * - * @return string The formatted backup_plan_association resource. - */ - public static function backupPlanAssociationName(string $project, string $location, string $backupPlanAssociation): string - { - return self::getPathTemplate('backupPlanAssociation')->render([ - 'project' => $project, - 'location' => $location, - 'backup_plan_association' => $backupPlanAssociation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a backup_vault - * resource. - * - * @param string $project - * @param string $location - * @param string $backupvault - * - * @return string The formatted backup_vault resource. - */ - public static function backupVaultName(string $project, string $location, string $backupvault): string - { - return self::getPathTemplate('backupVault')->render([ - 'project' => $project, - 'location' => $location, - 'backupvault' => $backupvault, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a data_source - * resource. - * - * @param string $project - * @param string $location - * @param string $backupvault - * @param string $datasource - * - * @return string The formatted data_source resource. - */ - public static function dataSourceName(string $project, string $location, string $backupvault, string $datasource): string - { - return self::getPathTemplate('dataSource')->render([ - 'project' => $project, - 'location' => $location, - 'backupvault' => $backupvault, - 'datasource' => $datasource, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * management_server resource. - * - * @param string $project - * @param string $location - * @param string $managementserver - * - * @return string The formatted management_server resource. - */ - public static function managementServerName(string $project, string $location, string $managementserver): string - { - return self::getPathTemplate('managementServer')->render([ - 'project' => $project, - 'location' => $location, - 'managementserver' => $managementserver, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - backup: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup} - * - backupPlan: projects/{project}/locations/{location}/backupPlans/{backup_plan} - * - backupPlanAssociation: projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association} - * - backupVault: projects/{project}/locations/{location}/backupVaults/{backupvault} - * - dataSource: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} - * - location: projects/{project}/locations/{location} - * - managementServer: projects/{project}/locations/{location}/managementServers/{managementserver} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'backupdr.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Create a BackupPlan - * - * The async variant is {@see BackupDRClient::createBackupPlanAsync()} . - * - * @example samples/V1/BackupDRClient/create_backup_plan.php - * - * @param CreateBackupPlanRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createBackupPlan(CreateBackupPlanRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateBackupPlan', $request, $callOptions)->wait(); - } - - /** - * Create a BackupPlanAssociation - * - * The async variant is {@see BackupDRClient::createBackupPlanAssociationAsync()} . - * - * @example samples/V1/BackupDRClient/create_backup_plan_association.php - * - * @param CreateBackupPlanAssociationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createBackupPlanAssociation(CreateBackupPlanAssociationRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateBackupPlanAssociation', $request, $callOptions)->wait(); - } - - /** - * Creates a new BackupVault in a given project and location. - * - * The async variant is {@see BackupDRClient::createBackupVaultAsync()} . - * - * @example samples/V1/BackupDRClient/create_backup_vault.php - * - * @param CreateBackupVaultRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createBackupVault(CreateBackupVaultRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateBackupVault', $request, $callOptions)->wait(); - } - - /** - * Creates a new ManagementServer in a given project and location. - * - * The async variant is {@see BackupDRClient::createManagementServerAsync()} . - * - * @example samples/V1/BackupDRClient/create_management_server.php - * - * @param CreateManagementServerRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createManagementServer(CreateManagementServerRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateManagementServer', $request, $callOptions)->wait(); - } - - /** - * Deletes a Backup. - * - * The async variant is {@see BackupDRClient::deleteBackupAsync()} . - * - * @example samples/V1/BackupDRClient/delete_backup.php - * - * @param DeleteBackupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteBackup(DeleteBackupRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteBackup', $request, $callOptions)->wait(); - } - - /** - * Deletes a single BackupPlan. - * - * The async variant is {@see BackupDRClient::deleteBackupPlanAsync()} . - * - * @example samples/V1/BackupDRClient/delete_backup_plan.php - * - * @param DeleteBackupPlanRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteBackupPlan(DeleteBackupPlanRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteBackupPlan', $request, $callOptions)->wait(); - } - - /** - * Deletes a single BackupPlanAssociation. - * - * The async variant is {@see BackupDRClient::deleteBackupPlanAssociationAsync()} . - * - * @example samples/V1/BackupDRClient/delete_backup_plan_association.php - * - * @param DeleteBackupPlanAssociationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteBackupPlanAssociation(DeleteBackupPlanAssociationRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteBackupPlanAssociation', $request, $callOptions)->wait(); - } - - /** - * Deletes a BackupVault. - * - * The async variant is {@see BackupDRClient::deleteBackupVaultAsync()} . - * - * @example samples/V1/BackupDRClient/delete_backup_vault.php - * - * @param DeleteBackupVaultRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteBackupVault(DeleteBackupVaultRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteBackupVault', $request, $callOptions)->wait(); - } - - /** - * Deletes a single ManagementServer. - * - * The async variant is {@see BackupDRClient::deleteManagementServerAsync()} . - * - * @example samples/V1/BackupDRClient/delete_management_server.php - * - * @param DeleteManagementServerRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteManagementServer(DeleteManagementServerRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteManagementServer', $request, $callOptions)->wait(); - } - - /** - * FetchUsableBackupVaults lists usable BackupVaults in a given project and - * location. Usable BackupVault are the ones that user has - * backupdr.backupVaults.get permission. - * - * The async variant is {@see BackupDRClient::fetchUsableBackupVaultsAsync()} . - * - * @example samples/V1/BackupDRClient/fetch_usable_backup_vaults.php - * - * @param FetchUsableBackupVaultsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function fetchUsableBackupVaults(FetchUsableBackupVaultsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('FetchUsableBackupVaults', $request, $callOptions); - } - - /** - * Gets details of a Backup. - * - * The async variant is {@see BackupDRClient::getBackupAsync()} . - * - * @example samples/V1/BackupDRClient/get_backup.php - * - * @param GetBackupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Backup - * - * @throws ApiException Thrown if the API call fails. - */ - public function getBackup(GetBackupRequest $request, array $callOptions = []): Backup - { - return $this->startApiCall('GetBackup', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single BackupPlan. - * - * The async variant is {@see BackupDRClient::getBackupPlanAsync()} . - * - * @example samples/V1/BackupDRClient/get_backup_plan.php - * - * @param GetBackupPlanRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return BackupPlan - * - * @throws ApiException Thrown if the API call fails. - */ - public function getBackupPlan(GetBackupPlanRequest $request, array $callOptions = []): BackupPlan - { - return $this->startApiCall('GetBackupPlan', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single BackupPlanAssociation. - * - * The async variant is {@see BackupDRClient::getBackupPlanAssociationAsync()} . - * - * @example samples/V1/BackupDRClient/get_backup_plan_association.php - * - * @param GetBackupPlanAssociationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return BackupPlanAssociation - * - * @throws ApiException Thrown if the API call fails. - */ - public function getBackupPlanAssociation(GetBackupPlanAssociationRequest $request, array $callOptions = []): BackupPlanAssociation - { - return $this->startApiCall('GetBackupPlanAssociation', $request, $callOptions)->wait(); - } - - /** - * Gets details of a BackupVault. - * - * The async variant is {@see BackupDRClient::getBackupVaultAsync()} . - * - * @example samples/V1/BackupDRClient/get_backup_vault.php - * - * @param GetBackupVaultRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return BackupVault - * - * @throws ApiException Thrown if the API call fails. - */ - public function getBackupVault(GetBackupVaultRequest $request, array $callOptions = []): BackupVault - { - return $this->startApiCall('GetBackupVault', $request, $callOptions)->wait(); - } - - /** - * Gets details of a DataSource. - * - * The async variant is {@see BackupDRClient::getDataSourceAsync()} . - * - * @example samples/V1/BackupDRClient/get_data_source.php - * - * @param GetDataSourceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return DataSource - * - * @throws ApiException Thrown if the API call fails. - */ - public function getDataSource(GetDataSourceRequest $request, array $callOptions = []): DataSource - { - return $this->startApiCall('GetDataSource', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single ManagementServer. - * - * The async variant is {@see BackupDRClient::getManagementServerAsync()} . - * - * @example samples/V1/BackupDRClient/get_management_server.php - * - * @param GetManagementServerRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ManagementServer - * - * @throws ApiException Thrown if the API call fails. - */ - public function getManagementServer(GetManagementServerRequest $request, array $callOptions = []): ManagementServer - { - return $this->startApiCall('GetManagementServer', $request, $callOptions)->wait(); - } - - /** - * Lists BackupPlanAssociations in a given project and location. - * - * The async variant is {@see BackupDRClient::listBackupPlanAssociationsAsync()} . - * - * @example samples/V1/BackupDRClient/list_backup_plan_associations.php - * - * @param ListBackupPlanAssociationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listBackupPlanAssociations(ListBackupPlanAssociationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListBackupPlanAssociations', $request, $callOptions); - } - - /** - * Lists BackupPlans in a given project and location. - * - * The async variant is {@see BackupDRClient::listBackupPlansAsync()} . - * - * @example samples/V1/BackupDRClient/list_backup_plans.php - * - * @param ListBackupPlansRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listBackupPlans(ListBackupPlansRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListBackupPlans', $request, $callOptions); - } - - /** - * Lists BackupVaults in a given project and location. - * - * The async variant is {@see BackupDRClient::listBackupVaultsAsync()} . - * - * @example samples/V1/BackupDRClient/list_backup_vaults.php - * - * @param ListBackupVaultsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listBackupVaults(ListBackupVaultsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListBackupVaults', $request, $callOptions); - } - - /** - * Lists Backups in a given project and location. - * - * The async variant is {@see BackupDRClient::listBackupsAsync()} . - * - * @example samples/V1/BackupDRClient/list_backups.php - * - * @param ListBackupsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listBackups(ListBackupsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListBackups', $request, $callOptions); - } - - /** - * Lists DataSources in a given project and location. - * - * The async variant is {@see BackupDRClient::listDataSourcesAsync()} . - * - * @example samples/V1/BackupDRClient/list_data_sources.php - * - * @param ListDataSourcesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listDataSources(ListDataSourcesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListDataSources', $request, $callOptions); - } - - /** - * Lists ManagementServers in a given project and location. - * - * The async variant is {@see BackupDRClient::listManagementServersAsync()} . - * - * @example samples/V1/BackupDRClient/list_management_servers.php - * - * @param ListManagementServersRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listManagementServers(ListManagementServersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListManagementServers', $request, $callOptions); - } - - /** - * Restore from a Backup - * - * The async variant is {@see BackupDRClient::restoreBackupAsync()} . - * - * @example samples/V1/BackupDRClient/restore_backup.php - * - * @param RestoreBackupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function restoreBackup(RestoreBackupRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RestoreBackup', $request, $callOptions)->wait(); - } - - /** - * Triggers a new Backup. - * - * The async variant is {@see BackupDRClient::triggerBackupAsync()} . - * - * @example samples/V1/BackupDRClient/trigger_backup.php - * - * @param TriggerBackupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function triggerBackup(TriggerBackupRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('TriggerBackup', $request, $callOptions)->wait(); - } - - /** - * Updates the settings of a Backup. - * - * The async variant is {@see BackupDRClient::updateBackupAsync()} . - * - * @example samples/V1/BackupDRClient/update_backup.php - * - * @param UpdateBackupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateBackup(UpdateBackupRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateBackup', $request, $callOptions)->wait(); - } - - /** - * Updates the settings of a BackupVault. - * - * The async variant is {@see BackupDRClient::updateBackupVaultAsync()} . - * - * @example samples/V1/BackupDRClient/update_backup_vault.php - * - * @param UpdateBackupVaultRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateBackupVault(UpdateBackupVaultRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateBackupVault', $request, $callOptions)->wait(); - } - - /** - * Updates the settings of a DataSource. - * - * The async variant is {@see BackupDRClient::updateDataSourceAsync()} . - * - * @example samples/V1/BackupDRClient/update_data_source.php - * - * @param UpdateDataSourceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateDataSource(UpdateDataSourceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateDataSource', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see BackupDRClient::getLocationAsync()} . - * - * @example samples/V1/BackupDRClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see BackupDRClient::listLocationsAsync()} . - * - * @example samples/V1/BackupDRClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * The async variant is {@see BackupDRClient::getIamPolicyAsync()} . - * - * @example samples/V1/BackupDRClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * The async variant is {@see BackupDRClient::setIamPolicyAsync()} . - * - * @example samples/V1/BackupDRClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * The async variant is {@see BackupDRClient::testIamPermissionsAsync()} . - * - * @example samples/V1/BackupDRClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/BackupDr/v1/src/V1/gapic_metadata.json b/owl-bot-staging/BackupDr/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 130c7f38a667..000000000000 --- a/owl-bot-staging/BackupDr/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.backupdr.v1", - "libraryPackage": "Google\\Cloud\\BackupDR\\V1", - "services": { - "BackupDR": { - "clients": { - "grpc": { - "libraryClient": "BackupDRGapicClient", - "rpcs": { - "CreateBackupPlan": { - "methods": [ - "createBackupPlan" - ] - }, - "CreateBackupPlanAssociation": { - "methods": [ - "createBackupPlanAssociation" - ] - }, - "CreateBackupVault": { - "methods": [ - "createBackupVault" - ] - }, - "CreateManagementServer": { - "methods": [ - "createManagementServer" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteBackupPlan": { - "methods": [ - "deleteBackupPlan" - ] - }, - "DeleteBackupPlanAssociation": { - "methods": [ - "deleteBackupPlanAssociation" - ] - }, - "DeleteBackupVault": { - "methods": [ - "deleteBackupVault" - ] - }, - "DeleteManagementServer": { - "methods": [ - "deleteManagementServer" - ] - }, - "FetchUsableBackupVaults": { - "methods": [ - "fetchUsableBackupVaults" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetBackupPlan": { - "methods": [ - "getBackupPlan" - ] - }, - "GetBackupPlanAssociation": { - "methods": [ - "getBackupPlanAssociation" - ] - }, - "GetBackupVault": { - "methods": [ - "getBackupVault" - ] - }, - "GetDataSource": { - "methods": [ - "getDataSource" - ] - }, - "GetManagementServer": { - "methods": [ - "getManagementServer" - ] - }, - "ListBackupPlanAssociations": { - "methods": [ - "listBackupPlanAssociations" - ] - }, - "ListBackupPlans": { - "methods": [ - "listBackupPlans" - ] - }, - "ListBackupVaults": { - "methods": [ - "listBackupVaults" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListDataSources": { - "methods": [ - "listDataSources" - ] - }, - "ListManagementServers": { - "methods": [ - "listManagementServers" - ] - }, - "RestoreBackup": { - "methods": [ - "restoreBackup" - ] - }, - "TriggerBackup": { - "methods": [ - "triggerBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "UpdateBackupVault": { - "methods": [ - "updateBackupVault" - ] - }, - "UpdateDataSource": { - "methods": [ - "updateDataSource" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_client_config.json b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_client_config.json deleted file mode 100644 index c505f44b1add..000000000000 --- a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_client_config.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "interfaces": { - "google.cloud.backupdr.v1.BackupDR": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateBackupPlan": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CreateBackupPlanAssociation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CreateBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateManagementServer": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteBackupPlan": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteBackupPlanAssociation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteManagementServer": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "FetchUsableBackupVaults": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetBackupPlan": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetBackupPlanAssociation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetDataSource": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetManagementServer": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBackupPlanAssociations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListBackupPlans": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListBackupVaults": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListDataSources": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListManagementServers": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RestoreBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TriggerBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateDataSource": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_descriptor_config.php b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_descriptor_config.php deleted file mode 100644 index 669fa4bd998c..000000000000 --- a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_descriptor_config.php +++ /dev/null @@ -1,591 +0,0 @@ - [ - 'google.cloud.backupdr.v1.BackupDR' => [ - 'CreateBackupPlan' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlan', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateBackupPlanAssociation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateBackupVault' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateManagementServer' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\ManagementServer', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupPlan' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupPlanAssociation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupVault' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteManagementServer' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RestoreBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\RestoreBackupResponse', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'TriggerBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'backup.name', - 'fieldAccessors' => [ - 'getBackup', - 'getName', - ], - ], - ], - ], - 'UpdateBackupVault' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'backup_vault.name', - 'fieldAccessors' => [ - 'getBackupVault', - 'getName', - ], - ], - ], - ], - 'UpdateDataSource' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\BackupDR\V1\DataSource', - 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'data_source.name', - 'fieldAccessors' => [ - 'getDataSource', - 'getName', - ], - ], - ], - ], - 'FetchUsableBackupVaults' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackupVaults', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetBackup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\Backup', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupPlan' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlan', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupPlanAssociation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlanAssociation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupVault' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\BackupVault', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetDataSource' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\DataSource', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetManagementServer' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\ManagementServer', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListBackupPlanAssociations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackupPlanAssociations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackupPlans' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackupPlans', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlansResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackupVaults' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackupVaults', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupVaultsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListDataSources' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getDataSources', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\ListDataSourcesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListManagementServers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getManagementServers', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\BackupDR\V1\ListManagementServersResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'templateMap' => [ - 'backup' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}', - 'backupPlan' => 'projects/{project}/locations/{location}/backupPlans/{backup_plan}', - 'backupPlanAssociation' => 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}', - 'backupVault' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}', - 'dataSource' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}', - 'location' => 'projects/{project}/locations/{location}', - 'managementServer' => 'projects/{project}/locations/{location}/managementServers/{managementserver}', - ], - ], - ], -]; diff --git a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_rest_client_config.php b/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_rest_client_config.php deleted file mode 100644 index 072b35af529f..000000000000 --- a/owl-bot-staging/BackupDr/v1/src/V1/resources/backup_dr_rest_client_config.php +++ /dev/null @@ -1,467 +0,0 @@ - [ - 'google.cloud.backupdr.v1.BackupDR' => [ - 'CreateBackupPlan' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', - 'body' => 'backup_plan', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_plan_id', - ], - ], - 'CreateBackupPlanAssociation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', - 'body' => 'backup_plan_association', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_plan_association_id', - ], - ], - 'CreateBackupVault' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', - 'body' => 'backup_vault', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_vault_id', - ], - ], - 'CreateManagementServer' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', - 'body' => 'management_server', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'management_server_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupPlan' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupPlanAssociation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupVault' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteManagementServer' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'FetchUsableBackupVaults' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupPlan' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupPlanAssociation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupVault' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetDataSource' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetManagementServer' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackupPlanAssociations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackupPlans' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackupVaults' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListDataSources' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListManagementServers' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RestoreBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'TriggerBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateBackup' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', - 'body' => 'backup', - 'placeholders' => [ - 'backup.name' => [ - 'getters' => [ - 'getBackup', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateBackupVault' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}', - 'body' => 'backup_vault', - 'placeholders' => [ - 'backup_vault.name' => [ - 'getters' => [ - 'getBackupVault', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateDataSource' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}', - 'body' => 'data_source', - 'placeholders' => [ - 'data_source.name' => [ - 'getters' => [ - 'getDataSource', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:getIamPolicy', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/managementServers/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/BackupDr/v1/tests/Unit/V1/Client/BackupDRClientTest.php b/owl-bot-staging/BackupDr/v1/tests/Unit/V1/Client/BackupDRClientTest.php deleted file mode 100644 index 27d4a103280a..000000000000 --- a/owl-bot-staging/BackupDr/v1/tests/Unit/V1/Client/BackupDRClientTest.php +++ /dev/null @@ -1,3373 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BackupDRClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BackupDRClient($options); - } - - /** @test */ - public function createBackupPlanTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupPlanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $resourceType = 'resourceType979623115'; - $etag = 'etag3123477'; - $backupVault = 'backupVault353808757'; - $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; - $expectedResponse = new BackupPlan(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setResourceType($resourceType); - $expectedResponse->setEtag($etag); - $expectedResponse->setBackupVault($backupVault); - $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupPlanTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupPlanId = 'backupPlanId-25762700'; - $backupPlan = new BackupPlan(); - $backupPlanBackupRules = []; - $backupPlan->setBackupRules($backupPlanBackupRules); - $backupPlanResourceType = 'backupPlanResourceType1515155475'; - $backupPlan->setResourceType($backupPlanResourceType); - $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $backupPlan->setBackupVault($backupPlanBackupVault); - $request = (new CreateBackupPlanRequest()) - ->setParent($formattedParent) - ->setBackupPlanId($backupPlanId) - ->setBackupPlan($backupPlan); - $response = $gapicClient->createBackupPlan($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupPlanId(); - $this->assertProtobufEquals($backupPlanId, $actualValue); - $actualValue = $actualApiRequestObject->getBackupPlan(); - $this->assertProtobufEquals($backupPlan, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupPlanExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupPlanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupPlanId = 'backupPlanId-25762700'; - $backupPlan = new BackupPlan(); - $backupPlanBackupRules = []; - $backupPlan->setBackupRules($backupPlanBackupRules); - $backupPlanResourceType = 'backupPlanResourceType1515155475'; - $backupPlan->setResourceType($backupPlanResourceType); - $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $backupPlan->setBackupVault($backupPlanBackupVault); - $request = (new CreateBackupPlanRequest()) - ->setParent($formattedParent) - ->setBackupPlanId($backupPlanId) - ->setBackupPlan($backupPlan); - $response = $gapicClient->createBackupPlan($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupPlanAssociationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $resourceType = 'resourceType979623115'; - $resource = 'resource-341064690'; - $backupPlan = 'backupPlan1119623046'; - $dataSource = 'dataSource-1333894576'; - $expectedResponse = new BackupPlanAssociation(); - $expectedResponse->setName($name); - $expectedResponse->setResourceType($resourceType); - $expectedResponse->setResource($resource); - $expectedResponse->setBackupPlan($backupPlan); - $expectedResponse->setDataSource($dataSource); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupPlanAssociationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupPlanAssociationId = 'backupPlanAssociationId133124978'; - $backupPlanAssociation = new BackupPlanAssociation(); - $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; - $backupPlanAssociation->setResource($backupPlanAssociationResource); - $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); - $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); - $request = (new CreateBackupPlanAssociationRequest()) - ->setParent($formattedParent) - ->setBackupPlanAssociationId($backupPlanAssociationId) - ->setBackupPlanAssociation($backupPlanAssociation); - $response = $gapicClient->createBackupPlanAssociation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlanAssociation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupPlanAssociationId(); - $this->assertProtobufEquals($backupPlanAssociationId, $actualValue); - $actualValue = $actualApiRequestObject->getBackupPlanAssociation(); - $this->assertProtobufEquals($backupPlanAssociation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupPlanAssociationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupPlanAssociationId = 'backupPlanAssociationId133124978'; - $backupPlanAssociation = new BackupPlanAssociation(); - $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; - $backupPlanAssociation->setResource($backupPlanAssociationResource); - $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); - $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); - $request = (new CreateBackupPlanAssociationRequest()) - ->setParent($formattedParent) - ->setBackupPlanAssociationId($backupPlanAssociationId) - ->setBackupPlanAssociation($backupPlanAssociation); - $response = $gapicClient->createBackupPlanAssociation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupVaultTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupVaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $deletable = true; - $etag = 'etag3123477'; - $backupCount = 336678994; - $serviceAccount = 'serviceAccount-1948028253'; - $totalStoredBytes = 1181597162; - $uid = 'uid115792'; - $expectedResponse = new BackupVault(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setDeletable($deletable); - $expectedResponse->setEtag($etag); - $expectedResponse->setBackupCount($backupCount); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setTotalStoredBytes($totalStoredBytes); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupVaultTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupVaultId = 'backupVaultId467030053'; - $backupVault = new BackupVault(); - $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); - $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); - $request = (new CreateBackupVaultRequest()) - ->setParent($formattedParent) - ->setBackupVaultId($backupVaultId) - ->setBackupVault($backupVault); - $response = $gapicClient->createBackupVault($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupVault', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupVaultId(); - $this->assertProtobufEquals($backupVaultId, $actualValue); - $actualValue = $actualApiRequestObject->getBackupVault(); - $this->assertProtobufEquals($backupVault, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupVaultExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupVaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupVaultId = 'backupVaultId467030053'; - $backupVault = new BackupVault(); - $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); - $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); - $request = (new CreateBackupVaultRequest()) - ->setParent($formattedParent) - ->setBackupVaultId($backupVaultId) - ->setBackupVault($backupVault); - $response = $gapicClient->createBackupVault($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createManagementServerTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createManagementServerTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) - ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServer($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServerId(); - $this->assertProtobufEquals($managementServerId, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServer(); - $this->assertProtobufEquals($managementServer, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createManagementServerExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) - ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServer($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $resourceSizeBytes = 275424386; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setResourceSizeBytes($resourceSizeBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupPlanTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupPlanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupPlanTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); - $request = (new DeleteBackupPlanRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackupPlan($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlan', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupPlanExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupPlanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); - $request = (new DeleteBackupPlanRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackupPlan($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupPlanAssociationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupPlanAssociationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); - $request = (new DeleteBackupPlanAssociationRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackupPlanAssociation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlanAssociation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupPlanAssociationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); - $request = (new DeleteBackupPlanAssociationRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackupPlanAssociation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupVaultTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupVaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupVaultTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $request = (new DeleteBackupVaultRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackupVault($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupVault', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupVaultExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupVaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $request = (new DeleteBackupVaultRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteBackupVault($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteManagementServerTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteManagementServerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteManagementServerTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new DeleteManagementServerRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteManagementServer($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteManagementServer', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteManagementServerExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteManagementServerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new DeleteManagementServerRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteManagementServer($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function fetchUsableBackupVaultsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupVaultsElement = new BackupVault(); - $backupVaults = [ - $backupVaultsElement, - ]; - $expectedResponse = new FetchUsableBackupVaultsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackupVaults($backupVaults); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new FetchUsableBackupVaultsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->fetchUsableBackupVaults($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/FetchUsableBackupVaults', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchUsableBackupVaultsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new FetchUsableBackupVaultsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->fetchUsableBackupVaults($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $resourceSizeBytes = 275424386; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setResourceSizeBytes($resourceSizeBytes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); - $response = $gapicClient->getBackup($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); - try { - $gapicClient->getBackup($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupPlanTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $resourceType = 'resourceType979623115'; - $etag = 'etag3123477'; - $backupVault = 'backupVault353808757'; - $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; - $expectedResponse = new BackupPlan(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setResourceType($resourceType); - $expectedResponse->setEtag($etag); - $expectedResponse->setBackupVault($backupVault); - $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); - $request = (new GetBackupPlanRequest()) - ->setName($formattedName); - $response = $gapicClient->getBackupPlan($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupPlan', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupPlanExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); - $request = (new GetBackupPlanRequest()) - ->setName($formattedName); - try { - $gapicClient->getBackupPlan($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupPlanAssociationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $resourceType = 'resourceType979623115'; - $resource = 'resource-341064690'; - $backupPlan = 'backupPlan1119623046'; - $dataSource = 'dataSource-1333894576'; - $expectedResponse = new BackupPlanAssociation(); - $expectedResponse->setName($name2); - $expectedResponse->setResourceType($resourceType); - $expectedResponse->setResource($resource); - $expectedResponse->setBackupPlan($backupPlan); - $expectedResponse->setDataSource($dataSource); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); - $request = (new GetBackupPlanAssociationRequest()) - ->setName($formattedName); - $response = $gapicClient->getBackupPlanAssociation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupPlanAssociation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupPlanAssociationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); - $request = (new GetBackupPlanAssociationRequest()) - ->setName($formattedName); - try { - $gapicClient->getBackupPlanAssociation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupVaultTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $deletable = true; - $etag = 'etag3123477'; - $backupCount = 336678994; - $serviceAccount = 'serviceAccount-1948028253'; - $totalStoredBytes = 1181597162; - $uid = 'uid115792'; - $expectedResponse = new BackupVault(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setDeletable($deletable); - $expectedResponse->setEtag($etag); - $expectedResponse->setBackupCount($backupCount); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setTotalStoredBytes($totalStoredBytes); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $request = (new GetBackupVaultRequest()) - ->setName($formattedName); - $response = $gapicClient->getBackupVault($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetBackupVault', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupVaultExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $request = (new GetBackupVaultRequest()) - ->setName($formattedName); - try { - $gapicClient->getBackupVault($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataSourceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $backupCount = 336678994; - $etag = 'etag3123477'; - $totalStoredBytes = 1181597162; - $expectedResponse = new DataSource(); - $expectedResponse->setName($name2); - $expectedResponse->setBackupCount($backupCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setTotalStoredBytes($totalStoredBytes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); - $request = (new GetDataSourceRequest()) - ->setName($formattedName); - $response = $gapicClient->getDataSource($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetDataSource', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDataSourceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); - $request = (new GetDataSourceRequest()) - ->setName($formattedName); - try { - $gapicClient->getDataSource($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getManagementServerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new GetManagementServerRequest()) - ->setName($formattedName); - $response = $gapicClient->getManagementServer($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/GetManagementServer', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getManagementServerExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new GetManagementServerRequest()) - ->setName($formattedName); - try { - $gapicClient->getManagementServer($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupPlanAssociationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupPlanAssociationsElement = new BackupPlanAssociation(); - $backupPlanAssociations = [ - $backupPlanAssociationsElement, - ]; - $expectedResponse = new ListBackupPlanAssociationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackupPlanAssociations($backupPlanAssociations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupPlanAssociationsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listBackupPlanAssociations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackupPlanAssociations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlanAssociations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupPlanAssociationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupPlanAssociationsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listBackupPlanAssociations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupPlansTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupPlansElement = new BackupPlan(); - $backupPlans = [ - $backupPlansElement, - ]; - $expectedResponse = new ListBackupPlansResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackupPlans($backupPlans); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupPlansRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listBackupPlans($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackupPlans()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlans', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupPlansExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupPlansRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listBackupPlans($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupVaultsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupVaultsElement = new BackupVault(); - $backupVaults = [ - $backupVaultsElement, - ]; - $expectedResponse = new ListBackupVaultsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackupVaults($backupVaults); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupVaultsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listBackupVaults($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupVaults', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupVaultsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupVaultsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listBackupVaults($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listBackups($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listBackups($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataSourcesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $dataSourcesElement = new DataSource(); - $dataSources = [ - $dataSourcesElement, - ]; - $expectedResponse = new ListDataSourcesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDataSources($dataSources); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $request = (new ListDataSourcesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listDataSources($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDataSources()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListDataSources', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDataSourcesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $request = (new ListDataSourcesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listDataSources($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listManagementServersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $managementServersElement = new ManagementServer(); - $managementServers = [ - $managementServersElement, - ]; - $expectedResponse = new ListManagementServersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setManagementServers($managementServers); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListManagementServersRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listManagementServers($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getManagementServers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListManagementServers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listManagementServersExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListManagementServersRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listManagementServers($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restoreBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new RestoreBackupResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); - $request = (new RestoreBackupRequest()) - ->setName($formattedName); - $response = $gapicClient->restoreBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/RestoreBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]', '[BACKUP]'); - $request = (new RestoreBackupRequest()) - ->setName($formattedName); - $response = $gapicClient->restoreBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function triggerBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/triggerBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $resourceType = 'resourceType979623115'; - $resource = 'resource-341064690'; - $backupPlan = 'backupPlan1119623046'; - $dataSource = 'dataSource-1333894576'; - $expectedResponse = new BackupPlanAssociation(); - $expectedResponse->setName($name2); - $expectedResponse->setResourceType($resourceType); - $expectedResponse->setResource($resource); - $expectedResponse->setBackupPlan($backupPlan); - $expectedResponse->setDataSource($dataSource); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/triggerBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); - $ruleId = 'ruleId1548659006'; - $request = (new TriggerBackupRequest()) - ->setName($formattedName) - ->setRuleId($ruleId); - $response = $gapicClient->triggerBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/TriggerBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getRuleId(); - $this->assertProtobufEquals($ruleId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function triggerBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/triggerBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupPlanAssociationName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN_ASSOCIATION]'); - $ruleId = 'ruleId1548659006'; - $request = (new TriggerBackupRequest()) - ->setName($formattedName) - ->setRuleId($ruleId); - $response = $gapicClient->triggerBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $resourceSizeBytes = 275424386; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $expectedResponse->setResourceSizeBytes($resourceSizeBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $backup = new Backup(); - $request = (new UpdateBackupRequest()) - ->setUpdateMask($updateMask) - ->setBackup($backup); - $response = $gapicClient->updateBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $backup = new Backup(); - $request = (new UpdateBackupRequest()) - ->setUpdateMask($updateMask) - ->setBackup($backup); - $response = $gapicClient->updateBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateBackupVaultTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateBackupVaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $deletable = true; - $etag = 'etag3123477'; - $backupCount = 336678994; - $serviceAccount = 'serviceAccount-1948028253'; - $totalStoredBytes = 1181597162; - $uid = 'uid115792'; - $expectedResponse = new BackupVault(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setDeletable($deletable); - $expectedResponse->setEtag($etag); - $expectedResponse->setBackupCount($backupCount); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setTotalStoredBytes($totalStoredBytes); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateBackupVaultTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $backupVault = new BackupVault(); - $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); - $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); - $request = (new UpdateBackupVaultRequest()) - ->setUpdateMask($updateMask) - ->setBackupVault($backupVault); - $response = $gapicClient->updateBackupVault($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackupVault', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getBackupVault(); - $this->assertProtobufEquals($backupVault, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateBackupVaultExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateBackupVaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $backupVault = new BackupVault(); - $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); - $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); - $request = (new UpdateBackupVaultRequest()) - ->setUpdateMask($updateMask) - ->setBackupVault($backupVault); - $response = $gapicClient->updateBackupVault($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataSourceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $backupCount = 336678994; - $etag = 'etag3123477'; - $totalStoredBytes = 1181597162; - $expectedResponse = new DataSource(); - $expectedResponse->setName($name); - $expectedResponse->setBackupCount($backupCount); - $expectedResponse->setEtag($etag); - $expectedResponse->setTotalStoredBytes($totalStoredBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDataSourceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $dataSource = new DataSource(); - $request = (new UpdateDataSourceRequest()) - ->setUpdateMask($updateMask) - ->setDataSource($dataSource); - $response = $gapicClient->updateDataSource($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateDataSource', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getDataSource(); - $this->assertProtobufEquals($dataSource, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDataSourceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDataSourceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $dataSource = new DataSource(); - $request = (new UpdateDataSourceRequest()) - ->setUpdateMask($updateMask) - ->setDataSource($dataSource); - $response = $gapicClient->updateDataSource($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBackupPlanAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupPlanTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $resourceType = 'resourceType979623115'; - $etag = 'etag3123477'; - $backupVault = 'backupVault353808757'; - $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; - $expectedResponse = new BackupPlan(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setResourceType($resourceType); - $expectedResponse->setEtag($etag); - $expectedResponse->setBackupVault($backupVault); - $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupPlanTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupPlanId = 'backupPlanId-25762700'; - $backupPlan = new BackupPlan(); - $backupPlanBackupRules = []; - $backupPlan->setBackupRules($backupPlanBackupRules); - $backupPlanResourceType = 'backupPlanResourceType1515155475'; - $backupPlan->setResourceType($backupPlanResourceType); - $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); - $backupPlan->setBackupVault($backupPlanBackupVault); - $request = (new CreateBackupPlanRequest()) - ->setParent($formattedParent) - ->setBackupPlanId($backupPlanId) - ->setBackupPlan($backupPlan); - $response = $gapicClient->createBackupPlanAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupPlanId(); - $this->assertProtobufEquals($backupPlanId, $actualValue); - $actualValue = $actualApiRequestObject->getBackupPlan(); - $this->assertProtobufEquals($backupPlan, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -}