From bafe002eb9795d724589bf788e5f92978f9be551 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Nov 2023 21:56:22 +0000 Subject: [PATCH 1/2] feat: Add new field in `GenerateClientCertificate` v1 API to allow AlloyDB connectors request client certs with metadata exchange support docs: Clarify that `readPoolConfig` is required under certain circumstances, and fix doc formatting on `allocatedIpRange`. PiperOrigin-RevId: 578577028 Source-Link: https://github.com/googleapis/googleapis/commit/c0a2b5427f7f5f5f2b4e7ff3e792936a470384a7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4791ced8186e658805f2f75243da29c5dabb1f76 Copy-Tag: eyJwIjoiQWxsb3lEYi8uT3dsQm90LnlhbWwiLCJoIjoiNDc5MWNlZDgxODZlNjU4ODA1ZjJmNzUyNDNkYTI5YzVkYWJiMWY3NiJ9 --- .../Google/Cloud/Alloydb/V1/Resources.php | Bin 0 -> 11817 bytes .../Google/Cloud/Alloydb/V1/Service.php | Bin 0 -> 15637 bytes .../AlloyDb/V1/AutomatedBackupPolicy.php | 392 ++ .../QuantityBasedRetention.php | 71 + .../TimeBasedRetention.php | 81 + .../AutomatedBackupPolicy/WeeklySchedule.php | 129 + .../src/Google/Cloud/AlloyDb/V1/Backup.php | 917 +++++ .../AlloyDb/V1/Backup/QuantityBasedExpiry.php | 125 + .../Google/Cloud/AlloyDb/V1/Backup/State.php | 78 + .../Google/Cloud/AlloyDb/V1/Backup/Type.php | 74 + .../Google/Cloud/AlloyDb/V1/BackupSource.php | 113 + .../AlloyDb/V1/BatchCreateInstanceStatus.php | 221 + .../V1/BatchCreateInstanceStatus/State.php | 97 + .../V1/BatchCreateInstancesMetadata.php | 134 + .../V1/BatchCreateInstancesRequest.php | 185 + .../V1/BatchCreateInstancesResponse.php | 67 + .../src/Google/Cloud/AlloyDb/V1/Cluster.php | 1189 ++++++ .../Cloud/AlloyDb/V1/Cluster/ClusterType.php | 65 + .../AlloyDb/V1/Cluster/NetworkConfig.php | 148 + .../AlloyDb/V1/Cluster/PrimaryConfig.php | 76 + .../AlloyDb/V1/Cluster/SecondaryConfig.php | 75 + .../Google/Cloud/AlloyDb/V1/Cluster/State.php | 125 + .../Google/Cloud/AlloyDb/V1/ClusterView.php | 66 + .../Cloud/AlloyDb/V1/ConnectionInfo.php | 152 + .../AlloyDb/V1/ContinuousBackupConfig.php | 176 + .../Cloud/AlloyDb/V1/ContinuousBackupInfo.php | 216 + .../AlloyDb/V1/ContinuousBackupSource.php | 119 + .../Cloud/AlloyDb/V1/CreateBackupRequest.php | 275 ++ .../Cloud/AlloyDb/V1/CreateClusterRequest.php | 284 ++ .../AlloyDb/V1/CreateInstanceRequest.php | 284 ++ .../AlloyDb/V1/CreateInstanceRequests.php | 71 + .../V1/CreateSecondaryClusterRequest.php | 282 ++ .../V1/CreateSecondaryInstanceRequest.php | 284 ++ .../Cloud/AlloyDb/V1/CreateUserRequest.php | 275 ++ .../Cloud/AlloyDb/V1/DatabaseVersion.php | 61 + .../Cloud/AlloyDb/V1/DeleteBackupRequest.php | 240 ++ .../Cloud/AlloyDb/V1/DeleteClusterRequest.php | 274 ++ .../AlloyDb/V1/DeleteInstanceRequest.php | 240 ++ .../Cloud/AlloyDb/V1/DeleteUserRequest.php | 198 + .../Cloud/AlloyDb/V1/EncryptionConfig.php | 76 + .../Cloud/AlloyDb/V1/EncryptionInfo.php | 105 + .../Cloud/AlloyDb/V1/EncryptionInfo/Type.php | 66 + .../AlloyDb/V1/FailoverInstanceRequest.php | 198 + .../V1/GenerateClientCertificateRequest.php | 297 ++ .../V1/GenerateClientCertificateResponse.php | 105 + .../Cloud/AlloyDb/V1/GetBackupRequest.php | 81 + .../Cloud/AlloyDb/V1/GetClusterRequest.php | 124 + .../AlloyDb/V1/GetConnectionInfoRequest.php | 160 + .../Cloud/AlloyDb/V1/GetInstanceRequest.php | 120 + .../Cloud/AlloyDb/V1/GetUserRequest.php | 86 + .../Cloud/AlloyDb/V1/InjectFaultRequest.php | 239 ++ .../V1/InjectFaultRequest/FaultType.php | 58 + .../src/Google/Cloud/AlloyDb/V1/Instance.php | 1026 +++++ .../AlloyDb/V1/Instance/AvailabilityType.php | 68 + .../V1/Instance/ClientConnectionConfig.php | 118 + .../AlloyDb/V1/Instance/InstanceType.php | 76 + .../AlloyDb/V1/Instance/MachineConfig.php | 70 + .../Google/Cloud/AlloyDb/V1/Instance/Node.php | 186 + .../Instance/QueryInsightsInstanceConfig.php | 222 + .../AlloyDb/V1/Instance/ReadPoolConfig.php | 70 + .../Cloud/AlloyDb/V1/Instance/State.php | 112 + .../Google/Cloud/AlloyDb/V1/InstanceView.php | 65 + .../Cloud/AlloyDb/V1/ListBackupsRequest.php | 221 + .../Cloud/AlloyDb/V1/ListBackupsResponse.php | 135 + .../Cloud/AlloyDb/V1/ListClustersRequest.php | 236 ++ .../Cloud/AlloyDb/V1/ListClustersResponse.php | 135 + .../Cloud/AlloyDb/V1/ListInstancesRequest.php | 246 ++ .../AlloyDb/V1/ListInstancesResponse.php | 135 + .../V1/ListSupportedDatabaseFlagsRequest.php | 179 + .../V1/ListSupportedDatabaseFlagsResponse.php | 101 + .../Cloud/AlloyDb/V1/ListUsersRequest.php | 221 + .../Cloud/AlloyDb/V1/ListUsersResponse.php | 135 + .../Cloud/AlloyDb/V1/MigrationSource.php | 144 + .../MigrationSource/MigrationSourceType.php | 57 + .../Cloud/AlloyDb/V1/OperationMetadata.php | 349 ++ .../AlloyDb/V1/PromoteClusterRequest.php | 240 ++ .../AlloyDb/V1/RestartInstanceRequest.php | 196 + .../AlloyDb/V1/RestoreClusterRequest.php | 344 ++ .../src/Google/Cloud/AlloyDb/V1/SslConfig.php | 105 + .../Cloud/AlloyDb/V1/SslConfig/CaSource.php | 58 + .../Cloud/AlloyDb/V1/SslConfig/SslMode.php | 89 + .../AlloyDb/V1/SupportedDatabaseFlag.php | 337 ++ .../IntegerRestrictions.php | 178 + .../StringRestrictions.php | 74 + .../V1/SupportedDatabaseFlag/ValueType.php | 80 + .../Cloud/AlloyDb/V1/UpdateBackupRequest.php | 306 ++ .../Cloud/AlloyDb/V1/UpdateClusterRequest.php | 310 ++ .../AlloyDb/V1/UpdateInstanceRequest.php | 310 ++ .../Cloud/AlloyDb/V1/UpdateUserRequest.php | 302 ++ .../src/Google/Cloud/AlloyDb/V1/User.php | 177 + .../Google/Cloud/AlloyDb/V1/User/UserType.php | 65 + .../Google/Cloud/AlloyDb/V1/UserPassword.php | 102 + .../batch_create_instances.php | 127 + .../V1/AlloyDBAdminClient/create_backup.php | 100 + .../V1/AlloyDBAdminClient/create_cluster.php | 100 + .../V1/AlloyDBAdminClient/create_instance.php | 96 + .../create_secondary_cluster.php | 101 + .../create_secondary_instance.php | 96 + .../V1/AlloyDBAdminClient/create_user.php | 76 + .../V1/AlloyDBAdminClient/delete_backup.php | 81 + .../V1/AlloyDBAdminClient/delete_cluster.php | 81 + .../V1/AlloyDBAdminClient/delete_instance.php | 86 + .../V1/AlloyDBAdminClient/delete_user.php | 70 + .../AlloyDBAdminClient/failover_instance.php | 91 + .../generate_client_certificate.php | 76 + .../V1/AlloyDBAdminClient/get_backup.php | 71 + .../V1/AlloyDBAdminClient/get_cluster.php | 72 + .../get_connection_info.php | 77 + .../V1/AlloyDBAdminClient/get_instance.php | 77 + .../V1/AlloyDBAdminClient/get_location.php | 57 + .../V1/AlloyDBAdminClient/get_user.php | 72 + .../V1/AlloyDBAdminClient/inject_fault.php | 94 + .../V1/AlloyDBAdminClient/list_backups.php | 76 + .../V1/AlloyDBAdminClient/list_clusters.php | 79 + .../V1/AlloyDBAdminClient/list_instances.php | 81 + .../V1/AlloyDBAdminClient/list_locations.php | 62 + .../list_supported_database_flags.php | 82 + .../V1/AlloyDBAdminClient/list_users.php | 76 + .../V1/AlloyDBAdminClient/promote_cluster.php | 87 + .../AlloyDBAdminClient/restart_instance.php | 90 + .../V1/AlloyDBAdminClient/restore_cluster.php | 102 + .../V1/AlloyDBAdminClient/update_backup.php | 90 + .../V1/AlloyDBAdminClient/update_cluster.php | 89 + .../V1/AlloyDBAdminClient/update_instance.php | 85 + .../V1/AlloyDBAdminClient/update_user.php | 59 + .../AlloyDb/v1/src/V1/AlloyDBAdminClient.php | 34 + .../v1/src/V1/Client/AlloyDBAdminClient.php | 1322 ++++++ .../src/V1/Gapic/AlloyDBAdminGapicClient.php | 3291 +++++++++++++++ .../AlloyDb/v1/src/V1/gapic_metadata.json | 183 + .../alloy_db_admin_client_config.json | 209 + .../alloy_db_admin_descriptor_config.php | 586 +++ .../alloy_db_admin_rest_client_config.php | 454 ++ .../tests/Unit/V1/AlloyDBAdminClientTest.php | 3401 +++++++++++++++ .../Unit/V1/Client/AlloyDBAdminClientTest.php | 3664 +++++++++++++++++ .../Cloud/Alloydb/V1Alpha/Resources.php | Bin 0 -> 12477 bytes .../Google/Cloud/Alloydb/V1Alpha/Service.php | Bin 0 -> 16263 bytes .../AlloyDb/V1alpha/AutomatedBackupPolicy.php | 392 ++ .../QuantityBasedRetention.php | 71 + .../TimeBasedRetention.php | 81 + .../AutomatedBackupPolicy/WeeklySchedule.php | 129 + .../Google/Cloud/AlloyDb/V1alpha/Backup.php | 951 +++++ .../V1alpha/Backup/QuantityBasedExpiry.php | 125 + .../Cloud/AlloyDb/V1alpha/Backup/State.php | 78 + .../Cloud/AlloyDb/V1alpha/Backup/Type.php | 74 + .../Cloud/AlloyDb/V1alpha/BackupSource.php | 113 + .../V1alpha/BatchCreateInstanceStatus.php | 221 + .../BatchCreateInstanceStatus/State.php | 97 + .../V1alpha/BatchCreateInstancesMetadata.php | 134 + .../V1alpha/BatchCreateInstancesRequest.php | 185 + .../V1alpha/BatchCreateInstancesResponse.php | 67 + .../Google/Cloud/AlloyDb/V1alpha/Cluster.php | 1223 ++++++ .../AlloyDb/V1alpha/Cluster/ClusterType.php | 65 + .../AlloyDb/V1alpha/Cluster/NetworkConfig.php | 148 + .../AlloyDb/V1alpha/Cluster/PrimaryConfig.php | 76 + .../V1alpha/Cluster/SecondaryConfig.php | 75 + .../Cloud/AlloyDb/V1alpha/Cluster/State.php | 125 + .../Cloud/AlloyDb/V1alpha/ClusterView.php | 66 + .../Cloud/AlloyDb/V1alpha/ConnectionInfo.php | 195 + .../V1alpha/ContinuousBackupConfig.php | 176 + .../AlloyDb/V1alpha/ContinuousBackupInfo.php | 216 + .../V1alpha/ContinuousBackupSource.php | 119 + .../AlloyDb/V1alpha/CreateBackupRequest.php | 257 ++ .../AlloyDb/V1alpha/CreateClusterRequest.php | 265 ++ .../AlloyDb/V1alpha/CreateInstanceRequest.php | 265 ++ .../V1alpha/CreateInstanceRequests.php | 71 + .../V1alpha/CreateSecondaryClusterRequest.php | 263 ++ .../CreateSecondaryInstanceRequest.php | 265 ++ .../AlloyDb/V1alpha/CreateUserRequest.php | 257 ++ .../Cloud/AlloyDb/V1alpha/DatabaseVersion.php | 68 + .../AlloyDb/V1alpha/DeleteBackupRequest.php | 225 + .../AlloyDb/V1alpha/DeleteClusterRequest.php | 259 ++ .../AlloyDb/V1alpha/DeleteInstanceRequest.php | 225 + .../AlloyDb/V1alpha/DeleteUserRequest.php | 183 + .../AlloyDb/V1alpha/EncryptionConfig.php | 76 + .../Cloud/AlloyDb/V1alpha/EncryptionInfo.php | 105 + .../AlloyDb/V1alpha/EncryptionInfo/Type.php | 66 + .../V1alpha/FailoverInstanceRequest.php | 183 + .../GenerateClientCertificateRequest.php | 321 ++ .../GenerateClientCertificateResponse.php | 139 + .../AlloyDb/V1alpha/GetBackupRequest.php | 67 + .../AlloyDb/V1alpha/GetClusterRequest.php | 109 + .../V1alpha/GetConnectionInfoRequest.php | 145 + .../AlloyDb/V1alpha/GetInstanceRequest.php | 105 + .../Cloud/AlloyDb/V1alpha/GetUserRequest.php | 71 + .../AlloyDb/V1alpha/InjectFaultRequest.php | 221 + .../V1alpha/InjectFaultRequest/FaultType.php | 58 + .../Google/Cloud/AlloyDb/V1alpha/Instance.php | 1112 +++++ .../V1alpha/Instance/AvailabilityType.php | 68 + .../Instance/ClientConnectionConfig.php | 118 + .../AlloyDb/V1alpha/Instance/InstanceType.php | 76 + .../V1alpha/Instance/MachineConfig.php | 70 + .../Cloud/AlloyDb/V1alpha/Instance/Node.php | 186 + .../Instance/QueryInsightsInstanceConfig.php | 222 + .../V1alpha/Instance/ReadPoolConfig.php | 70 + .../Cloud/AlloyDb/V1alpha/Instance/State.php | 112 + .../AlloyDb/V1alpha/Instance/UpdatePolicy.php | 70 + .../V1alpha/Instance/UpdatePolicy/Mode.php | 69 + .../Cloud/AlloyDb/V1alpha/InstanceView.php | 65 + .../AlloyDb/V1alpha/ListBackupsRequest.php | 207 + .../AlloyDb/V1alpha/ListBackupsResponse.php | 135 + .../AlloyDb/V1alpha/ListClustersRequest.php | 219 + .../AlloyDb/V1alpha/ListClustersResponse.php | 135 + .../AlloyDb/V1alpha/ListInstancesRequest.php | 227 + .../AlloyDb/V1alpha/ListInstancesResponse.php | 135 + .../ListSupportedDatabaseFlagsRequest.php | 159 + .../ListSupportedDatabaseFlagsResponse.php | 101 + .../AlloyDb/V1alpha/ListUsersRequest.php | 207 + .../AlloyDb/V1alpha/ListUsersResponse.php | 135 + .../Cloud/AlloyDb/V1alpha/MigrationSource.php | 144 + .../MigrationSource/MigrationSourceType.php | 57 + .../AlloyDb/V1alpha/OperationMetadata.php | 349 ++ .../AlloyDb/V1alpha/PromoteClusterRequest.php | 225 + .../V1alpha/RestartInstanceRequest.php | 181 + .../AlloyDb/V1alpha/RestoreClusterRequest.php | 344 ++ .../Cloud/AlloyDb/V1alpha/SslConfig.php | 105 + .../AlloyDb/V1alpha/SslConfig/CaSource.php | 58 + .../AlloyDb/V1alpha/SslConfig/SslMode.php | 89 + .../AlloyDb/V1alpha/SupportedDatabaseFlag.php | 337 ++ .../IntegerRestrictions.php | 178 + .../StringRestrictions.php | 74 + .../SupportedDatabaseFlag/ValueType.php | 80 + .../AlloyDb/V1alpha/UpdateBackupRequest.php | 287 ++ .../AlloyDb/V1alpha/UpdateClusterRequest.php | 291 ++ .../AlloyDb/V1alpha/UpdateInstanceRequest.php | 291 ++ .../AlloyDb/V1alpha/UpdateUserRequest.php | 283 ++ .../src/Google/Cloud/AlloyDb/V1alpha/User.php | 177 + .../Cloud/AlloyDb/V1alpha/User/UserType.php | 65 + .../Cloud/AlloyDb/V1alpha/UserPassword.php | 102 + .../batch_create_instances.php | 123 + .../AlloyDBAdminClient/create_backup.php | 95 + .../AlloyDBAdminClient/create_cluster.php | 95 + .../AlloyDBAdminClient/create_instance.php | 91 + .../create_secondary_cluster.php | 96 + .../create_secondary_instance.php | 91 + .../AlloyDBAdminClient/create_user.php | 71 + .../AlloyDBAdminClient/delete_backup.php | 76 + .../AlloyDBAdminClient/delete_cluster.php | 76 + .../AlloyDBAdminClient/delete_instance.php | 81 + .../AlloyDBAdminClient/delete_user.php | 65 + .../AlloyDBAdminClient/failover_instance.php | 86 + .../generate_client_certificate.php | 71 + .../V1alpha/AlloyDBAdminClient/get_backup.php | 66 + .../AlloyDBAdminClient/get_cluster.php | 67 + .../get_connection_info.php | 72 + .../AlloyDBAdminClient/get_instance.php | 72 + .../AlloyDBAdminClient/get_location.php | 53 + .../V1alpha/AlloyDBAdminClient/get_user.php | 67 + .../AlloyDBAdminClient/inject_fault.php | 88 + .../AlloyDBAdminClient/list_backups.php | 71 + .../AlloyDBAdminClient/list_clusters.php | 74 + .../AlloyDBAdminClient/list_instances.php | 76 + .../AlloyDBAdminClient/list_locations.php | 58 + .../list_supported_database_flags.php | 77 + .../V1alpha/AlloyDBAdminClient/list_users.php | 71 + .../AlloyDBAdminClient/promote_cluster.php | 82 + .../AlloyDBAdminClient/restart_instance.php | 85 + .../AlloyDBAdminClient/restore_cluster.php | 97 + .../AlloyDBAdminClient/update_backup.php | 87 + .../AlloyDBAdminClient/update_cluster.php | 86 + .../AlloyDBAdminClient/update_instance.php | 82 + .../AlloyDBAdminClient/update_user.php | 56 + .../src/V1alpha/AlloyDBAdminClient.php | 36 + .../V1alpha/Gapic/AlloyDBAdminGapicClient.php | 3386 +++++++++++++++ .../v1alpha/src/V1alpha/gapic_metadata.json | 183 + .../alloy_db_admin_client_config.json | 209 + .../alloy_db_admin_descriptor_config.php | 242 ++ .../alloy_db_admin_rest_client_config.php | 454 ++ .../Unit/V1alpha/AlloyDBAdminClientTest.php | 3435 ++++++++++++++++ .../Google/Cloud/Alloydb/V1Beta/Resources.php | Bin 0 -> 12342 bytes .../Google/Cloud/Alloydb/V1Beta/Service.php | Bin 0 -> 16148 bytes .../AlloyDb/V1beta/AutomatedBackupPolicy.php | 392 ++ .../QuantityBasedRetention.php | 71 + .../TimeBasedRetention.php | 81 + .../AutomatedBackupPolicy/WeeklySchedule.php | 129 + .../Google/Cloud/AlloyDb/V1beta/Backup.php | 917 +++++ .../V1beta/Backup/QuantityBasedExpiry.php | 125 + .../Cloud/AlloyDb/V1beta/Backup/State.php | 78 + .../Cloud/AlloyDb/V1beta/Backup/Type.php | 74 + .../Cloud/AlloyDb/V1beta/BackupSource.php | 113 + .../V1beta/BatchCreateInstanceStatus.php | 221 + .../BatchCreateInstanceStatus/State.php | 97 + .../V1beta/BatchCreateInstancesMetadata.php | 134 + .../V1beta/BatchCreateInstancesRequest.php | 185 + .../V1beta/BatchCreateInstancesResponse.php | 67 + .../Google/Cloud/AlloyDb/V1beta/Cluster.php | 1189 ++++++ .../AlloyDb/V1beta/Cluster/ClusterType.php | 65 + .../AlloyDb/V1beta/Cluster/NetworkConfig.php | 148 + .../AlloyDb/V1beta/Cluster/PrimaryConfig.php | 76 + .../V1beta/Cluster/SecondaryConfig.php | 75 + .../Cloud/AlloyDb/V1beta/Cluster/State.php | 125 + .../Cloud/AlloyDb/V1beta/ClusterView.php | 66 + .../Cloud/AlloyDb/V1beta/ConnectionInfo.php | 195 + .../AlloyDb/V1beta/ContinuousBackupConfig.php | 176 + .../AlloyDb/V1beta/ContinuousBackupInfo.php | 216 + .../AlloyDb/V1beta/ContinuousBackupSource.php | 119 + .../AlloyDb/V1beta/CreateBackupRequest.php | 257 ++ .../AlloyDb/V1beta/CreateClusterRequest.php | 265 ++ .../AlloyDb/V1beta/CreateInstanceRequest.php | 265 ++ .../AlloyDb/V1beta/CreateInstanceRequests.php | 71 + .../V1beta/CreateSecondaryClusterRequest.php | 263 ++ .../V1beta/CreateSecondaryInstanceRequest.php | 265 ++ .../AlloyDb/V1beta/CreateUserRequest.php | 257 ++ .../Cloud/AlloyDb/V1beta/DatabaseVersion.php | 68 + .../AlloyDb/V1beta/DeleteBackupRequest.php | 225 + .../AlloyDb/V1beta/DeleteClusterRequest.php | 259 ++ .../AlloyDb/V1beta/DeleteInstanceRequest.php | 225 + .../AlloyDb/V1beta/DeleteUserRequest.php | 183 + .../Cloud/AlloyDb/V1beta/EncryptionConfig.php | 76 + .../Cloud/AlloyDb/V1beta/EncryptionInfo.php | 105 + .../AlloyDb/V1beta/EncryptionInfo/Type.php | 66 + .../V1beta/FailoverInstanceRequest.php | 183 + .../GenerateClientCertificateRequest.php | 321 ++ .../GenerateClientCertificateResponse.php | 139 + .../Cloud/AlloyDb/V1beta/GetBackupRequest.php | 67 + .../AlloyDb/V1beta/GetClusterRequest.php | 109 + .../V1beta/GetConnectionInfoRequest.php | 145 + .../AlloyDb/V1beta/GetInstanceRequest.php | 105 + .../Cloud/AlloyDb/V1beta/GetUserRequest.php | 71 + .../AlloyDb/V1beta/InjectFaultRequest.php | 221 + .../V1beta/InjectFaultRequest/FaultType.php | 58 + .../Google/Cloud/AlloyDb/V1beta/Instance.php | 1078 +++++ .../V1beta/Instance/AvailabilityType.php | 68 + .../Instance/ClientConnectionConfig.php | 118 + .../AlloyDb/V1beta/Instance/InstanceType.php | 76 + .../AlloyDb/V1beta/Instance/MachineConfig.php | 70 + .../Cloud/AlloyDb/V1beta/Instance/Node.php | 186 + .../Instance/QueryInsightsInstanceConfig.php | 222 + .../V1beta/Instance/ReadPoolConfig.php | 70 + .../Cloud/AlloyDb/V1beta/Instance/State.php | 112 + .../AlloyDb/V1beta/Instance/UpdatePolicy.php | 70 + .../V1beta/Instance/UpdatePolicy/Mode.php | 69 + .../Cloud/AlloyDb/V1beta/InstanceView.php | 65 + .../AlloyDb/V1beta/ListBackupsRequest.php | 207 + .../AlloyDb/V1beta/ListBackupsResponse.php | 135 + .../AlloyDb/V1beta/ListClustersRequest.php | 219 + .../AlloyDb/V1beta/ListClustersResponse.php | 135 + .../AlloyDb/V1beta/ListInstancesRequest.php | 227 + .../AlloyDb/V1beta/ListInstancesResponse.php | 135 + .../ListSupportedDatabaseFlagsRequest.php | 159 + .../ListSupportedDatabaseFlagsResponse.php | 101 + .../Cloud/AlloyDb/V1beta/ListUsersRequest.php | 207 + .../AlloyDb/V1beta/ListUsersResponse.php | 135 + .../Cloud/AlloyDb/V1beta/MigrationSource.php | 144 + .../MigrationSource/MigrationSourceType.php | 57 + .../AlloyDb/V1beta/OperationMetadata.php | 349 ++ .../AlloyDb/V1beta/PromoteClusterRequest.php | 225 + .../AlloyDb/V1beta/RestartInstanceRequest.php | 181 + .../AlloyDb/V1beta/RestoreClusterRequest.php | 344 ++ .../Google/Cloud/AlloyDb/V1beta/SslConfig.php | 105 + .../AlloyDb/V1beta/SslConfig/CaSource.php | 58 + .../AlloyDb/V1beta/SslConfig/SslMode.php | 89 + .../AlloyDb/V1beta/SupportedDatabaseFlag.php | 337 ++ .../IntegerRestrictions.php | 178 + .../StringRestrictions.php | 74 + .../SupportedDatabaseFlag/ValueType.php | 80 + .../AlloyDb/V1beta/UpdateBackupRequest.php | 287 ++ .../AlloyDb/V1beta/UpdateClusterRequest.php | 291 ++ .../AlloyDb/V1beta/UpdateInstanceRequest.php | 291 ++ .../AlloyDb/V1beta/UpdateUserRequest.php | 283 ++ .../src/Google/Cloud/AlloyDb/V1beta/User.php | 177 + .../Cloud/AlloyDb/V1beta/User/UserType.php | 65 + .../Cloud/AlloyDb/V1beta/UserPassword.php | 102 + .../batch_create_instances.php | 123 + .../AlloyDBAdminClient/create_backup.php | 95 + .../AlloyDBAdminClient/create_cluster.php | 95 + .../AlloyDBAdminClient/create_instance.php | 91 + .../create_secondary_cluster.php | 96 + .../create_secondary_instance.php | 91 + .../V1beta/AlloyDBAdminClient/create_user.php | 71 + .../AlloyDBAdminClient/delete_backup.php | 76 + .../AlloyDBAdminClient/delete_cluster.php | 76 + .../AlloyDBAdminClient/delete_instance.php | 81 + .../V1beta/AlloyDBAdminClient/delete_user.php | 65 + .../AlloyDBAdminClient/failover_instance.php | 86 + .../generate_client_certificate.php | 71 + .../V1beta/AlloyDBAdminClient/get_backup.php | 66 + .../V1beta/AlloyDBAdminClient/get_cluster.php | 67 + .../get_connection_info.php | 72 + .../AlloyDBAdminClient/get_instance.php | 72 + .../AlloyDBAdminClient/get_location.php | 53 + .../V1beta/AlloyDBAdminClient/get_user.php | 67 + .../AlloyDBAdminClient/inject_fault.php | 88 + .../AlloyDBAdminClient/list_backups.php | 71 + .../AlloyDBAdminClient/list_clusters.php | 74 + .../AlloyDBAdminClient/list_instances.php | 76 + .../AlloyDBAdminClient/list_locations.php | 58 + .../list_supported_database_flags.php | 77 + .../V1beta/AlloyDBAdminClient/list_users.php | 71 + .../AlloyDBAdminClient/promote_cluster.php | 82 + .../AlloyDBAdminClient/restart_instance.php | 85 + .../AlloyDBAdminClient/restore_cluster.php | 97 + .../AlloyDBAdminClient/update_backup.php | 87 + .../AlloyDBAdminClient/update_cluster.php | 86 + .../AlloyDBAdminClient/update_instance.php | 82 + .../V1beta/AlloyDBAdminClient/update_user.php | 56 + .../v1beta/src/V1beta/AlloyDBAdminClient.php | 36 + .../V1beta/Gapic/AlloyDBAdminGapicClient.php | 3386 +++++++++++++++ .../v1beta/src/V1beta/gapic_metadata.json | 183 + .../alloy_db_admin_client_config.json | 209 + .../alloy_db_admin_descriptor_config.php | 242 ++ .../alloy_db_admin_rest_client_config.php | 453 ++ .../Unit/V1beta/AlloyDBAdminClientTest.php | 3403 +++++++++++++++ 402 files changed, 88192 insertions(+) create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Resources.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Service.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php create mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_location.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_locations.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php create mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php create mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/Client/AlloyDBAdminClient.php create mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php create mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json create mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php create mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php create mode 100644 owl-bot-staging/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php create mode 100644 owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Resources.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Service.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/Gapic/AlloyDBAdminGapicClient.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json create mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json create mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php create mode 100644 owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Resources.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Service.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/Gapic/AlloyDBAdminGapicClient.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json create mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json create mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php create mode 100644 owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Resources.php b/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Resources.php new file mode 100644 index 0000000000000000000000000000000000000000..1ab8a44321b87ccb5ca10a506988fe5fef98191c GIT binary patch literal 11817 zcmds7&2t;aayP(FG)M?qQ4|E(77WWzw4V%Gu>9f&Nlq5P5`ql^5CBq-uUK!h0G7~3 z%UyVPA(?jZnxrbZzao`G{svd2QkBx5;6p0iGqZ~iV)>!UCDB0yFw;FV zJ^k_Po__M@!roP=X?NNVQGfn%X-`#%waNE)O3^&Jk0$AFy?hdt{ zo~bm8ySk_KHBURNF!I9^ksr#O{BZx_V}PEixo)QAvw@!=ga3x3u4(i#uBUnU=bquJ zhGlq$W*R@@DV}DIG}G0Q`t01Jk=64I+sY6@!|Lf0jhTdz`a-=tRUnS?2=xV}_zt8U z0~Ns2j)(6+`@+$NL)~#NPue*d>W5|R#6EhX>#wdzM_aXz`r65SI;Je2e`5&Mko)~W z6L!#Awt~B(o4gPI)q%tNm$Vb<7N3}729*;Am3#d#eOqwQhDKmq+_usmiXmocsI=RC zaZ6(S?(DedUqu*$H$vWG{ElGYp-{I`EL^Db28lD193RZ)U~SLUohI7y8{6qiYp^)N z@2N;8vK5n(usReYsVM!D{f`J-+cgGU$=b}vNShFQX}g{}v>lHV78ib&7o^*;=IH39 zbTnqw=yMKyXdmL-{iw9%)B^HO<#nnYlD3eF7itRx2&J zQ*G4Mc4MzqQq;~tQ&IQo?WR(y?o^d>@;zw<7RtNrWF)%N8kTyP%bmGl>Vjpl{B zaZ!v5Te0F7DB)k^&tQuwB2E&_QT^N;hK21C?ZEy{KiTJm*~3FvWYXAx<+@x^%99hK+5e70tnHdYS~9G< zuBjf|eJ-g){|+89MXmR0G;G=!j8CNB!8LNS=85X|Uh4gksWW-T^G`$NIhRrH1>@2d zOrE_bX|O>aMeS;?-d8b5>K2(yY7rGao|mu4p4@toIJJC6&mximsqaS`vh_~REVIOx zQLebmbHVP+QX8smpGE&R5|O@u^)8d9`o^&O_8aD{;`!VDs=imx`LS23 z!u1Ic&}051waWJTsZTW6X-m}qzp9mdNNp8$amZb7LZJ~%5&tE}XCO3#dX=8SSEHo)op~=8# z#Y7R$AKv$`_#C|?7A(w4U%{FX2GbMaP0~J(z#{0r8KmT7pO2-BMznw-aaywiUE$MZ zNa>nm8pr}&i;KvfY?H6Z9n3{5W_z&4??*tDTL8kAN7I0$0C6!e4(`QIewL%Z$amob zALem<5`5SFM97PB#(V8=Lgy(Up+LaNaaQ&d64Bf&-bKvaF*#OT7;B99u+Ur6<2 z#^r_sIdMI?NuN`IB}z4Q76B6ZUxkX+CvMYhE}IIh2?gRnGKCvH4@mkf#NRQHtU!|T zd5Y7jK$58#V-|kZWkDbSB<(07eFq6k_b^v@rS^DW`+x~Ccj2+>oQ!))&g{3aBABHB zxx|WFsR*;V417qXjghAdwt>wFE|jQXjbf0B6P>gJam})9syYxvUSnbF;e}h0$22S; zBH)XYr?z^AX;_2QIx=77H}My+CMp>!OOO)m)Zz9vnN<;oMX3R|G#{QJk|BJCDH8#- z)OE%zT!eEYxl{lkj4iG~Vmz{;XAV$yF`A0ZhbT7~iz@^jrV(?3$_8U}#h|heDLjgZ zs=k24;qEYo+o6Xm1%%ws;djj0xRSMC^DJK$``%|__us*e8=^osgkm3Y^%YY}3 z4_Ab6={zLQnDqs)FZ+)XSYlpR!rZFekvp>qVhomAid;UxL^zHKWv9_>Vip&b@ONdm z**QoqphH?M;havjUcvMZzm=7m!oDp@0LwdawT2|i(sfubHX5CFrzJO=GO0RsfM{YX5w@5c-&vJRo#_av{_`-R!WU} znZ8B~-M6v|ABLbAv4m7W`1V(N&vUnb5}!`D{Tu{;^FN+qO_@O({7rm1ZABu*RaoYb zB>VRgtX3_IeOUj&WB)$}2v27KLbyxu^$nnS%r#*TdaM zz{LOH!-S|*fyA-adudp@@6{+S$MfNy*XNPj<#fWS?ZS2KwPs+ZijfpEcgh@DtWMG5-rx|Zhk+a{LrvmWAM^*efi&H@((Z6 z1RHry8eOv&67r5yst z&tNA?Bm{Qyu^Pdg80y#*R+E^tE~6B)U`<89fY~7?Qa#(U&|@L?^TozP=+_r3Ly2*~ zvk3N4uV_N)UAQ{l5JyM`WQC(Am(e9ONAKq80#CjP0Fm+StYEPh7=~^b2n2= z!KObpy@ld!xTVhLoxTT&8SO$*kr7Ra_%-I&b8iWY(vqWpKQbKVuIL7Bhp>atyoiKP zeiIOx1QyR<1|k!%y(;i{1kxPOasl*sC%Ezt?+RBYF$zO00Y+Jz1tAxJmNOXTcd+Jr z4Cb-%IiXrdD20ILGAM=6mD+4HY6z;PK+8h5j(~199()8J$oq(>yIzlp#nAqSdS?+^dW$J*`%o|Dd#{bL-K zc?$M_6!Gyo+Jz;d#{uG7X7MZhWr|B<3h({a4*@IakP`XuB7&fu0DE~@WKfD;6B7A* zq47;nGE=-kMK9hQL2okz4`Wp65U8Cg6jcvI9Dg#dIWg7bm6;%I4AV2749r$gs5~Q3 zz}#060&`cYbBC22s8n<1I<^l?2n)p|Wg3_y*~NwfBq8E6$tD`Hi`_12_ryamNSJ4V z8!;9i^&f@?f;@U$5fJl2O?!?tdrsv)gCW4AvwnHe=@Rt`=G4gi*1>w=JFoCr(>~!DhUYy%+oR9-)ro(lM4m)t&B;*`7aOB*O&F? zT~=;Pa+rTFX4v3i1h5@7z|m{dn2h`_@nMzX1O*)o7mD6 zFv6FIE^JVD&H!QN)DrxWv>2+{^Ov9=Fl05e#&l>!=uT-OuSc=SiYX+p_dlMT@*b4% zjA8!L`}BawyzE^p@Ai875L36~k?9#jOeGn6{?50GdCyJP7q{B)`ek?*5jH)AUE1^r z$P3i#5+4#EzSy$o;nnm5Y)m*Kact2^kl%iTr981GdfAPoM{r|~@T45X5dHJ13{J=M zcl#0U zlol_%?bI4_2Mcejn1MCwN^-FL=te@=@D>TDV-boSq) zut){}d6?(sY!4NAxJA6gas9%vO^g(abR#qvk-mW#Ju+~`qy+4|XCqoTNB@x;GWzUu zSoMFPMv}eu{8Aw{0#T#NLAj_F_o~?OQ>9LyiC?Sou1ds+n$5Se0e3=VON&XB%Zl=B z-Eez^4A48#AM#C~{b8I<>>K(UX)>GGuPQHQ8n3DWey&Rz|3 zfX@a&MU}CisHo22j!gV|>lE`Wd^q*{*ng`nd76W_$|;$o(TeeZnwR<2+87WrV#_6DZi)y!@2yotQUr_=5-&i3pt?+0C| b4|u=vM0+w7h>YHx)?_x5HxQq~DZu{#6_IIS literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Service.php b/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Service.php new file mode 100644 index 0000000000000000000000000000000000000000..238c970fac6287546279ac5709830e3c5cbf2bce GIT binary patch literal 15637 zcmds8+ix6K8Sktwv5ynSK8Y`Jnr1UeiR(JM_10<9Nz$_R+OEmXik*m73!~Zf*dDT; z8D?gkxKSji03iedQEq<#*S;Zy5Kp{tkpdD`0RfSastO6I;(-SqP$5@;ftmS9f-d zs-B}eB4ldYx@&7yJ-f6rcUAYabacb%?MB_KdWL0Y$%5-;ZWx>p68j`1EYn(Y?B3UZA+i2KW8n$}z$!+D5r(nii3QWx9&e;Hj}i(!%+gp_^WN zYZeW?wmzqCX*-7Hw72wz&dnq>$fzll#TIQadc`s~ow{in=4Sc2O$@v}LHYVG)!Ewg zO#4egaSPkFx7)!|D(|bBd%J_RYX-QPr)}Hm*WR$J+?0PosBi^kk}-fX5hFj)smL4;{IknF)R)uh|B~6=JX~icB2m8gV}-Jc{~lZBtiW2(sfDSlTn!^>$Ih z7$JJyvu^9=co*3dA40twMh%`i-c6rD2}e+$<*e(DTG<`%@h{7F(cv&m*M?}O;{xid za_E4xYjU8F%`s?u3?(Npj-i95e%Dh2fCy3oXrOL7x>nuNDm5KYc1`xnuSsZlNf!bV z@|i{5Bu9m%gIY=F9O~XN^gC2AgN0MAklq4XDn9uy5;`^y$UJ>juUh81=InBA1fWh8 zHb#;s)xB!0Q(*n%kr}Xnef$PhR|>(hb+DnsjEHR5P$8Z`2X-L&LMGQ$%dG8=_kz&- z7=OQ)&|${k2ZODE!R}#;u*})|1F&_|CLBlDngvUv*Hz-h)QScQ6T%*Z8|VDkPNfu7 z2{G6XRYIMQZMX+J;frA>>LR{=N8L7D7jh$2CFkq=z*kAH=`nnD;uc|(p}xrQ4Wn+T z{We*=Xbl;oo(&7i%plaSOK4=pv9_)MEv)iCGiU^g6{r!Tw($ZwP|>Ql>$b|OAsQVA z3Qr2_h$g_?9Hm~R74}Py;Z-yaA;L4vx>a}8@K$})Z1Ra)&HD=@n|`3f%UmDoWwMmN z2bN0`$+8J)5Gs2=;hl>lyz*(9@lN352^ml9@V=$IduSwrl;^xz)Ncs*Jn5ZC)Tj@$ zy{z{s31P^3VztOJXG3XE$OyHR(X*k%mu$-7c_j16e+JiONkLo|FgjP(I2tgx>>~N@ zJn9p7c*1KfR1%UhI2^uGriOPU^h6}1{~vN`q0v|ky7(qUDO%9Lshqi@%F70q+jK6` zren9Hx{!Y&p`&w}SKSKJJOVdgM14L$mVKLqQOa3FpKhGBG?KBrh8~Yc{@=L0{H09% zwxX$m$I+0l0Z((FSHTp}k2lb;e}^3!bQdZ_QeUIAwMHVBviG z56O|8bUcjub;q$Bb=%!!RW&|=dgvvd&#~AW&SZ2^-NhGCx3_DPlZP}pSV(pNAueB_ zYp_b*K|So@BWQSat+=+J-n_QDvM|5AxV%srdJN8BgDVTyO3T-l)cG3=aDPa`{ip|i zExkOH!TV7ky$tth{DfZh7PWfK6RN+4&<6Qir3Ou!2!n;Q!sPdquzNSi(cOq$ zv#=@T%_Nq-@(9a2ok_@0Vfl{-+ZkOf-n_D=uD!exb*TZgZ*}eZihAqnkR*RbLZhUl z*PKUIH-*s$tfiSoz6P}$sT^4e@29@AkqY-oTHqeX#}W!$wwy$=NJl5OnKKw}=HQ`d zA4jgUPLq#{r?qF$z6w3Sh`fJ1(MmX?_A1#WGz5h#TPlnb%F#ggh6@5U7liyT0*+YV4s+C5*lqx4LAw*+>HM>4Z{n-K z6bsp5raIAiq_j`xf8a5!Ythhx{1pkEATGIDw{6RT30eu}SryII7i-$4@1doLht5(D z&Ee?;4~^X|rNhc!mXO>G5_iuPH0}z}Dw)C&)anL--Lg)P$Cu>3^4}!nj~LnHX;&2kN3^rg?Nr@V0bINF> z4iehtLrYb^3+-fcQxCQ~KZZ_-sYnc?T=KAyt#7LY9G8I#I~gV|!D*AW3m=9itwu=# zJux*Wb zb)%B2f|xqp75ft{bV0WZVikV?nR(E&LR=@+pLEf6cn0<9=DJFkuxPcn`5IXQ(+YMx zYDl_^xH{BdmBs+03m-*;dYgJt?4AD!iS z0h#$t`;Z?&j=zV7S&9#G)4qB;O7DgDX3+j3dHJL?S6tsVO#Fs~_7mIYGaeUDC)#n4 zjGN`enUvJbXXHz-{qC=?XP_t`ug%z60%*(0s(c}Yjg;64$b4V`@?nt{3BQfJ>H4h)&@1 zO))Tv&-sZ-zDvQKliL!UB8H$3i$|EOr@2hUPjKi5#mCV;0XilXLL>VC^FBe8%vp#o zC1(WT^Vi<#6E(^^WNxJf-I zPN5P0Hh^Eo(f4d{jFx^WL4PbXDa6SgxG-T#UUbUK^D@&@N?sH|PNtWNH086^+}wT! zjD$yvO&AFirex&fAx2WhAjM(hPGF>!QN0J96z1a5*B$V4i2*BqK}wE3FHx43@DD9See+67toc{T~(^O^0fe7KRV+Uk$RNBL%x*!j$ZKEFeuW zC+|EUwO6XZ#BC@#{K3y8T5pszC2ua}ZBb^L?0`3AgAb^JwMz??!JCc)foV{a3=*J9 z$DB@De!jwHON|ocbqV!D z@xeC5PbE5yPa{CKnrFyL2v;+)b5MbL zIHxpa>gT`|OB5}c3X-K{YLi*e6w^~%7Svt>fw#{lh#$sIXk4r$dPVXg!QzFE*7Bps zWu{fEq;YM3E)^Q4H9Y+v5;~GNX2H)V;!Ip4SWFgAlck))a+$JtwcWZHJ|bfu-|ZO~ z(I73_d%xyiD}-i0c%})j@pGby^6A7i;lYyp3T5arUT&?k!0|Cu>E+>t<-n|}p~4?P zuqGx)`n+zFVC~Zg6(#pI1EgFf3zUK9Fl);+?PdfRxSuDDd$)lV-WA#hNrOPeO{B+3 z1W-S6$Id+D`4F~d5rOyaNDG((3nZ5xLeH0F4GJz}m2Jl77Nc)dnM0nnm1zPDu53$#EoVthOZ3}i~B85 zH;4r4QQ>dlPNlGbsdk!%Q45&($b;f&{OIqkVs6XxY*)$W@7%e=G5DW#X?1T4Y#zS1 zJ!8Y5627k3p8GMpVhf*q3Aj zvnv<;-`>cKEz!??bMxf!IW}>rP_OJMdXaH&#;Z-L*google.cloud.alloydb.v1.AutomatedBackupPolicy + */ +class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + */ + protected $backup_window = null; + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + */ + protected $location = ''; + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + protected $schedule; + protected $retention; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule $weekly_schedule + * Weekly schedule for the Backup. + * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention $time_based_retention + * Time-based Backup retention policy. + * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention $quantity_based_retention + * Quantity-based Backup retention policy to retain recent backups. + * @type bool $enabled + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * @type \Google\Protobuf\Duration $backup_window + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * @type string $location + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to backups created using this configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Weekly schedule for the Backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule|null + */ + public function getWeeklySchedule() + { + return $this->readOneof(2); + } + + public function hasWeeklySchedule() + { + return $this->hasOneof(2); + } + + /** + * Weekly schedule for the Backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule $var + * @return $this + */ + public function setWeeklySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Time-based Backup retention policy. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention|null + */ + public function getTimeBasedRetention() + { + return $this->readOneof(4); + } + + public function hasTimeBasedRetention() + { + return $this->hasOneof(4); + } + + /** + * Time-based Backup retention policy. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention $var + * @return $this + */ + public function setTimeBasedRetention($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Quantity-based Backup retention policy to retain recent backups. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention|null + */ + public function getQuantityBasedRetention() + { + return $this->readOneof(5); + } + + public function hasQuantityBasedRetention() + { + return $this->hasOneof(5); + } + + /** + * Quantity-based Backup retention policy to retain recent backups. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention $var + * @return $this + */ + public function setQuantityBasedRetention($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getBackupWindow() + { + return $this->backup_window; + } + + public function hasBackupWindow() + { + return isset($this->backup_window); + } + + public function clearBackupWindow() + { + unset($this->backup_window); + } + + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBackupWindow($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->backup_window = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + * @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; + } + + /** + * @return string + */ + public function getSchedule() + { + return $this->whichOneof("schedule"); + } + + /** + * @return string + */ + public function getRetention() + { + return $this->whichOneof("retention"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php new file mode 100644 index 000000000000..5feb7913bbd5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + */ +class QuantityBasedRetention extends \Google\Protobuf\Internal\Message +{ + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + */ + protected $count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $count + * The number of backups to retain. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + * @return int + */ + public function getCount() + { + return $this->count; + } + + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt32($var); + $this->count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuantityBasedRetention::class, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy_QuantityBasedRetention::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php new file mode 100644 index 000000000000..efb83eac7a9c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php @@ -0,0 +1,81 @@ +google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + */ +class TimeBasedRetention extends \Google\Protobuf\Internal\Message +{ + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + */ + protected $retention_period = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $retention_period + * The retention period. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getRetentionPeriod() + { + return $this->retention_period; + } + + public function hasRetentionPeriod() + { + return isset($this->retention_period); + } + + public function clearRetentionPeriod() + { + unset($this->retention_period); + } + + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRetentionPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->retention_period = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimeBasedRetention::class, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy_TimeBasedRetention::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php new file mode 100644 index 000000000000..3b42ae953258 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php @@ -0,0 +1,129 @@ +google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + */ +class WeeklySchedule extends \Google\Protobuf\Internal\Message +{ + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + */ + private $start_times; + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + */ + private $days_of_week; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $start_times + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStartTimes() + { + return $this->start_times; + } + + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + * @param array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStartTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\TimeOfDay::class); + $this->start_times = $arr; + + return $this; + } + + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDaysOfWeek() + { + return $this->days_of_week; + } + + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDaysOfWeek($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->days_of_week = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WeeklySchedule::class, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy_WeeklySchedule::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php new file mode 100644 index 000000000000..eb9d0691371e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php @@ -0,0 +1,917 @@ +google.cloud.alloydb.v1.Backup + */ +class Backup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + */ + private $labels; + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.Type type = 8; + */ + protected $type = 0; + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + */ + protected $description = ''; + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cluster_uid = ''; + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $cluster_name = ''; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + */ + private $annotations; + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_bytes = 0; + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expiry_time = null; + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expiry_quantity = null; + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $database_version = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * @type string $display_name + * User-settable and human-readable display name for the Backup. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current state of the backup. + * @type int $type + * The backup type, which suggests the trigger for the backup. + * @type string $description + * User-provided description of the backup. + * @type string $cluster_uid + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * @type string $cluster_name + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * @type \Google\Cloud\AlloyDb\V1\EncryptionInfo $encryption_info + * Output only. The encryption information for the backup. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type int|string $size_bytes + * Output only. The size of the backup in bytes. + * @type \Google\Protobuf\Timestamp $expiry_time + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * @type \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry $expiry_quantity + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * @type int $database_version + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + * @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 current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Backup\State::class); + $this->state = $var; + + return $this; + } + + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.Type type = 8; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.Type type = 8; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Backup\Type::class); + $this->type = $var; + + return $this; + } + + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClusterUid() + { + return $this->cluster_uid; + } + + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClusterUid($var) + { + GPBUtil::checkString($var, True); + $this->cluster_uid = $var; + + return $this; + } + + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getClusterName() + { + return $this->cluster_name; + } + + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setClusterName($var) + { + GPBUtil::checkString($var, True); + $this->cluster_name = $var; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeBytes() + { + return $this->size_bytes; + } + + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->size_bytes = $var; + + return $this; + } + + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpiryTime() + { + return $this->expiry_time; + } + + public function hasExpiryTime() + { + return isset($this->expiry_time); + } + + public function clearExpiryTime() + { + unset($this->expiry_time); + } + + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpiryTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiry_time = $var; + + return $this; + } + + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry|null + */ + public function getExpiryQuantity() + { + return $this->expiry_quantity; + } + + public function hasExpiryQuantity() + { + return isset($this->expiry_quantity); + } + + public function clearExpiryQuantity() + { + unset($this->expiry_quantity); + } + + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry $var + * @return $this + */ + public function setExpiryQuantity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry::class); + $this->expiry_quantity = $var; + + return $this; + } + + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDatabaseVersion() + { + return $this->database_version; + } + + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDatabaseVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\DatabaseVersion::class); + $this->database_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php new file mode 100644 index 000000000000..d75512a4855a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php @@ -0,0 +1,125 @@ +google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + */ +class QuantityBasedExpiry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retention_count = 0; + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $total_retention_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $retention_count + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * @type int $total_retention_count + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRetentionCount() + { + return $this->retention_count; + } + + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRetentionCount($var) + { + GPBUtil::checkInt32($var); + $this->retention_count = $var; + + return $this; + } + + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTotalRetentionCount() + { + return $this->total_retention_count; + } + + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTotalRetentionCount($var) + { + GPBUtil::checkInt32($var); + $this->total_retention_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuantityBasedExpiry::class, \Google\Cloud\AlloyDb\V1\Backup_QuantityBasedExpiry::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php new file mode 100644 index 000000000000..8dfa88a8797a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php @@ -0,0 +1,78 @@ +google.cloud.alloydb.v1.Backup.State + */ +class State +{ + /** + * The state of the backup is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The backup is ready. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The backup is creating. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + /** + * The backup failed. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The backup is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::CREATING => 'CREATING', + self::FAILED => 'FAILED', + self::DELETING => 'DELETING', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1\Backup_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php new file mode 100644 index 000000000000..7d60230e8641 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php @@ -0,0 +1,74 @@ +google.cloud.alloydb.v1.Backup.Type + */ +class Type +{ + /** + * Backup Type is unknown. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * ON_DEMAND backups that were triggered by the customer (e.g., not + * AUTOMATED). + * + * Generated from protobuf enum ON_DEMAND = 1; + */ + const ON_DEMAND = 1; + /** + * AUTOMATED backups triggered by the automated backups scheduler pursuant + * to an automated backup policy. + * + * Generated from protobuf enum AUTOMATED = 2; + */ + const AUTOMATED = 2; + /** + * CONTINUOUS backups triggered by the automated backups scheduler + * due to a continuous backup policy. + * + * Generated from protobuf enum CONTINUOUS = 3; + */ + const CONTINUOUS = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ON_DEMAND => 'ON_DEMAND', + self::AUTOMATED => 'AUTOMATED', + self::CONTINUOUS => 'CONTINUOUS', + ]; + + 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(Type::class, \Google\Cloud\AlloyDb\V1\Backup_Type::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php new file mode 100644 index 000000000000..1f06b4e463de --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php @@ -0,0 +1,113 @@ +google.cloud.alloydb.v1.BackupSource + */ +class BackupSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_uid = ''; + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_uid + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * @type string $backup_name + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBackupUid() + { + return $this->backup_uid; + } + + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBackupUid($var) + { + GPBUtil::checkString($var, True); + $this->backup_uid = $var; + + return $this; + } + + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackupName() + { + return $this->backup_name; + } + + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupName($var) + { + GPBUtil::checkString($var, True); + $this->backup_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php new file mode 100644 index 000000000000..efd28ffbc66b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php @@ -0,0 +1,221 @@ +google.cloud.alloydb.v1.BatchCreateInstanceStatus + */ +class BatchCreateInstanceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + */ + protected $state = 0; + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + */ + protected $error_msg = ''; + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + */ + protected $error = null; + /** + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * @type string $error_msg + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * @type \Google\Rpc\Status $error + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * @type int $type + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\BatchCreateInstanceStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + * @return string + */ + public function getErrorMsg() + { + return $this->error_msg; + } + + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + * @param string $var + * @return $this + */ + public function setErrorMsg($var) + { + GPBUtil::checkString($var, True); + $this->error_msg = $var; + + return $this; + } + + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\InstanceType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php new file mode 100644 index 000000000000..aed7d15776ee --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php @@ -0,0 +1,97 @@ +google.cloud.alloydb.v1.BatchCreateInstanceStatus.State + */ +class State +{ + /** + * The state of the instance is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Instance is pending creation and has not yet been picked up for + * processsing in the backend. + * + * Generated from protobuf enum PENDING_CREATE = 1; + */ + const PENDING_CREATE = 1; + /** + * The instance is active and running. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 3; + */ + const CREATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The creation of the instance failed or a fatal error occurred during + * an operation on the instance or a batch of instances. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + /** + * The instance was created successfully, but was rolled back and deleted + * due to some other failure during BatchCreateInstances operation. + * + * Generated from protobuf enum ROLLED_BACK = 6; + */ + const ROLLED_BACK = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING_CREATE => 'PENDING_CREATE', + self::READY => 'READY', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::ROLLED_BACK => 'ROLLED_BACK', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1\BatchCreateInstanceStatus_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php new file mode 100644 index 000000000000..683281041710 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php @@ -0,0 +1,134 @@ +google.cloud.alloydb.v1.BatchCreateInstancesMetadata + */ +class BatchCreateInstancesMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + */ + private $instance_targets; + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + */ + private $instance_statuses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instance_targets + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * @type array|\Google\Protobuf\Internal\MapField $instance_statuses + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceTargets() + { + return $this->instance_targets; + } + + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instance_targets = $arr; + + return $this; + } + + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInstanceStatuses() + { + return $this->instance_statuses; + } + + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInstanceStatuses($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\BatchCreateInstanceStatus::class); + $this->instance_statuses = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php new file mode 100644 index 000000000000..5be73ca95737 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php @@ -0,0 +1,185 @@ +google.cloud.alloydb.v1.BatchCreateInstancesRequest + */ +class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $requests = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. + * @type \Google\Cloud\AlloyDb\V1\CreateInstanceRequests $requests + * Required. Resources being created. + * @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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. + * + * 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 name of the parent resource. + * + * 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. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\CreateInstanceRequests|null + */ + public function getRequests() + { + return $this->requests; + } + + public function hasRequests() + { + return isset($this->requests); + } + + public function clearRequests() + { + unset($this->requests); + } + + /** + * Required. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\CreateInstanceRequests $var + * @return $this + */ + public function setRequests($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\CreateInstanceRequests::class); + $this->requests = $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 = 3 [(.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 = 3 [(.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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php new file mode 100644 index 000000000000..92bd1e0d95be --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php @@ -0,0 +1,67 @@ +google.cloud.alloydb.v1.BatchCreateInstancesResponse + */ +class BatchCreateInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * Created instances. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; + * @param array<\Google\Cloud\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Instance::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php new file mode 100644 index 000000000000..7a3c30dcc531 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php @@ -0,0 +1,1189 @@ +google.cloud.alloydb.v1.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Output only. The current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cluster_type = 0; + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $database_version = 0; + /** + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_config = null; + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @deprecated + */ + protected $network = ''; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + */ + private $annotations; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $initial_user = null; + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + */ + protected $automated_backup_policy = null; + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; + * @deprecated + */ + protected $ssl_config = null; + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $continuous_backup_config = null; + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $continuous_backup_info = null; + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + */ + protected $secondary_config = null; + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $primary_config = null; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1\BackupSource $backup_source + * Output only. Cluster created from backup. + * @type \Google\Cloud\AlloyDb\V1\MigrationSource $migration_source + * Output only. Cluster created via DMS migration. + * @type string $name + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * @type string $display_name + * User-settable and human-readable display name for the Cluster. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current serving state of the cluster. + * @type int $cluster_type + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * @type int $database_version + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * @type \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig $network_config + * @type string $network + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * @type \Google\Cloud\AlloyDb\V1\UserPassword $initial_user + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy $automated_backup_policy + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * @type \Google\Cloud\AlloyDb\V1\SslConfig $ssl_config + * SSL configuration for this AlloyDB cluster. + * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * @type \Google\Cloud\AlloyDb\V1\EncryptionInfo $encryption_info + * Output only. The encryption information for the cluster. + * @type \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig $continuous_backup_config + * Optional. Continuous backup configuration for this cluster. + * @type \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo $continuous_backup_info + * Output only. Continuous backup properties for this cluster. + * @type \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig $secondary_config + * Cross Region replication config specific to SECONDARY cluster. + * @type \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig $primary_config + * Output only. Cross Region replication config specific to PRIMARY cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Cluster created from backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\BackupSource|null + */ + public function getBackupSource() + { + return $this->readOneof(15); + } + + public function hasBackupSource() + { + return $this->hasOneof(15); + } + + /** + * Output only. Cluster created from backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\BackupSource $var + * @return $this + */ + public function setBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\BackupSource::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. Cluster created via DMS migration. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\MigrationSource|null + */ + public function getMigrationSource() + { + return $this->readOneof(16); + } + + public function hasMigrationSource() + { + return $this->hasOneof(16); + } + + /** + * Output only. Cluster created via DMS migration. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\MigrationSource $var + * @return $this + */ + public function setMigrationSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\MigrationSource::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @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 current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Cluster\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getClusterType() + { + return $this->cluster_type; + } + + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setClusterType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Cluster\ClusterType::class); + $this->cluster_type = $var; + + return $this; + } + + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDatabaseVersion() + { + return $this->database_version; + } + + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDatabaseVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\DatabaseVersion::class); + $this->database_version = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig|null + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + public function hasNetworkConfig() + { + return isset($this->network_config); + } + + public function clearNetworkConfig() + { + unset($this->network_config); + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig::class); + $this->network_config = $var; + + return $this; + } + + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + * @deprecated + */ + public function getNetwork() + { + @trigger_error('network is deprecated.', E_USER_DEPRECATED); + return $this->network; + } + + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + * @deprecated + */ + public function setNetwork($var) + { + @trigger_error('network is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\UserPassword|null + */ + public function getInitialUser() + { + return $this->initial_user; + } + + public function hasInitialUser() + { + return isset($this->initial_user); + } + + public function clearInitialUser() + { + unset($this->initial_user); + } + + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\UserPassword $var + * @return $this + */ + public function setInitialUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\UserPassword::class); + $this->initial_user = $var; + + return $this; + } + + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy|null + */ + public function getAutomatedBackupPolicy() + { + return $this->automated_backup_policy; + } + + public function hasAutomatedBackupPolicy() + { + return isset($this->automated_backup_policy); + } + + public function clearAutomatedBackupPolicy() + { + unset($this->automated_backup_policy); + } + + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; + * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy $var + * @return $this + */ + public function setAutomatedBackupPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy::class); + $this->automated_backup_policy = $var; + + return $this; + } + + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; + * @return \Google\Cloud\AlloyDb\V1\SslConfig|null + * @deprecated + */ + public function getSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + return $this->ssl_config; + } + + public function hasSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + return isset($this->ssl_config); + } + + public function clearSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + unset($this->ssl_config); + } + + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; + * @param \Google\Cloud\AlloyDb\V1\SslConfig $var + * @return $this + * @deprecated + */ + public function setSslConfig($var) + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SslConfig::class); + $this->ssl_config = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig|null + */ + public function getContinuousBackupConfig() + { + return $this->continuous_backup_config; + } + + public function hasContinuousBackupConfig() + { + return isset($this->continuous_backup_config); + } + + public function clearContinuousBackupConfig() + { + unset($this->continuous_backup_config); + } + + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig $var + * @return $this + */ + public function setContinuousBackupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig::class); + $this->continuous_backup_config = $var; + + return $this; + } + + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo|null + */ + public function getContinuousBackupInfo() + { + return $this->continuous_backup_info; + } + + public function hasContinuousBackupInfo() + { + return isset($this->continuous_backup_info); + } + + public function clearContinuousBackupInfo() + { + unset($this->continuous_backup_info); + } + + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo $var + * @return $this + */ + public function setContinuousBackupInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo::class); + $this->continuous_backup_info = $var; + + return $this; + } + + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * @return \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig|null + */ + public function getSecondaryConfig() + { + return $this->secondary_config; + } + + public function hasSecondaryConfig() + { + return isset($this->secondary_config); + } + + public function clearSecondaryConfig() + { + unset($this->secondary_config); + } + + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; + * @param \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig $var + * @return $this + */ + public function setSecondaryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig::class); + $this->secondary_config = $var; + + return $this; + } + + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig|null + */ + public function getPrimaryConfig() + { + return $this->primary_config; + } + + public function hasPrimaryConfig() + { + return isset($this->primary_config); + } + + public function clearPrimaryConfig() + { + unset($this->primary_config); + } + + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig $var + * @return $this + */ + public function setPrimaryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig::class); + $this->primary_config = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php new file mode 100644 index 000000000000..59a819d045b1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1.Cluster.ClusterType + */ +class ClusterType +{ + /** + * The type of the cluster is unknown. + * + * Generated from protobuf enum CLUSTER_TYPE_UNSPECIFIED = 0; + */ + const CLUSTER_TYPE_UNSPECIFIED = 0; + /** + * Primary cluster that support read and write operations. + * + * Generated from protobuf enum PRIMARY = 1; + */ + const PRIMARY = 1; + /** + * Secondary cluster that is replicating from another region. + * This only supports read. + * + * Generated from protobuf enum SECONDARY = 2; + */ + const SECONDARY = 2; + + private static $valueToName = [ + self::CLUSTER_TYPE_UNSPECIFIED => 'CLUSTER_TYPE_UNSPECIFIED', + self::PRIMARY => 'PRIMARY', + self::SECONDARY => 'SECONDARY', + ]; + + 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(ClusterType::class, \Google\Cloud\AlloyDb\V1\Cluster_ClusterType::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php new file mode 100644 index 000000000000..0719e408cdb8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php @@ -0,0 +1,148 @@ +google.cloud.alloydb.v1.Cluster.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allocated_ip_range = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * @type string $allocated_ip_range + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAllocatedIpRange() + { + return $this->allocated_ip_range; + } + + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAllocatedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->allocated_ip_range = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkConfig::class, \Google\Cloud\AlloyDb\V1\Cluster_NetworkConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php new file mode 100644 index 000000000000..229e0bf82669 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1.Cluster.PrimaryConfig + */ +class PrimaryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $secondary_cluster_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_cluster_names + * Output only. Names of the clusters that are replicating from this + * cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryClusterNames() + { + return $this->secondary_cluster_names; + } + + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryClusterNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_cluster_names = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrimaryConfig::class, \Google\Cloud\AlloyDb\V1\Cluster_PrimaryConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php new file mode 100644 index 000000000000..b3ddfb245158 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php @@ -0,0 +1,75 @@ +google.cloud.alloydb.v1.Cluster.SecondaryConfig + */ +class SecondaryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + */ + protected $primary_cluster_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $primary_cluster_name + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + * @return string + */ + public function getPrimaryClusterName() + { + return $this->primary_cluster_name; + } + + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + * @param string $var + * @return $this + */ + public function setPrimaryClusterName($var) + { + GPBUtil::checkString($var, True); + $this->primary_cluster_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SecondaryConfig::class, \Google\Cloud\AlloyDb\V1\Cluster_SecondaryConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php new file mode 100644 index 000000000000..362f2a921449 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php @@ -0,0 +1,125 @@ +google.cloud.alloydb.v1.Cluster.State + */ +class State +{ + /** + * The state of the cluster is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The cluster is active and running. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The cluster is stopped. All instances in the cluster are stopped. + * Customers can start a stopped cluster at any point and all their + * instances will come back to life with same names and IP resources. In + * this state, customer pays for storage. + * Associated backups could also be present in a stopped cluster. + * + * Generated from protobuf enum STOPPED = 2; + */ + const STOPPED = 2; + /** + * The cluster is empty and has no associated resources. + * All instances, associated storage and backups have been deleted. + * + * Generated from protobuf enum EMPTY = 3; + */ + const PBEMPTY = 3; + /** + * The cluster is being created. + * + * Generated from protobuf enum CREATING = 4; + */ + const CREATING = 4; + /** + * The cluster is being deleted. + * + * Generated from protobuf enum DELETING = 5; + */ + const DELETING = 5; + /** + * The creation of the cluster failed. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * The cluster is bootstrapping with data from some other source. + * Direct mutations to the cluster (e.g. adding read pool) are not allowed. + * + * Generated from protobuf enum BOOTSTRAPPING = 7; + */ + const BOOTSTRAPPING = 7; + /** + * The cluster is under maintenance. AlloyDB regularly performs maintenance + * and upgrades on customer clusters. Updates on the cluster are + * not allowed while the cluster is in this state. + * + * Generated from protobuf enum MAINTENANCE = 8; + */ + const MAINTENANCE = 8; + /** + * The cluster is being promoted. + * + * Generated from protobuf enum PROMOTING = 9; + */ + const PROMOTING = 9; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::STOPPED => 'STOPPED', + self::PBEMPTY => 'EMPTY', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::BOOTSTRAPPING => 'BOOTSTRAPPING', + self::MAINTENANCE => 'MAINTENANCE', + self::PROMOTING => 'PROMOTING', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\AlloyDb\V1\Cluster_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php new file mode 100644 index 000000000000..684db46d2c34 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php @@ -0,0 +1,66 @@ +google.cloud.alloydb.v1.ClusterView + */ +class ClusterView +{ + /** + * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + * + * Generated from protobuf enum CLUSTER_VIEW_UNSPECIFIED = 0; + */ + const CLUSTER_VIEW_UNSPECIFIED = 0; + /** + * BASIC server responses include all the relevant cluster details, excluding + * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific + * fields. The default value. + * + * Generated from protobuf enum CLUSTER_VIEW_BASIC = 1; + */ + const CLUSTER_VIEW_BASIC = 1; + /** + * CONTINUOUS_BACKUP response returns all the fields from BASIC plus + * the earliest restorable time if continuous backups are enabled. + * May increase latency. + * + * Generated from protobuf enum CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + const CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + + private static $valueToName = [ + self::CLUSTER_VIEW_UNSPECIFIED => 'CLUSTER_VIEW_UNSPECIFIED', + self::CLUSTER_VIEW_BASIC => 'CLUSTER_VIEW_BASIC', + self::CLUSTER_VIEW_CONTINUOUS_BACKUP => 'CLUSTER_VIEW_CONTINUOUS_BACKUP', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php new file mode 100644 index 000000000000..6232de3da334 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php @@ -0,0 +1,152 @@ +google.cloud.alloydb.v1.ConnectionInfo + */ +class ConnectionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ip_address = ''; + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $instance_uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * @type string $ip_address + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * @type string $instance_uid + * Output only. The unique ID of the Instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getInstanceUid() + { + return $this->instance_uid; + } + + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setInstanceUid($var) + { + GPBUtil::checkString($var, True); + $this->instance_uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php new file mode 100644 index 000000000000..6225028820f1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php @@ -0,0 +1,176 @@ +google.cloud.alloydb.v1.ContinuousBackupConfig + */ +class ContinuousBackupConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + */ + protected $recovery_window_days = 0; + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + protected $encryption_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Whether ContinuousBackup is enabled. + * @type int $recovery_window_days + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + * @return int + */ + public function getRecoveryWindowDays() + { + return $this->recovery_window_days; + } + + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + * @param int $var + * @return $this + */ + public function setRecoveryWindowDays($var) + { + GPBUtil::checkInt32($var); + $this->recovery_window_days = $var; + + return $this; + } + + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php new file mode 100644 index 000000000000..e6d7f95fb61e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php @@ -0,0 +1,216 @@ +google.cloud.alloydb.v1.ContinuousBackupInfo + */ +class ContinuousBackupInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $enabled_time = null; + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $schedule; + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $earliest_restorable_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1\EncryptionInfo $encryption_info + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * @type \Google\Protobuf\Timestamp $enabled_time + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * @type array|\Google\Protobuf\Internal\RepeatedField $schedule + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * @type \Google\Protobuf\Timestamp $earliest_restorable_time + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEnabledTime() + { + return $this->enabled_time; + } + + public function hasEnabledTime() + { + return isset($this->enabled_time); + } + + public function clearEnabledTime() + { + unset($this->enabled_time); + } + + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEnabledTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->enabled_time = $var; + + return $this; + } + + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchedule() + { + return $this->schedule; + } + + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchedule($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->schedule = $arr; + + return $this; + } + + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestRestorableTime() + { + return $this->earliest_restorable_time; + } + + public function hasEarliestRestorableTime() + { + return isset($this->earliest_restorable_time); + } + + public function clearEarliestRestorableTime() + { + unset($this->earliest_restorable_time); + } + + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestRestorableTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_restorable_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php new file mode 100644 index 000000000000..7764ab3e5697 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php @@ -0,0 +1,119 @@ +google.cloud.alloydb.v1.ContinuousBackupSource + */ +class ContinuousBackupSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = ''; + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $point_in_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * @type \Google\Protobuf\Timestamp $point_in_time + * Required. The point in time to restore to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCluster() + { + return $this->cluster; + } + + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkString($var, True); + $this->cluster = $var; + + return $this; + } + + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPointInTime() + { + return $this->point_in_time; + } + + public function hasPointInTime() + { + return isset($this->point_in_time); + } + + public function clearPointInTime() + { + unset($this->point_in_time); + } + + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPointInTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->point_in_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php new file mode 100644 index 000000000000..8311f1385500 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php @@ -0,0 +1,275 @@ +google.cloud.alloydb.v1.CreateBackupRequest + */ +class CreateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see AlloyDBAdminClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AlloyDb\V1\Backup $backup Required. The resource being created + * @param string $backupId Required. ID of the requesting object. + * + * @return \Google\Cloud\AlloyDb\V1\CreateBackupRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Backup $backup, string $backupId): self + { + return (new self()) + ->setParent($parent) + ->setBackup($backup) + ->setBackupId($backupId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $backup_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1\Backup $backup + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupId() + { + return $this->backup_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupId($var) + { + GPBUtil::checkString($var, True); + $this->backup_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Backup::class); + $this->backup = $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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php new file mode 100644 index 000000000000..7904fcc3a9a4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php @@ -0,0 +1,284 @@ +google.cloud.alloydb.v1.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. Please see + * {@see AlloyDBAdminClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AlloyDb\V1\Cluster $cluster Required. The resource being created + * @param string $clusterId Required. ID of the requesting object. + * + * @return \Google\Cloud\AlloyDb\V1\CreateClusterRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Cluster $cluster, string $clusterId): self + { + return (new self()) + ->setParent($parent) + ->setCluster($cluster) + ->setClusterId($clusterId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * 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 location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); + $this->cluster = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php new file mode 100644 index 000000000000..8da4cc57bd3d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php @@ -0,0 +1,284 @@ +google.cloud.alloydb.v1.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * @param \Google\Cloud\AlloyDb\V1\Instance $instance Required. The resource being created + * @param string $instanceId Required. ID of the requesting object. + * + * @return \Google\Cloud\AlloyDb\V1\CreateInstanceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Instance $instance, string $instanceId): self + { + return (new self()) + ->setParent($parent) + ->setInstance($instance) + ->setInstanceId($instanceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @type string $instance_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1\Instance $instance + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance::class); + $this->instance = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php new file mode 100644 index 000000000000..e98a40af9368 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1.CreateInstanceRequests + */ +class CreateInstanceRequests extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $create_instance_requests; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $create_instance_requests + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCreateInstanceRequests() + { + return $this->create_instance_requests; + } + + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\AlloyDb\V1\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCreateInstanceRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\CreateInstanceRequest::class); + $this->create_instance_requests = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php new file mode 100644 index 000000000000..11b2c6c2e1ec --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php @@ -0,0 +1,282 @@ +google.cloud.alloydb.v1.CreateSecondaryClusterRequest + */ +class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. Please see + * {@see AlloyDBAdminClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AlloyDb\V1\Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). + * @param string $clusterId Required. ID of the requesting object (the secondary cluster). + * + * @return \Google\Cloud\AlloyDb\V1\CreateSecondaryClusterRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Cluster $cluster, string $clusterId): self + { + return (new self()) + ->setParent($parent) + ->setCluster($cluster) + ->setClusterId($clusterId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object (the secondary cluster). + * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster + * Required. Configuration of the requesting object (the secondary cluster). + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * 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 location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * 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. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); + $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php new file mode 100644 index 000000000000..a7f3586d36a0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php @@ -0,0 +1,284 @@ +google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + */ +class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * @param \Google\Cloud\AlloyDb\V1\Instance $instance Required. The resource being created + * @param string $instanceId Required. ID of the requesting object. + * + * @return \Google\Cloud\AlloyDb\V1\CreateSecondaryInstanceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Instance $instance, string $instanceId): self + { + return (new self()) + ->setParent($parent) + ->setInstance($instance) + ->setInstanceId($instanceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @type string $instance_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1\Instance $instance + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance::class); + $this->instance = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php new file mode 100644 index 000000000000..3fe9ac1ec46b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php @@ -0,0 +1,275 @@ +google.cloud.alloydb.v1.CreateUserRequest + */ +class CreateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * @param \Google\Cloud\AlloyDb\V1\User $user Required. The resource being created + * @param string $userId Required. ID of the requesting object. + * + * @return \Google\Cloud\AlloyDb\V1\CreateUserRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AlloyDb\V1\User $user, string $userId): self + { + return (new self()) + ->setParent($parent) + ->setUser($user) + ->setUserId($userId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $user_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1\User $user + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\User::class); + $this->user = $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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php new file mode 100644 index 000000000000..43b351f9d5d9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php @@ -0,0 +1,61 @@ +google.cloud.alloydb.v1.DatabaseVersion + */ +class DatabaseVersion +{ + /** + * This is an unknown database version. + * + * Generated from protobuf enum DATABASE_VERSION_UNSPECIFIED = 0; + */ + const DATABASE_VERSION_UNSPECIFIED = 0; + /** + * DEPRECATED - The database version is Postgres 13. + * + * Generated from protobuf enum POSTGRES_13 = 1 [deprecated = true]; + */ + const POSTGRES_13 = 1; + /** + * The database version is Postgres 14. + * + * Generated from protobuf enum POSTGRES_14 = 2; + */ + const POSTGRES_14 = 2; + + private static $valueToName = [ + self::DATABASE_VERSION_UNSPECIFIED => 'DATABASE_VERSION_UNSPECIFIED', + self::POSTGRES_13 => 'POSTGRES_13', + self::POSTGRES_14 => 'POSTGRES_14', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php new file mode 100644 index 000000000000..8b9db4c24a07 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php @@ -0,0 +1,240 @@ +google.cloud.alloydb.v1.DeleteBackupRequest + */ +class DeleteBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * + * 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. Please see + * {@see AlloyDBAdminClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\DeleteBackupRequest + * + * @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. For the required format, see the comment on + * the Backup.name field. + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type string $etag + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * + * 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. For the required format, see the comment on + * the Backup.name field. + * + * 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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php new file mode 100644 index 000000000000..89e72f18c978 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php @@ -0,0 +1,274 @@ +google.cloud.alloydb.v1.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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 = ''; + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. Please see + * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\DeleteClusterRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @type bool $force + * Optional. Whether to cascade delete child instances for given cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php new file mode 100644 index 000000000000..8e177fbb3777 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php @@ -0,0 +1,240 @@ +google.cloud.alloydb.v1.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\DeleteInstanceRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type string $etag + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php new file mode 100644 index 000000000000..05a7ca8e1900 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php @@ -0,0 +1,198 @@ +google.cloud.alloydb.v1.DeleteUserRequest + */ +class DeleteUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. Please see + * {@see AlloyDBAdminClient::userName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\DeleteUserRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the User.name field. + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php new file mode 100644 index 000000000000..20ebb1d0926b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1.EncryptionConfig + */ +class EncryptionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + */ + protected $kms_key_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kms_key_name + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php new file mode 100644 index 000000000000..c37bade4f198 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1.EncryptionInfo + */ +class EncryptionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_type = 0; + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $kms_key_versions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $encryption_type + * Output only. Type of encryption. + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_versions + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEncryptionType() + { + return $this->encryption_type; + } + + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEncryptionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo\Type::class); + $this->encryption_type = $var; + + return $this; + } + + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeyVersions() + { + return $this->kms_key_versions; + } + + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeyVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_key_versions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php new file mode 100644 index 000000000000..2c074173d915 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php @@ -0,0 +1,66 @@ +google.cloud.alloydb.v1.EncryptionInfo.Type + */ +class Type +{ + /** + * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The data is encrypted at rest with a key that is fully managed by Google. + * No key version will be populated. This is the default state. + * + * Generated from protobuf enum GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + const GOOGLE_DEFAULT_ENCRYPTION = 1; + /** + * The data is encrypted at rest with a key that is managed by the customer. + * KMS key versions will be populated. + * + * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + const CUSTOMER_MANAGED_ENCRYPTION = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::GOOGLE_DEFAULT_ENCRYPTION => 'GOOGLE_DEFAULT_ENCRYPTION', + self::CUSTOMER_MANAGED_ENCRYPTION => 'CUSTOMER_MANAGED_ENCRYPTION', + ]; + + 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(Type::class, \Google\Cloud\AlloyDb\V1\EncryptionInfo_Type::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php new file mode 100644 index 000000000000..385f6cee2600 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php @@ -0,0 +1,198 @@ +google.cloud.alloydb.v1.FailoverInstanceRequest + */ +class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\FailoverInstanceRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php new file mode 100644 index 000000000000..a66f9ccd2a1a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php @@ -0,0 +1,297 @@ +google.cloud.alloydb.v1.GenerateClientCertificateRequest + */ +class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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 = ''; + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cert_duration = null; + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $public_key = ''; + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_metadata_exchange = false; + + /** + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\GenerateClientCertificateRequest + * + * @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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @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). + * @type \Google\Protobuf\Duration $cert_duration + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * @type string $public_key + * Optional. The public key from the client. + * @type bool $use_metadata_exchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * 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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * 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. 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; + } + + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getCertDuration() + { + return $this->cert_duration; + } + + public function hasCertDuration() + { + return isset($this->cert_duration); + } + + public function clearCertDuration() + { + unset($this->cert_duration); + } + + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setCertDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->cert_duration = $var; + + return $this; + } + + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPublicKey() + { + return $this->public_key; + } + + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPublicKey($var) + { + GPBUtil::checkString($var, True); + $this->public_key = $var; + + return $this; + } + + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseMetadataExchange() + { + return $this->use_metadata_exchange; + } + + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseMetadataExchange($var) + { + GPBUtil::checkBool($var); + $this->use_metadata_exchange = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php new file mode 100644 index 000000000000..b2917171c894 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1.GenerateClientCertificateResponse + */ +class GenerateClientCertificateResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $pem_certificate_chain; + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ca_cert = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * @type string $ca_cert + * Optional. The pem-encoded cluster ca X.509 certificate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPemCertificateChain() + { + return $this->pem_certificate_chain; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPemCertificateChain($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->pem_certificate_chain = $arr; + + return $this; + } + + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCaCert() + { + return $this->ca_cert; + } + + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCaCert($var) + { + GPBUtil::checkString($var, True); + $this->ca_cert = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php new file mode 100644 index 000000000000..7a24badd0c55 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php @@ -0,0 +1,81 @@ +google.cloud.alloydb.v1.GetBackupRequest + */ +class GetBackupRequest 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 = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see AlloyDBAdminClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\GetBackupRequest + * + * @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 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::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; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php new file mode 100644 index 000000000000..5f78a0d47d32 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php @@ -0,0 +1,124 @@ +google.cloud.alloydb.v1.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. Please see + * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\GetClusterRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @type int $view + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\ClusterView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php new file mode 100644 index 000000000000..e62b821f8334 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php @@ -0,0 +1,160 @@ +google.cloud.alloydb.v1.GetConnectionInfoRequest + */ +class GetConnectionInfoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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 $parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * Please see {@see AlloyDBAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\GetConnectionInfoRequest + * + * @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 name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * 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 name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * 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. 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php new file mode 100644 index 000000000000..3bcba9f5011c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php @@ -0,0 +1,120 @@ +google.cloud.alloydb.v1.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1.InstanceView view = 2; + */ + protected $view = 0; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\GetInstanceRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @type int $view + * The view of the instance to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1.InstanceView view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1.InstanceView view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\InstanceView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php new file mode 100644 index 000000000000..64a3c00cc2c8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php @@ -0,0 +1,86 @@ +google.cloud.alloydb.v1.GetUserRequest + */ +class GetUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. Please see + * {@see AlloyDBAdminClient::userName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\GetUserRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the User.name field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php new file mode 100644 index 000000000000..223a6851d23d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php @@ -0,0 +1,239 @@ +google.cloud.alloydb.v1.InjectFaultRequest + */ +class InjectFaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fault_type = 0; + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param int $faultType Required. The type of fault to be injected in an instance. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\InjectFaultRequest\FaultType} + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\InjectFaultRequest + * + * @experimental + */ + public static function build(int $faultType, string $name): self + { + return (new self()) + ->setFaultType($faultType) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $fault_type + * Required. The type of fault to be injected in an instance. + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getFaultType() + { + return $this->fault_type; + } + + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setFaultType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\InjectFaultRequest\FaultType::class); + $this->fault_type = $var; + + return $this; + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php new file mode 100644 index 000000000000..ecb8d20a8d57 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php @@ -0,0 +1,58 @@ +google.cloud.alloydb.v1.InjectFaultRequest.FaultType + */ +class FaultType +{ + /** + * The fault type is unknown. + * + * Generated from protobuf enum FAULT_TYPE_UNSPECIFIED = 0; + */ + const FAULT_TYPE_UNSPECIFIED = 0; + /** + * Stop the VM + * + * Generated from protobuf enum STOP_VM = 1; + */ + const STOP_VM = 1; + + private static $valueToName = [ + self::FAULT_TYPE_UNSPECIFIED => 'FAULT_TYPE_UNSPECIFIED', + self::STOP_VM => 'STOP_VM', + ]; + + 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(FaultType::class, \Google\Cloud\AlloyDb\V1\InjectFaultRequest_FaultType::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php new file mode 100644 index 000000000000..8a5e4930c841 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php @@ -0,0 +1,1026 @@ +google.cloud.alloydb.v1.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Output only. The current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_type = 0; + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + */ + protected $machine_config = null; + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + */ + protected $availability_type = 0; + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + */ + protected $gce_zone = ''; + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + */ + private $database_flags; + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $writable_node = null; + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $nodes; + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + */ + protected $query_insights_config = null; + /** + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + */ + protected $read_pool_config = null; + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ip_address = ''; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + */ + private $annotations; + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_connection_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * @type string $display_name + * User-settable and human-readable display name for the Instance. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current serving state of the instance. + * @type int $instance_type + * Required. The type of the instance. Specified at creation time. + * @type \Google\Cloud\AlloyDb\V1\Instance\MachineConfig $machine_config + * Configurations for the machines that host the underlying + * database engine. + * @type int $availability_type + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * @type string $gce_zone + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * @type array|\Google\Protobuf\Internal\MapField $database_flags + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * @type \Google\Cloud\AlloyDb\V1\Instance\Node $writable_node + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * @type array<\Google\Cloud\AlloyDb\V1\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $nodes + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * @type \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig $query_insights_config + * Configuration for query insights. + * @type \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig $read_pool_config + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. + * @type string $ip_address + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig $client_connection_config + * Optional. Client connection specific configurations + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @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 current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getInstanceType() + { + return $this->instance_type; + } + + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setInstanceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\InstanceType::class); + $this->instance_type = $var; + + return $this; + } + + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * @return \Google\Cloud\AlloyDb\V1\Instance\MachineConfig|null + */ + public function getMachineConfig() + { + return $this->machine_config; + } + + public function hasMachineConfig() + { + return isset($this->machine_config); + } + + public function clearMachineConfig() + { + unset($this->machine_config); + } + + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; + * @param \Google\Cloud\AlloyDb\V1\Instance\MachineConfig $var + * @return $this + */ + public function setMachineConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\MachineConfig::class); + $this->machine_config = $var; + + return $this; + } + + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * @return int + */ + public function getAvailabilityType() + { + return $this->availability_type; + } + + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; + * @param int $var + * @return $this + */ + public function setAvailabilityType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\AvailabilityType::class); + $this->availability_type = $var; + + return $this; + } + + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + * @return string + */ + public function getGceZone() + { + return $this->gce_zone; + } + + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + * @param string $var + * @return $this + */ + public function setGceZone($var) + { + GPBUtil::checkString($var, True); + $this->gce_zone = $var; + + return $this; + } + + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDatabaseFlags() + { + return $this->database_flags; + } + + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDatabaseFlags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->database_flags = $arr; + + return $this; + } + + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\Instance\Node|null + */ + public function getWritableNode() + { + return $this->writable_node; + } + + public function hasWritableNode() + { + return isset($this->writable_node); + } + + public function clearWritableNode() + { + unset($this->writable_node); + } + + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\Instance\Node $var + * @return $this + */ + public function setWritableNode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\Node::class); + $this->writable_node = $var; + + return $this; + } + + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\AlloyDb\V1\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Instance\Node::class); + $this->nodes = $arr; + + return $this; + } + + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * @return \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig|null + */ + public function getQueryInsightsConfig() + { + return $this->query_insights_config; + } + + public function hasQueryInsightsConfig() + { + return isset($this->query_insights_config); + } + + public function clearQueryInsightsConfig() + { + unset($this->query_insights_config); + } + + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * @param \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig $var + * @return $this + */ + public function setQueryInsightsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig::class); + $this->query_insights_config = $var; + + return $this; + } + + /** + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * @return \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig|null + */ + public function getReadPoolConfig() + { + return $this->read_pool_config; + } + + public function hasReadPoolConfig() + { + return isset($this->read_pool_config); + } + + public function clearReadPoolConfig() + { + unset($this->read_pool_config); + } + + /** + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; + * @param \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig $var + * @return $this + */ + public function setReadPoolConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig::class); + $this->read_pool_config = $var; + + return $this; + } + + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig|null + */ + public function getClientConnectionConfig() + { + return $this->client_connection_config; + } + + public function hasClientConnectionConfig() + { + return isset($this->client_connection_config); + } + + public function clearClientConnectionConfig() + { + unset($this->client_connection_config); + } + + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig $var + * @return $this + */ + public function setClientConnectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig::class); + $this->client_connection_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php new file mode 100644 index 000000000000..22736beb9ab1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php @@ -0,0 +1,68 @@ +google.cloud.alloydb.v1.Instance.AvailabilityType + */ +class AvailabilityType +{ + /** + * This is an unknown Availability type. + * + * Generated from protobuf enum AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + const AVAILABILITY_TYPE_UNSPECIFIED = 0; + /** + * Zonal available instance. + * + * Generated from protobuf enum ZONAL = 1; + */ + const ZONAL = 1; + /** + * Regional (or Highly) available instance. + * + * Generated from protobuf enum REGIONAL = 2; + */ + const REGIONAL = 2; + + private static $valueToName = [ + self::AVAILABILITY_TYPE_UNSPECIFIED => 'AVAILABILITY_TYPE_UNSPECIFIED', + self::ZONAL => 'ZONAL', + self::REGIONAL => 'REGIONAL', + ]; + + 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(AvailabilityType::class, \Google\Cloud\AlloyDb\V1\Instance_AvailabilityType::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php new file mode 100644 index 000000000000..026a528e0756 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php @@ -0,0 +1,118 @@ +google.cloud.alloydb.v1.Instance.ClientConnectionConfig + */ +class ClientConnectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $require_connectors = false; + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $require_connectors + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * @type \Google\Cloud\AlloyDb\V1\SslConfig $ssl_config + * Optional. SSL config option for this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequireConnectors() + { + return $this->require_connectors; + } + + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequireConnectors($var) + { + GPBUtil::checkBool($var); + $this->require_connectors = $var; + + return $this; + } + + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\SslConfig|null + */ + public function getSslConfig() + { + return $this->ssl_config; + } + + public function hasSslConfig() + { + return isset($this->ssl_config); + } + + public function clearSslConfig() + { + unset($this->ssl_config); + } + + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\SslConfig $var + * @return $this + */ + public function setSslConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SslConfig::class); + $this->ssl_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClientConnectionConfig::class, \Google\Cloud\AlloyDb\V1\Instance_ClientConnectionConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php new file mode 100644 index 000000000000..7472c57582ab --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1.Instance.InstanceType + */ +class InstanceType +{ + /** + * The type of the instance is unknown. + * + * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; + */ + const INSTANCE_TYPE_UNSPECIFIED = 0; + /** + * PRIMARY instances support read and write operations. + * + * Generated from protobuf enum PRIMARY = 1; + */ + const PRIMARY = 1; + /** + * READ POOL instances support read operations only. Each read pool instance + * consists of one or more homogeneous nodes. + * * Read pool of size 1 can only have zonal availability. + * * Read pools with node count of 2 or more can have regional + * availability (nodes are present in 2 or more zones in a region). + * + * Generated from protobuf enum READ_POOL = 2; + */ + const READ_POOL = 2; + /** + * SECONDARY instances support read operations only. SECONDARY instance + * is a cross-region read replica + * + * Generated from protobuf enum SECONDARY = 3; + */ + const SECONDARY = 3; + + private static $valueToName = [ + self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', + self::PRIMARY => 'PRIMARY', + self::READ_POOL => 'READ_POOL', + self::SECONDARY => 'SECONDARY', + ]; + + 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\AlloyDb\V1\Instance_InstanceType::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php new file mode 100644 index 000000000000..e3be82345b58 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1.Instance.MachineConfig + */ +class MachineConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + */ + protected $cpu_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $cpu_count + * The number of CPU's in the VM instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + * @return int + */ + public function getCpuCount() + { + return $this->cpu_count; + } + + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + * @param int $var + * @return $this + */ + public function setCpuCount($var) + { + GPBUtil::checkInt32($var); + $this->cpu_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MachineConfig::class, \Google\Cloud\AlloyDb\V1\Instance_MachineConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php new file mode 100644 index 000000000000..d7adf74942a2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php @@ -0,0 +1,186 @@ +google.cloud.alloydb.v1.Instance.Node + */ +class Node extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + */ + protected $zone_id = ''; + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + */ + protected $id = ''; + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + */ + protected $ip = ''; + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + */ + protected $state = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone_id + * The Compute Engine zone of the VM e.g. "us-central1-b". + * @type string $id + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * @type string $ip + * The private IP address of the VM e.g. "10.57.0.34". + * @type string $state + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + * @return string + */ + public function getZoneId() + { + return $this->zone_id; + } + + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + * @param string $var + * @return $this + */ + public function setZoneId($var) + { + GPBUtil::checkString($var, True); + $this->zone_id = $var; + + return $this; + } + + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + * @return string + */ + public function getIp() + { + return $this->ip; + } + + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + * @param string $var + * @return $this + */ + public function setIp($var) + { + GPBUtil::checkString($var, True); + $this->ip = $var; + + return $this; + } + + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Node::class, \Google\Cloud\AlloyDb\V1\Instance_Node::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php new file mode 100644 index 000000000000..7433b3806a61 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php @@ -0,0 +1,222 @@ +google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + */ +class QueryInsightsInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + */ + protected $record_application_tags = null; + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + */ + protected $record_client_address = null; + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + */ + protected $query_string_length = 0; + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + */ + protected $query_plans_per_minute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $record_application_tags + * Record application tags for an instance. + * This flag is turned "on" by default. + * @type bool $record_client_address + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * @type int $query_string_length + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * @type int $query_plans_per_minute + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + * @return bool + */ + public function getRecordApplicationTags() + { + return isset($this->record_application_tags) ? $this->record_application_tags : false; + } + + public function hasRecordApplicationTags() + { + return isset($this->record_application_tags); + } + + public function clearRecordApplicationTags() + { + unset($this->record_application_tags); + } + + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + * @param bool $var + * @return $this + */ + public function setRecordApplicationTags($var) + { + GPBUtil::checkBool($var); + $this->record_application_tags = $var; + + return $this; + } + + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + * @return bool + */ + public function getRecordClientAddress() + { + return isset($this->record_client_address) ? $this->record_client_address : false; + } + + public function hasRecordClientAddress() + { + return isset($this->record_client_address); + } + + public function clearRecordClientAddress() + { + unset($this->record_client_address); + } + + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + * @param bool $var + * @return $this + */ + public function setRecordClientAddress($var) + { + GPBUtil::checkBool($var); + $this->record_client_address = $var; + + return $this; + } + + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + * @return int + */ + public function getQueryStringLength() + { + return $this->query_string_length; + } + + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + * @param int $var + * @return $this + */ + public function setQueryStringLength($var) + { + GPBUtil::checkUint32($var); + $this->query_string_length = $var; + + return $this; + } + + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + * @return int + */ + public function getQueryPlansPerMinute() + { + return isset($this->query_plans_per_minute) ? $this->query_plans_per_minute : 0; + } + + public function hasQueryPlansPerMinute() + { + return isset($this->query_plans_per_minute); + } + + public function clearQueryPlansPerMinute() + { + unset($this->query_plans_per_minute); + } + + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + * @param int $var + * @return $this + */ + public function setQueryPlansPerMinute($var) + { + GPBUtil::checkUint32($var); + $this->query_plans_per_minute = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryInsightsInstanceConfig::class, \Google\Cloud\AlloyDb\V1\Instance_QueryInsightsInstanceConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php new file mode 100644 index 000000000000..87145209ae94 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1.Instance.ReadPoolConfig + */ +class ReadPoolConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $node_count + * Read capacity, i.e. number of nodes in a read pool instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + * @return int + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + * @param int $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt32($var); + $this->node_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReadPoolConfig::class, \Google\Cloud\AlloyDb\V1\Instance_ReadPoolConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php new file mode 100644 index 000000000000..5caa9e194e76 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php @@ -0,0 +1,112 @@ +google.cloud.alloydb.v1.Instance.State + */ +class State +{ + /** + * The state of the instance is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The instance is active and running. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The instance is stopped. Instance name and IP resources are preserved. + * + * Generated from protobuf enum STOPPED = 2; + */ + const STOPPED = 2; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 3; + */ + const CREATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The instance is down for maintenance. + * + * Generated from protobuf enum MAINTENANCE = 5; + */ + const MAINTENANCE = 5; + /** + * The creation of the instance failed or a fatal error occurred during + * an operation on the instance. + * Note: Instances in this state would tried to be auto-repaired. And + * Customers should be able to restart, update or delete these instances. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that + * index unused in case that state also needs to exposed via consumer apis + * in future. + * The instance has been configured to sync data from some other source. + * + * Generated from protobuf enum BOOTSTRAPPING = 8; + */ + const BOOTSTRAPPING = 8; + /** + * The instance is being promoted. + * + * Generated from protobuf enum PROMOTING = 9; + */ + const PROMOTING = 9; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::STOPPED => 'STOPPED', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::MAINTENANCE => 'MAINTENANCE', + self::FAILED => 'FAILED', + self::BOOTSTRAPPING => 'BOOTSTRAPPING', + self::PROMOTING => 'PROMOTING', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1\Instance_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php new file mode 100644 index 000000000000..fca8fc5f03aa --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1.InstanceView + */ +class InstanceView +{ + /** + * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + * + * Generated from protobuf enum INSTANCE_VIEW_UNSPECIFIED = 0; + */ + const INSTANCE_VIEW_UNSPECIFIED = 0; + /** + * BASIC server responses for a primary or read instance include all the + * relevant instance details, excluding the details of each node in the + * instance. The default value. + * + * Generated from protobuf enum INSTANCE_VIEW_BASIC = 1; + */ + const INSTANCE_VIEW_BASIC = 1; + /** + * FULL response is equivalent to BASIC for primary instance (for now). + * For read pool instance, this includes details of each node in the pool. + * + * Generated from protobuf enum INSTANCE_VIEW_FULL = 2; + */ + const INSTANCE_VIEW_FULL = 2; + + private static $valueToName = [ + self::INSTANCE_VIEW_UNSPECIFIED => 'INSTANCE_VIEW_UNSPECIFIED', + self::INSTANCE_VIEW_BASIC => 'INSTANCE_VIEW_BASIC', + self::INSTANCE_VIEW_FULL => 'INSTANCE_VIEW_FULL', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php new file mode 100644 index 000000000000..b1de4aa3797f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php @@ -0,0 +1,221 @@ +google.cloud.alloydb.v1.ListBackupsRequest + */ +class ListBackupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListBackupsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListBackupsRequest + * Please see {@see AlloyDBAdminClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\ListBackupsRequest + * + * @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. Parent value for ListBackupsRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListBackupsRequest + * + * 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. Parent value for ListBackupsRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php new file mode 100644 index 000000000000..0b0021d014b6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1.ListBackupsResponse + */ +class ListBackupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Backup backups = 1; + */ + private $backups; + /** + * 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\AlloyDb\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $backups + * The list of Backup + * @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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Backup backups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackups() + { + return $this->backups; + } + + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Backup backups = 1; + * @param array<\Google\Cloud\AlloyDb\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Backup::class); + $this->backups = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php new file mode 100644 index 000000000000..d44fb3bfbc6f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php @@ -0,0 +1,236 @@ +google.cloud.alloydb.v1.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * Please see {@see AlloyDBAdminClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\ListClustersRequest + * + * @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 name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * @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 + * 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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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 name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php new file mode 100644 index 000000000000..8c9c3ba6454c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + */ + private $clusters; + /** + * 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\AlloyDb\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters + * The list of Cluster + * @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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Cluster clusters = 1; + * @param array<\Google\Cloud\AlloyDb\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Cluster::class); + $this->clusters = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php new file mode 100644 index 000000000000..4d82e38e6398 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php @@ -0,0 +1,246 @@ +google.cloud.alloydb.v1.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\ListInstancesRequest + * + * @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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * @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 + * 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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php new file mode 100644 index 000000000000..2b869c67528b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; + */ + private $instances; + /** + * 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\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of Instance + * @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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; + * @param array<\Google\Cloud\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Instance::class); + $this->instances = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php new file mode 100644 index 000000000000..ad53e79fae82 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php @@ -0,0 +1,179 @@ +google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + */ +class ListSupportedDatabaseFlagsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. Please see + * {@see AlloyDBAdminClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\ListSupportedDatabaseFlagsRequest + * + * @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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * 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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php new file mode 100644 index 000000000000..8a74ded00784 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php @@ -0,0 +1,101 @@ +google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + */ +class ListSupportedDatabaseFlagsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + */ + private $supported_database_flags; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $supported_database_flags + * The list of SupportedDatabaseFlags. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedDatabaseFlags() + { + return $this->supported_database_flags; + } + + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; + * @param array<\Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedDatabaseFlags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag::class); + $this->supported_database_flags = $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; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php new file mode 100644 index 000000000000..209f6034b237 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php @@ -0,0 +1,221 @@ +google.cloud.alloydb.v1.ListUsersRequest + */ +class ListUsersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListUsersRequest + * + * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListUsersRequest + * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\ListUsersRequest + * + * @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. Parent value for ListUsersRequest + * @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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListUsersRequest + * + * 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. Parent value for ListUsersRequest + * + * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php new file mode 100644 index 000000000000..54dd827d69ab --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1.ListUsersResponse + */ +class ListUsersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.User users = 1; + */ + private $users; + /** + * 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\AlloyDb\V1\User>|\Google\Protobuf\Internal\RepeatedField $users + * The list of User + * @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\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.User users = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsers() + { + return $this->users; + } + + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.User users = 1; + * @param array<\Google\Cloud\AlloyDb\V1\User>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\User::class); + $this->users = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php new file mode 100644 index 000000000000..d0af051a9d3b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php @@ -0,0 +1,144 @@ +google.cloud.alloydb.v1.MigrationSource + */ +class MigrationSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $host_port = ''; + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reference_id = ''; + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_port + * Output only. The host and port of the on-premises instance in host:port + * format + * @type string $reference_id + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * @type int $source_type + * Output only. Type of migration source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getHostPort() + { + return $this->host_port; + } + + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setHostPort($var) + { + GPBUtil::checkString($var, True); + $this->host_port = $var; + + return $this; + } + + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReferenceId() + { + return $this->reference_id; + } + + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReferenceId($var) + { + GPBUtil::checkString($var, True); + $this->reference_id = $var; + + return $this; + } + + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\MigrationSource\MigrationSourceType::class); + $this->source_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php new file mode 100644 index 000000000000..6cdf7fc32846 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php @@ -0,0 +1,57 @@ +google.cloud.alloydb.v1.MigrationSource.MigrationSourceType + */ +class MigrationSourceType +{ + /** + * Migration source is unknown. + * + * Generated from protobuf enum MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + const MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + /** + * DMS source means the cluster was created via DMS migration job. + * + * Generated from protobuf enum DMS = 1; + */ + const DMS = 1; + + private static $valueToName = [ + self::MIGRATION_SOURCE_TYPE_UNSPECIFIED => 'MIGRATION_SOURCE_TYPE_UNSPECIFIED', + self::DMS => 'DMS', + ]; + + 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(MigrationSourceType::class, \Google\Cloud\AlloyDb\V1\MigrationSource_MigrationSourceType::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php new file mode 100644 index 000000000000..ab26ecdaeac8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php @@ -0,0 +1,349 @@ +google.cloud.alloydb.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 = ''; + protected $request_specific; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata $batch_create_instances_metadata + * Output only. BatchCreateInstances related metadata. + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Output only. BatchCreateInstances related metadata. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata|null + */ + public function getBatchCreateInstancesMetadata() + { + return $this->readOneof(8); + } + + public function hasBatchCreateInstancesMetadata() + { + return $this->hasOneof(8); + } + + /** + * Output only. BatchCreateInstances related metadata. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata $var + * @return $this + */ + public function setBatchCreateInstancesMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * 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; + } + + /** + * @return string + */ + public function getRequestSpecific() + { + return $this->whichOneof("request_specific"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php new file mode 100644 index 000000000000..94a00b7fb9d8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php @@ -0,0 +1,240 @@ +google.cloud.alloydb.v1.PromoteClusterRequest + */ +class PromoteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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 = ''; + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\PromoteClusterRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php new file mode 100644 index 000000000000..d1c80af90179 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.alloydb.v1.RestartInstanceRequest + */ +class RestartInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\RestartInstanceRequest + * + * @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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php new file mode 100644 index 000000000000..ce7a85bdb5ed --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php @@ -0,0 +1,344 @@ +google.cloud.alloydb.v1.RestoreClusterRequest + */ +class RestoreClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1\BackupSource $backup_source + * Backup source. + * @type \Google\Cloud\AlloyDb\V1\ContinuousBackupSource $continuous_backup_source + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Backup source. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * @return \Google\Cloud\AlloyDb\V1\BackupSource|null + */ + public function getBackupSource() + { + return $this->readOneof(4); + } + + public function hasBackupSource() + { + return $this->hasOneof(4); + } + + /** + * Backup source. + * + * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 4; + * @param \Google\Cloud\AlloyDb\V1\BackupSource $var + * @return $this + */ + public function setBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\BackupSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * @return \Google\Cloud\AlloyDb\V1\ContinuousBackupSource|null + */ + public function getContinuousBackupSource() + { + return $this->readOneof(8); + } + + public function hasContinuousBackupSource() + { + return $this->hasOneof(8); + } + + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * @param \Google\Cloud\AlloyDb\V1\ContinuousBackupSource $var + * @return $this + */ + public function setContinuousBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\ContinuousBackupSource::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); + $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php new file mode 100644 index 000000000000..4239158510f8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1.SslConfig + */ +class SslConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_mode = 0; + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ca_source = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $ssl_mode + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * @type int $ca_source + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSslMode() + { + return $this->ssl_mode; + } + + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSslMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\SslConfig\SslMode::class); + $this->ssl_mode = $var; + + return $this; + } + + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCaSource() + { + return $this->ca_source; + } + + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCaSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\SslConfig\CaSource::class); + $this->ca_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php new file mode 100644 index 000000000000..63623e55baed --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php @@ -0,0 +1,58 @@ +google.cloud.alloydb.v1.SslConfig.CaSource + */ +class CaSource +{ + /** + * Certificate Authority (CA) source not specified. Defaults to + * CA_SOURCE_MANAGED. + * + * Generated from protobuf enum CA_SOURCE_UNSPECIFIED = 0; + */ + const CA_SOURCE_UNSPECIFIED = 0; + /** + * Certificate Authority (CA) managed by the AlloyDB Cluster. + * + * Generated from protobuf enum CA_SOURCE_MANAGED = 1; + */ + const CA_SOURCE_MANAGED = 1; + + private static $valueToName = [ + self::CA_SOURCE_UNSPECIFIED => 'CA_SOURCE_UNSPECIFIED', + self::CA_SOURCE_MANAGED => 'CA_SOURCE_MANAGED', + ]; + + 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(CaSource::class, \Google\Cloud\AlloyDb\V1\SslConfig_CaSource::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php new file mode 100644 index 000000000000..9d823b215f44 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php @@ -0,0 +1,89 @@ +google.cloud.alloydb.v1.SslConfig.SslMode + */ +class SslMode +{ + /** + * SSL mode not specified. Defaults to ENCRYPTED_ONLY. + * + * Generated from protobuf enum SSL_MODE_UNSPECIFIED = 0; + */ + const SSL_MODE_UNSPECIFIED = 0; + /** + * SSL connections are optional. CA verification not enforced. + * + * Generated from protobuf enum SSL_MODE_ALLOW = 1 [deprecated = true]; + */ + const SSL_MODE_ALLOW = 1; + /** + * SSL connections are required. CA verification not enforced. + * Clients may use locally self-signed certificates (default psql client + * behavior). + * + * Generated from protobuf enum SSL_MODE_REQUIRE = 2 [deprecated = true]; + */ + const SSL_MODE_REQUIRE = 2; + /** + * SSL connections are required. CA verification enforced. + * Clients must have certificates signed by a Cluster CA, e.g. via + * GenerateClientCertificate. + * + * Generated from protobuf enum SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + */ + const SSL_MODE_VERIFY_CA = 3; + /** + * SSL connections are optional. CA verification not enforced. + * + * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + /** + * SSL connections are required. CA verification not enforced. + * + * Generated from protobuf enum ENCRYPTED_ONLY = 5; + */ + const ENCRYPTED_ONLY = 5; + + private static $valueToName = [ + self::SSL_MODE_UNSPECIFIED => 'SSL_MODE_UNSPECIFIED', + self::SSL_MODE_ALLOW => 'SSL_MODE_ALLOW', + self::SSL_MODE_REQUIRE => 'SSL_MODE_REQUIRE', + self::SSL_MODE_VERIFY_CA => 'SSL_MODE_VERIFY_CA', + self::ALLOW_UNENCRYPTED_AND_ENCRYPTED => 'ALLOW_UNENCRYPTED_AND_ENCRYPTED', + self::ENCRYPTED_ONLY => 'ENCRYPTED_ONLY', + ]; + + 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(SslMode::class, \Google\Cloud\AlloyDb\V1\SslConfig_SslMode::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php new file mode 100644 index 000000000000..09d7ae652977 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php @@ -0,0 +1,337 @@ +google.cloud.alloydb.v1.SupportedDatabaseFlag + */ +class SupportedDatabaseFlag extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + */ + protected $flag_name = ''; + /** + * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + */ + protected $value_type = 0; + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + */ + protected $accepts_multiple_values = false; + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + */ + private $supported_db_versions; + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + */ + protected $requires_db_restart = false; + protected $restrictions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions $string_restrictions + * Restriction on STRING type value. + * @type \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions $integer_restrictions + * Restriction on INTEGER type value. + * @type string $name + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * @type string $flag_name + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * @type int $value_type + * @type bool $accepts_multiple_values + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_db_versions + * Major database engine versions for which this flag is supported. + * @type bool $requires_db_restart + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Restriction on STRING type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * @return \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions|null + */ + public function getStringRestrictions() + { + return $this->readOneof(7); + } + + public function hasStringRestrictions() + { + return $this->hasOneof(7); + } + + /** + * Restriction on STRING type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * @param \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions $var + * @return $this + */ + public function setStringRestrictions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Restriction on INTEGER type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * @return \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions|null + */ + public function getIntegerRestrictions() + { + return $this->readOneof(8); + } + + public function hasIntegerRestrictions() + { + return $this->hasOneof(8); + } + + /** + * Restriction on INTEGER type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * @param \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions $var + * @return $this + */ + public function setIntegerRestrictions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + * @return string + */ + public function getFlagName() + { + return $this->flag_name; + } + + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + * @param string $var + * @return $this + */ + public function setFlagName($var) + { + GPBUtil::checkString($var, True); + $this->flag_name = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + * @return bool + */ + public function getAcceptsMultipleValues() + { + return $this->accepts_multiple_values; + } + + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + * @param bool $var + * @return $this + */ + public function setAcceptsMultipleValues($var) + { + GPBUtil::checkBool($var); + $this->accepts_multiple_values = $var; + + return $this; + } + + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedDbVersions() + { + return $this->supported_db_versions; + } + + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedDbVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AlloyDb\V1\DatabaseVersion::class); + $this->supported_db_versions = $arr; + + return $this; + } + + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + * @return bool + */ + public function getRequiresDbRestart() + { + return $this->requires_db_restart; + } + + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + * @param bool $var + * @return $this + */ + public function setRequiresDbRestart($var) + { + GPBUtil::checkBool($var); + $this->requires_db_restart = $var; + + return $this; + } + + /** + * @return string + */ + public function getRestrictions() + { + return $this->whichOneof("restrictions"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php new file mode 100644 index 000000000000..ef0b863c1db2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php @@ -0,0 +1,178 @@ +google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + */ +class IntegerRestrictions extends \Google\Protobuf\Internal\Message +{ + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + */ + protected $min_value = null; + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + */ + protected $max_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int64Value $min_value + * The minimum value that can be specified, if applicable. + * @type \Google\Protobuf\Int64Value $max_value + * The maximum value that can be specified, if applicable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMinValue() + { + return $this->min_value; + } + + public function hasMinValue() + { + return isset($this->min_value); + } + + public function clearMinValue() + { + unset($this->min_value); + } + + /** + * Returns the unboxed value from getMinValue() + + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @return int|string|null + */ + public function getMinValueUnwrapped() + { + return $this->readWrapperValue("min_value"); + } + + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMinValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->min_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @param int|string|null $var + * @return $this + */ + public function setMinValueUnwrapped($var) + { + $this->writeWrapperValue("min_value", $var); + return $this;} + + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMaxValue() + { + return $this->max_value; + } + + public function hasMaxValue() + { + return isset($this->max_value); + } + + public function clearMaxValue() + { + unset($this->max_value); + } + + /** + * Returns the unboxed value from getMaxValue() + + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @return int|string|null + */ + public function getMaxValueUnwrapped() + { + return $this->readWrapperValue("max_value"); + } + + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMaxValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->max_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @param int|string|null $var + * @return $this + */ + public function setMaxValueUnwrapped($var) + { + $this->writeWrapperValue("max_value", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IntegerRestrictions::class, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag_IntegerRestrictions::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php new file mode 100644 index 000000000000..9dbd0cda5621 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php @@ -0,0 +1,74 @@ +google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + */ +class StringRestrictions extends \Google\Protobuf\Internal\Message +{ + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + */ + private $allowed_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedValues() + { + return $this->allowed_values; + } + + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StringRestrictions::class, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag_StringRestrictions::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php new file mode 100644 index 000000000000..1e2a2f071183 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php @@ -0,0 +1,80 @@ +google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType + */ +class ValueType +{ + /** + * This is an unknown flag type. + * + * Generated from protobuf enum VALUE_TYPE_UNSPECIFIED = 0; + */ + const VALUE_TYPE_UNSPECIFIED = 0; + /** + * String type flag. + * + * Generated from protobuf enum STRING = 1; + */ + const STRING = 1; + /** + * Integer type flag. + * + * Generated from protobuf enum INTEGER = 2; + */ + const INTEGER = 2; + /** + * Float type flag. + * + * Generated from protobuf enum FLOAT = 3; + */ + const FLOAT = 3; + /** + * Denotes that the flag does not accept any values. + * + * Generated from protobuf enum NONE = 4; + */ + const NONE = 4; + + private static $valueToName = [ + self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', + self::STRING => 'STRING', + self::INTEGER => 'INTEGER', + self::FLOAT => 'FLOAT', + self::NONE => 'NONE', + ]; + + 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(ValueType::class, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag_ValueType::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php new file mode 100644 index 000000000000..4925904e8fd7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php @@ -0,0 +1,306 @@ +google.cloud.alloydb.v1.UpdateBackupRequest + */ +class UpdateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\AlloyDb\V1\Backup $backup Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\AlloyDb\V1\UpdateBackupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AlloyDb\V1\Backup $backup, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBackup($backup) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1\Backup $backup + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Backup::class); + $this->backup = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php new file mode 100644 index 000000000000..2727a2df5cd9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php @@ -0,0 +1,310 @@ +google.cloud.alloydb.v1.UpdateClusterRequest + */ +class UpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\AlloyDb\V1\Cluster $cluster Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\AlloyDb\V1\UpdateClusterRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AlloyDb\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); + $this->cluster = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php new file mode 100644 index 000000000000..45b774ddbd49 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php @@ -0,0 +1,310 @@ +google.cloud.alloydb.v1.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\AlloyDb\V1\Instance $instance Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\AlloyDb\V1\UpdateInstanceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AlloyDb\V1\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1\Instance $instance + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance::class); + $this->instance = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php new file mode 100644 index 000000000000..0afb7647923a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php @@ -0,0 +1,302 @@ +google.cloud.alloydb.v1.UpdateUserRequest + */ +class UpdateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\AlloyDb\V1\User $user Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\AlloyDb\V1\UpdateUserRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AlloyDb\V1\User $user, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setUser($user) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1\User $user + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allow_missing + * Optional. Allow missing fields in the update mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\User::class); + $this->user = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php new file mode 100644 index 000000000000..5936d629c1da --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php @@ -0,0 +1,177 @@ +google.cloud.alloydb.v1.User + */ +class User extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $password = ''; + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $database_roles; + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * @type string $password + * Input only. Password for the user. + * @type array|\Google\Protobuf\Internal\RepeatedField $database_roles + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * @type int $user_type + * Optional. Type of this user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatabaseRoles() + { + return $this->database_roles; + } + + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatabaseRoles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->database_roles = $arr; + + return $this; + } + + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getUserType() + { + return $this->user_type; + } + + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setUserType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\User\UserType::class); + $this->user_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php new file mode 100644 index 000000000000..8324887d69cf --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1.User.UserType + */ +class UserType +{ + /** + * Unspecified user type. + * + * Generated from protobuf enum USER_TYPE_UNSPECIFIED = 0; + */ + const USER_TYPE_UNSPECIFIED = 0; + /** + * The default user type that authenticates via password-based + * authentication. + * + * Generated from protobuf enum ALLOYDB_BUILT_IN = 1; + */ + const ALLOYDB_BUILT_IN = 1; + /** + * Database user that can authenticate via IAM-Based authentication. + * + * Generated from protobuf enum ALLOYDB_IAM_USER = 2; + */ + const ALLOYDB_IAM_USER = 2; + + private static $valueToName = [ + self::USER_TYPE_UNSPECIFIED => 'USER_TYPE_UNSPECIFIED', + self::ALLOYDB_BUILT_IN => 'ALLOYDB_BUILT_IN', + self::ALLOYDB_IAM_USER => 'ALLOYDB_IAM_USER', + ]; + + 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(UserType::class, \Google\Cloud\AlloyDb\V1\User_UserType::class); + diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php new file mode 100644 index 000000000000..6f1de9b58940 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php @@ -0,0 +1,102 @@ +google.cloud.alloydb.v1.UserPassword + */ +class UserPassword extends \Google\Protobuf\Internal\Message +{ + /** + * The database username. + * + * Generated from protobuf field string user = 1; + */ + protected $user = ''; + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + */ + protected $password = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $user + * The database username. + * @type string $password + * The initial password for the user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The database username. + * + * Generated from protobuf field string user = 1; + * @return string + */ + public function getUser() + { + return $this->user; + } + + /** + * The database username. + * + * Generated from protobuf field string user = 1; + * @param string $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkString($var, True); + $this->user = $var; + + return $this; + } + + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php new file mode 100644 index 000000000000..e16eba8aa0f5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php @@ -0,0 +1,127 @@ +setInstanceType($requestsCreateInstanceRequestsInstanceInstanceType); + $createInstanceRequest = (new CreateInstanceRequest()) + ->setParent($formattedRequestsCreateInstanceRequestsParent) + ->setInstanceId($requestsCreateInstanceRequestsInstanceId) + ->setInstance($requestsCreateInstanceRequestsInstance); + $requestsCreateInstanceRequests = [$createInstanceRequest,]; + $requests = (new CreateInstanceRequests()) + ->setCreateInstanceRequests($requestsCreateInstanceRequests); + $request = (new BatchCreateInstancesRequest()) + ->setParent($formattedParent) + ->setRequests($requests); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->batchCreateInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchCreateInstancesResponse $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $formattedRequestsCreateInstanceRequestsParent = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + $requestsCreateInstanceRequestsInstanceId = '[INSTANCE_ID]'; + $requestsCreateInstanceRequestsInstanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + batch_create_instances_sample( + $formattedParent, + $formattedRequestsCreateInstanceRequestsParent, + $requestsCreateInstanceRequestsInstanceId, + $requestsCreateInstanceRequestsInstanceInstanceType + ); +} +// [END alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php new file mode 100644 index 000000000000..d8d4e288615f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php @@ -0,0 +1,100 @@ +setClusterName($formattedBackupClusterName); + $request = (new CreateBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setBackup($backup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $backupId = '[BACKUP_ID]'; + $formattedBackupClusterName = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + create_backup_sample($formattedParent, $backupId, $formattedBackupClusterName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php new file mode 100644 index 000000000000..428b9bdd7ecd --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php @@ -0,0 +1,100 @@ +setNetwork($formattedClusterNetwork); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + create_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php new file mode 100644 index 000000000000..6b44ed18b72b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php @@ -0,0 +1,96 @@ +setInstanceType($instanceInstanceType); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = '[INSTANCE_ID]'; + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + create_instance_sample($formattedParent, $instanceId, $instanceInstanceType); +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php new file mode 100644 index 000000000000..e832e93faf37 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php @@ -0,0 +1,101 @@ +setNetwork($formattedClusterNetwork); + $request = (new CreateSecondaryClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createSecondaryCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + create_secondary_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php new file mode 100644 index 000000000000..cade42bfca4c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php @@ -0,0 +1,96 @@ +setInstanceType($instanceInstanceType); + $request = (new CreateSecondaryInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createSecondaryInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = '[INSTANCE_ID]'; + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + create_secondary_instance_sample($formattedParent, $instanceId, $instanceInstanceType); +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php new file mode 100644 index 000000000000..6f7318acd711 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php @@ -0,0 +1,76 @@ +setParent($formattedParent) + ->setUserId($userId) + ->setUser($user); + + // Call the API and handle any network failures. + try { + /** @var User $response */ + $response = $alloyDBAdminClient->createUser($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 +{ + $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = '[USER_ID]'; + + create_user_sample($formattedParent, $userId); +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php new file mode 100644 index 000000000000..e231bc91b361 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->deleteBackup($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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + delete_backup_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php new file mode 100644 index 000000000000..3a46a394444f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->deleteCluster($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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php new file mode 100644 index 000000000000..48b2adc65263 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->deleteInstance($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 = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + delete_instance_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php new file mode 100644 index 000000000000..a56239eb05a8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php @@ -0,0 +1,70 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $alloyDBAdminClient->deleteUser($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + + delete_user_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php new file mode 100644 index 000000000000..0671f3936786 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php @@ -0,0 +1,91 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->failoverInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + failover_instance_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php new file mode 100644 index 000000000000..f47bf4fe971e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var GenerateClientCertificateResponse $response */ + $response = $alloyDBAdminClient->generateClientCertificate($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 +{ + $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + generate_client_certificate_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php new file mode 100644 index 000000000000..d636d3919a73 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Backup $response */ + $response = $alloyDBAdminClient->getBackup($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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + get_backup_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php new file mode 100644 index 000000000000..85a23f11f396 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Cluster $response */ + $response = $alloyDBAdminClient->getCluster($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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php new file mode 100644 index 000000000000..050f420eeb47 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ConnectionInfo $response */ + $response = $alloyDBAdminClient->getConnectionInfo($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 +{ + $formattedParent = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + get_connection_info_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php new file mode 100644 index 000000000000..2143841275c0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $alloyDBAdminClient->getInstance($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 = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + get_instance_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_location.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_location.php new file mode 100644 index 000000000000..0068e9fe716c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php new file mode 100644 index 000000000000..15ea2837fd55 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var User $response */ + $response = $alloyDBAdminClient->getUser($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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + + get_user_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php new file mode 100644 index 000000000000..c93847e544b3 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php @@ -0,0 +1,94 @@ +setFaultType($faultType) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->injectFault($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + inject_fault_sample($faultType, $formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php new file mode 100644 index 000000000000..6e4c0b653caa --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alloyDBAdminClient->listBackups($request); + + /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backups_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php new file mode 100644 index 000000000000..76f1afa64f1b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alloyDBAdminClient->listClusters($request); + + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_clusters_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php new file mode 100644 index 000000000000..ab1b61c782cb --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alloyDBAdminClient->listInstances($request); + + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_instances_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_locations.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_locations.php new file mode 100644 index 000000000000..d37fe484e341 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_locations.php @@ -0,0 +1,62 @@ +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 alloydb_v1_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php new file mode 100644 index 000000000000..6765773e4824 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alloyDBAdminClient->listSupportedDatabaseFlags($request); + + /** @var SupportedDatabaseFlag $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_supported_database_flags_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php new file mode 100644 index 000000000000..db5784fcae9e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alloyDBAdminClient->listUsers($request); + + /** @var User $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_users_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php new file mode 100644 index 000000000000..1db2d064b5c6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->promoteCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 +{ + $formattedName = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + promote_cluster_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php new file mode 100644 index 000000000000..ff39eb5bf7c7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->restartInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + restart_instance_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php new file mode 100644 index 000000000000..7517809adc5c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php @@ -0,0 +1,102 @@ +setNetwork($formattedClusterNetwork); + $request = (new RestoreClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->restoreCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + restore_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php new file mode 100644 index 000000000000..41bd5abd7f5f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php @@ -0,0 +1,90 @@ +setClusterName($formattedBackupClusterName); + $request = (new UpdateBackupRequest()) + ->setBackup($backup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $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 +{ + $formattedBackupClusterName = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + update_backup_sample($formattedBackupClusterName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php new file mode 100644 index 000000000000..58655649630f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php @@ -0,0 +1,89 @@ +setNetwork($formattedClusterNetwork); + $request = (new UpdateClusterRequest()) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 +{ + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + update_cluster_sample($formattedClusterNetwork); +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php new file mode 100644 index 000000000000..ddd12709471e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php @@ -0,0 +1,85 @@ +setInstanceType($instanceInstanceType); + $request = (new UpdateInstanceRequest()) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + update_instance_sample($instanceInstanceType); +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php new file mode 100644 index 000000000000..91f5435d8fc2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php @@ -0,0 +1,59 @@ +setUser($user); + + // Call the API and handle any network failures. + try { + /** @var User $response */ + $response = $alloyDBAdminClient->updateUser($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php b/owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php new file mode 100644 index 000000000000..46b275bf3d44 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php @@ -0,0 +1,34 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_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; + } + + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backup + * + * @return string The formatted backup resource. + */ + public static function backupName(string $project, string $location, string $backup): string + { + return self::getPathTemplate('backup')->render([ + 'project' => $project, + 'location' => $location, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + */ + public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string + { + return self::getPathTemplate('cryptoKeyVersion')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $location, string $cluster, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'instance' => $instance, + ]); + } + + /** + * 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 network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a user + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $user + * + * @return string The formatted user resource. + */ + public static function userName(string $project, string $location, string $cluster, string $user): string + { + return self::getPathTemplate('user')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'user' => $user, + ]); + } + + /** + * 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}/backups/{backup} + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} + * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} + * + * 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 'alloydb.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); + } + + /** + * Creates new instances under the given project, location and cluster. + * There can be only one primary instance in a cluster. If the primary + * instance exists in the cluster as well as this request, then API will + * throw an error. + * The primary instance should exist before any read pool instance is + * created. If the primary instance is a part of the request payload, then + * the API will take care of creating instances in the correct order. + * This method is here to support Google-internal use cases, and is not meant + * for external customers to consume. Please do not start relying on it; its + * behavior is subject to change without notice. + * + * The async variant is {@see AlloyDBAdminClient::batchCreateInstancesAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/batch_create_instances.php + * + * @param BatchCreateInstancesRequest $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 batchCreateInstances(BatchCreateInstancesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchCreateInstances', $request, $callOptions)->wait(); + } + + /** + * Creates a new Backup in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::createBackupAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/create_backup.php + * + * @param CreateBackupRequest $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 createBackup(CreateBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackup', $request, $callOptions)->wait(); + } + + /** + * Creates a new Cluster in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::createClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/create_cluster.php + * + * @param CreateClusterRequest $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 createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); + } + + /** + * Creates a new Instance in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::createInstanceAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/create_instance.php + * + * @param CreateInstanceRequest $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 createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); + } + + /** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * The async variant is {@see AlloyDBAdminClient::createSecondaryClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/create_secondary_cluster.php + * + * @param CreateSecondaryClusterRequest $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 createSecondaryCluster(CreateSecondaryClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSecondaryCluster', $request, $callOptions)->wait(); + } + + /** + * Creates a new SECONDARY Instance in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::createSecondaryInstanceAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/create_secondary_instance.php + * + * @param CreateSecondaryInstanceRequest $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 createSecondaryInstance(CreateSecondaryInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSecondaryInstance', $request, $callOptions)->wait(); + } + + /** + * Creates a new User in a given project, location, and cluster. + * + * The async variant is {@see AlloyDBAdminClient::createUserAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/create_user.php + * + * @param CreateUserRequest $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 User + * + * @throws ApiException Thrown if the API call fails. + */ + public function createUser(CreateUserRequest $request, array $callOptions = []): User + { + return $this->startApiCall('CreateUser', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Backup. + * + * The async variant is {@see AlloyDBAdminClient::deleteBackupAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/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 Cluster. + * + * The async variant is {@see AlloyDBAdminClient::deleteClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/delete_cluster.php + * + * @param DeleteClusterRequest $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 deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Instance. + * + * The async variant is {@see AlloyDBAdminClient::deleteInstanceAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/delete_instance.php + * + * @param DeleteInstanceRequest $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 deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); + } + + /** + * Deletes a single User. + * + * The async variant is {@see AlloyDBAdminClient::deleteUserAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/delete_user.php + * + * @param DeleteUserRequest $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. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteUser(DeleteUserRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteUser', $request, $callOptions)->wait(); + } + + /** + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. + * + * The async variant is {@see AlloyDBAdminClient::failoverInstanceAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/failover_instance.php + * + * @param FailoverInstanceRequest $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 failoverInstance(FailoverInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('FailoverInstance', $request, $callOptions)->wait(); + } + + /** + * Generate a client certificate signed by a Cluster CA. + * The sole purpose of this endpoint is to support AlloyDB connectors and the + * Auth Proxy client. The endpoint's behavior is subject to change without + * notice, so do not rely on its behavior remaining constant. Future changes + * will not break AlloyDB connectors or the Auth Proxy client. + * + * The async variant is {@see AlloyDBAdminClient::generateClientCertificateAsync()} + * . + * + * @example samples/V1/AlloyDBAdminClient/generate_client_certificate.php + * + * @param GenerateClientCertificateRequest $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 GenerateClientCertificateResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateClientCertificate(GenerateClientCertificateRequest $request, array $callOptions = []): GenerateClientCertificateResponse + { + return $this->startApiCall('GenerateClientCertificate', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Backup. + * + * The async variant is {@see AlloyDBAdminClient::getBackupAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/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 Cluster. + * + * The async variant is {@see AlloyDBAdminClient::getClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/get_cluster.php + * + * @param GetClusterRequest $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 Cluster + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster + { + return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); + } + + /** + * Get instance metadata used for a connection. + * + * The async variant is {@see AlloyDBAdminClient::getConnectionInfoAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/get_connection_info.php + * + * @param GetConnectionInfoRequest $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 ConnectionInfo + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConnectionInfo(GetConnectionInfoRequest $request, array $callOptions = []): ConnectionInfo + { + return $this->startApiCall('GetConnectionInfo', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Instance. + * + * The async variant is {@see AlloyDBAdminClient::getInstanceAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/get_instance.php + * + * @param GetInstanceRequest $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 Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single User. + * + * The async variant is {@see AlloyDBAdminClient::getUserAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/get_user.php + * + * @param GetUserRequest $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 User + * + * @throws ApiException Thrown if the API call fails. + */ + public function getUser(GetUserRequest $request, array $callOptions = []): User + { + return $this->startApiCall('GetUser', $request, $callOptions)->wait(); + } + + /** + * Injects fault in an instance. + * Imperative only. + * + * The async variant is {@see AlloyDBAdminClient::injectFaultAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/inject_fault.php + * + * @param InjectFaultRequest $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 injectFault(InjectFaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('InjectFault', $request, $callOptions)->wait(); + } + + /** + * Lists Backups in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::listBackupsAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/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 Clusters in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::listClustersAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/list_clusters.php + * + * @param ListClustersRequest $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 listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListClusters', $request, $callOptions); + } + + /** + * Lists Instances in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::listInstancesAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/list_instances.php + * + * @param ListInstancesRequest $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 listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + * The async variant is + * {@see AlloyDBAdminClient::listSupportedDatabaseFlagsAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/list_supported_database_flags.php + * + * @param ListSupportedDatabaseFlagsRequest $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 listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSupportedDatabaseFlags', $request, $callOptions); + } + + /** + * Lists Users in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::listUsersAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/list_users.php + * + * @param ListUsersRequest $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 listUsers(ListUsersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUsers', $request, $callOptions); + } + + /** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * The async variant is {@see AlloyDBAdminClient::promoteClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/promote_cluster.php + * + * @param PromoteClusterRequest $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 promoteCluster(PromoteClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PromoteCluster', $request, $callOptions)->wait(); + } + + /** + * Restart an Instance in a cluster. + * Imperative only. + * + * The async variant is {@see AlloyDBAdminClient::restartInstanceAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/restart_instance.php + * + * @param RestartInstanceRequest $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 restartInstance(RestartInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestartInstance', $request, $callOptions)->wait(); + } + + /** + * Creates a new Cluster in a given project and location, with a volume + * restored from the provided source, either a backup ID or a point-in-time + * and a source cluster. + * + * The async variant is {@see AlloyDBAdminClient::restoreClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/restore_cluster.php + * + * @param RestoreClusterRequest $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 restoreCluster(RestoreClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreCluster', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single Backup. + * + * The async variant is {@see AlloyDBAdminClient::updateBackupAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/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 parameters of a single Cluster. + * + * The async variant is {@see AlloyDBAdminClient::updateClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/update_cluster.php + * + * @param UpdateClusterRequest $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 updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single Instance. + * + * The async variant is {@see AlloyDBAdminClient::updateInstanceAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/update_instance.php + * + * @param UpdateInstanceRequest $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 updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single User. + * + * The async variant is {@see AlloyDBAdminClient::updateUserAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/update_user.php + * + * @param UpdateUserRequest $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 User + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateUser(UpdateUserRequest $request, array $callOptions = []): User + { + return $this->startApiCall('UpdateUser', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AlloyDBAdminClient::getLocationAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/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 AlloyDBAdminClient::listLocationsAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/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); + } +} diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php b/owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php new file mode 100644 index 000000000000..5c6d79e8ea6b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php @@ -0,0 +1,3291 @@ +clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $requests = new CreateInstanceRequests(); + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\AlloyDb\V1\Client\AlloyDBAdminClient} to use the new surface. + */ +class AlloyDBAdminGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.alloydb.v1.AlloyDBAdmin'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'alloydb.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $backupNameTemplate; + + private static $clusterNameTemplate; + + private static $cryptoKeyVersionNameTemplate; + + private static $instanceNameTemplate; + + private static $locationNameTemplate; + + private static $networkNameTemplate; + + private static $userNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_rest_client_config.php', + ], + ], + ]; + } + + private static function getBackupNameTemplate() + { + if (self::$backupNameTemplate == null) { + self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); + } + + return self::$backupNameTemplate; + } + + private static function getClusterNameTemplate() + { + if (self::$clusterNameTemplate == null) { + self::$clusterNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}'); + } + + return self::$clusterNameTemplate; + } + + private static function getCryptoKeyVersionNameTemplate() + { + if (self::$cryptoKeyVersionNameTemplate == null) { + self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); + } + + return self::$cryptoKeyVersionNameTemplate; + } + + private static function getInstanceNameTemplate() + { + if (self::$instanceNameTemplate == null) { + self::$instanceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}'); + } + + return self::$instanceNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getNetworkNameTemplate() + { + if (self::$networkNameTemplate == null) { + self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); + } + + return self::$networkNameTemplate; + } + + private static function getUserNameTemplate() + { + if (self::$userNameTemplate == null) { + self::$userNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/users/{user}'); + } + + return self::$userNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'backup' => self::getBackupNameTemplate(), + 'cluster' => self::getClusterNameTemplate(), + 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), + 'instance' => self::getInstanceNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'network' => self::getNetworkNameTemplate(), + 'user' => self::getUserNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backup + * + * @return string The formatted backup resource. + */ + public static function backupName($project, $location, $backup) + { + return self::getBackupNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName($project, $location, $cluster) + { + return self::getClusterNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + */ + public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) + { + return self::getCryptoKeyVersionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName($project, $location, $cluster, $instance) + { + return self::getInstanceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'instance' => $instance, + ]); + } + + /** + * 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($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName($project, $network) + { + return self::getNetworkNameTemplate()->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a user + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $user + * + * @return string The formatted user resource. + */ + public static function userName($project, $location, $cluster, $user) + { + return self::getUserNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'user' => $user, + ]); + } + + /** + * 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}/backups/{backup} + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} + * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} + * + * 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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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; + } + + /** + * 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 'alloydb.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); + } + + /** + * Creates new instances under the given project, location and cluster. + * There can be only one primary instance in a cluster. If the primary + * instance exists in the cluster as well as this request, then API will + * throw an error. + * The primary instance should exist before any read pool instance is + * created. If the primary instance is a part of the request payload, then + * the API will take care of creating instances in the correct order. + * This method is here to support Google-internal use cases, and is not meant + * for external customers to consume. Please do not start relying on it; its + * behavior is subject to change without notice. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $requests = new CreateInstanceRequests(); + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. + * @param CreateInstanceRequests $requests Required. Resources being created. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchCreateInstances($parent, $requests, array $optionalArgs = []) + { + $request = new BatchCreateInstancesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setRequests($requests); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchCreateInstances', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Backup in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $backupId = 'backup_id'; + * $backup = new Backup(); + * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Value for parent. + * @param string $backupId Required. ID of the requesting object. + * @param Backup $backup Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) + { + $request = new CreateBackupRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setBackupId($backupId); + $request->setBackup($backup); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Cluster in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object. + * @param Cluster $cluster Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new CreateClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Instance in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $instanceId = 'instance_id'; + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param string $instanceId Required. ID of the requesting object. + * @param Instance $instance Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createInstance($parent, $instanceId, $instance, array $optionalArgs = []) + { + $request = new CreateInstanceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInstanceId($instanceId); + $request->setInstance($instance); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object (the secondary cluster). + * @param Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createSecondaryCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new CreateSecondaryClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateSecondaryCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new SECONDARY Instance in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $instanceId = 'instance_id'; + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param string $instanceId Required. ID of the requesting object. + * @param Instance $instance Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createSecondaryInstance($parent, $instanceId, $instance, array $optionalArgs = []) + { + $request = new CreateSecondaryInstanceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInstanceId($instanceId); + $request->setInstance($instance); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateSecondaryInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new User in a given project, location, and cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $userId = 'user_id'; + * $user = new User(); + * $response = $alloyDBAdminClient->createUser($formattedParent, $userId, $user); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Value for parent. + * @param string $userId Required. ID of the requesting object. + * @param User $user Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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 \Google\Cloud\AlloyDb\V1\User + * + * @throws ApiException if the remote call fails + */ + public function createUser($parent, $userId, $user, array $optionalArgs = []) + { + $request = new CreateUserRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setUserId($userId); + $request->setUser($user); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type string $etag + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteBackup($name, array $optionalArgs = []) + { + $request = new DeleteBackupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @type bool $force + * Optional. Whether to cascade delete child instances for given cluster. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteCluster($name, array $optionalArgs = []) + { + $request = new DeleteClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteInstance($name, array $optionalArgs = []) + { + $request = new DeleteInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + * $alloyDBAdminClient->deleteUser($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteUser($name, array $optionalArgs = []) + { + $request = new DeleteUserRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteUser', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'failoverInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function failoverInstance($name, array $optionalArgs = []) + { + $request = new FailoverInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('FailoverInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Generate a client certificate signed by a Cluster CA. + * The sole purpose of this endpoint is to support AlloyDB connectors and the + * Auth Proxy client. The endpoint's behavior is subject to change without + * notice, so do not rely on its behavior remaining constant. Future changes + * will not break AlloyDB connectors or the Auth Proxy client. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $response = $alloyDBAdminClient->generateClientCertificate($formattedParent); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type Duration $certDuration + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * @type string $publicKey + * Optional. The public key from the client. + * @type bool $useMetadataExchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * @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 \Google\Cloud\AlloyDb\V1\GenerateClientCertificateResponse + * + * @throws ApiException if the remote call fails + */ + public function generateClientCertificate($parent, array $optionalArgs = []) + { + $request = new GenerateClientCertificateRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['certDuration'])) { + $request->setCertDuration($optionalArgs['certDuration']); + } + + if (isset($optionalArgs['publicKey'])) { + $request->setPublicKey($optionalArgs['publicKey']); + } + + if (isset($optionalArgs['useMetadataExchange'])) { + $request->setUseMetadataExchange($optionalArgs['useMetadataExchange']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GenerateClientCertificate', GenerateClientCertificateResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $response = $alloyDBAdminClient->getBackup($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the resource + * @param array $optionalArgs { + * 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 \Google\Cloud\AlloyDb\V1\Backup + * + * @throws ApiException if the remote call fails + */ + public function getBackup($name, array $optionalArgs = []) + { + $request = new GetBackupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $response = $alloyDBAdminClient->getCluster($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\ClusterView} + * @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 \Google\Cloud\AlloyDb\V1\Cluster + * + * @throws ApiException if the remote call fails + */ + public function getCluster($name, array $optionalArgs = []) + { + $request = new GetClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetCluster', Cluster::class, $optionalArgs, $request)->wait(); + } + + /** + * Get instance metadata used for a connection. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $response = $alloyDBAdminClient->getConnectionInfo($formattedParent); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @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 \Google\Cloud\AlloyDb\V1\ConnectionInfo + * + * @throws ApiException if the remote call fails + */ + public function getConnectionInfo($parent, array $optionalArgs = []) + { + $request = new GetConnectionInfoRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConnectionInfo', ConnectionInfo::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $response = $alloyDBAdminClient->getInstance($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * The view of the instance to return. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\InstanceView} + * @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 \Google\Cloud\AlloyDb\V1\Instance + * + * @throws ApiException if the remote call fails + */ + public function getInstance($name, array $optionalArgs = []) + { + $request = new GetInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + * $response = $alloyDBAdminClient->getUser($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param array $optionalArgs { + * 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 \Google\Cloud\AlloyDb\V1\User + * + * @throws ApiException if the remote call fails + */ + public function getUser($name, array $optionalArgs = []) + { + $request = new GetUserRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Injects fault in an instance. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'injectFault'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param int $faultType Required. The type of fault to be injected in an instance. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\InjectFaultRequest\FaultType} + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function injectFault($faultType, $name, array $optionalArgs = []) + { + $request = new InjectFaultRequest(); + $requestParamHeaders = []; + $request->setFaultType($faultType); + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('InjectFault', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Lists Backups in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent value for ListBackupsRequest + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Filtering results + * @type string $orderBy + * Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listBackups($parent, array $optionalArgs = []) + { + $request = new ListBackupsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); + } + + /** + * Lists Clusters in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listClusters($parent, array $optionalArgs = []) + { + $request = new ListClustersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListClusters', $optionalArgs, ListClustersResponse::class, $request); + } + + /** + * Lists Instances in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listInstances($parent, array $optionalArgs = []) + { + $request = new ListInstancesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListInstances', $optionalArgs, ListInstancesResponse::class, $request); + } + + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listSupportedDatabaseFlags($parent, array $optionalArgs = []) + { + $request = new ListSupportedDatabaseFlagsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListSupportedDatabaseFlags', $optionalArgs, ListSupportedDatabaseFlagsResponse::class, $request); + } + + /** + * Lists Users in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent value for ListUsersRequest + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listUsers($parent, array $optionalArgs = []) + { + $request = new ListUsersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListUsers', $optionalArgs, ListUsersResponse::class, $request); + } + + /** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'promoteCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function promoteCluster($name, array $optionalArgs = []) + { + $request = new PromoteClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('PromoteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Restart an Instance in a cluster. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restartInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function restartInstance($name, array $optionalArgs = []) + { + $request = new RestartInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestartInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Cluster in a given project and location, with a volume + * restored from the provided source, either a backup ID or a point-in-time + * and a source cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restoreCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object. + * @param Cluster $cluster Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type BackupSource $backupSource + * Backup source. + * @type ContinuousBackupSource $continuousBackupSource + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function restoreCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new RestoreClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['backupSource'])) { + $request->setBackupSource($optionalArgs['backupSource']); + } + + if (isset($optionalArgs['continuousBackupSource'])) { + $request->setContinuousBackupSource($optionalArgs['continuousBackupSource']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestoreCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $backup = new Backup(); + * $operationResponse = $alloyDBAdminClient->updateBackup($backup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateBackup($backup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Backup $backup Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateBackup($backup, array $optionalArgs = []) + { + $request = new UpdateBackupRequest(); + $requestParamHeaders = []; + $request->setBackup($backup); + $requestParamHeaders['backup.name'] = $backup->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Cluster $cluster Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateCluster($cluster, array $optionalArgs = []) + { + $request = new UpdateClusterRequest(); + $requestParamHeaders = []; + $request->setCluster($cluster); + $requestParamHeaders['cluster.name'] = $cluster->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->updateInstance($instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateInstance($instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Instance $instance Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateInstance($instance, array $optionalArgs = []) + { + $request = new UpdateInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $requestParamHeaders['instance.name'] = $instance->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $user = new User(); + * $response = $alloyDBAdminClient->updateUser($user); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param User $user Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allowMissing + * Optional. Allow missing fields in the update mask. + * @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 \Google\Cloud\AlloyDb\V1\User + * + * @throws ApiException if the remote call fails + */ + public function updateUser($user, array $optionalArgs = []) + { + $request = new UpdateUserRequest(); + $requestParamHeaders = []; + $request->setUser($user); + $requestParamHeaders['user.name'] = $user->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $response = $alloyDBAdminClient->getLocation(); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json b/owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..acfc6419e997 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json @@ -0,0 +1,183 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.alloydb.v1", + "libraryPackage": "Google\\Cloud\\AlloyDb\\V1", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminGapicClient", + "rpcs": { + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags" + ] + }, + "ListUsers": { + "methods": [ + "listUsers" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json new file mode 100644 index 000000000000..3643e0bcf47b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json @@ -0,0 +1,209 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1.AlloyDBAdmin": { + "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": 60000, + "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": { + "BatchCreateInstances": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSecondaryCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSecondaryInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateUser": { + "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_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "FailoverInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GenerateClientCertificate": { + "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" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConnectionInfo": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSupportedDatabaseFlags": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PromoteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestoreCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateUser": { + "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_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php new file mode 100644 index 000000000000..4bf356dc4b3c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php @@ -0,0 +1,586 @@ + [ + 'google.cloud.alloydb.v1.AlloyDBAdmin' => [ + 'BatchCreateInstances' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\BatchCreateInstancesResponse', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSecondaryCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSecondaryInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\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\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'FailoverInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'InjectFault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'PromoteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RestartInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RestoreCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'backup.name', + 'fieldAccessors' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'cluster.name', + 'fieldAccessors' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance.name', + 'fieldAccessors' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'CreateUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\User', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GenerateClientCertificate' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\GenerateClientCertificateResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\Backup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\Cluster', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConnectionInfo' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ConnectionInfo', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\User', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListBackups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ListBackupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListClusters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClusters', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ListClustersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSupportedDatabaseFlags' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSupportedDatabaseFlags', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ListSupportedDatabaseFlagsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListUsers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUsers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ListUsersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\User', + 'headerParams' => [ + [ + 'keyName' => 'user.name', + 'fieldAccessors' => [ + 'getUser', + 'getName', + ], + ], + ], + ], + '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', + ], + 'templateMap' => [ + 'backup' => 'projects/{project}/locations/{location}/backups/{backup}', + 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', + 'cryptoKeyVersion' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}', + 'instance' => 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}', + 'location' => 'projects/{project}/locations/{location}', + 'network' => 'projects/{project}/global/networks/{network}', + 'user' => 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}', + ], + ], + ], +]; diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php new file mode 100644 index 000000000000..a37ac074be16 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php @@ -0,0 +1,454 @@ + [ + 'google.cloud.alloydb.v1.AlloyDBAdmin' => [ + 'BatchCreateInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate', + 'body' => 'requests', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backups', + 'body' => 'backup', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_id', + ], + ], + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'instance_id', + ], + ], + 'CreateSecondaryCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters:createsecondary', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSecondaryInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateUser' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/users', + 'body' => 'user', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'user_id', + ], + ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteUser' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FailoverInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GenerateClientCertificate' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConnectionInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetUser' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InjectFault' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSupportedDatabaseFlags' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListUsers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/users', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PromoteCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}:promote', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestartInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestoreCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters:restore', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup.name=projects/*/locations/*/backups/*}', + 'body' => 'backup', + 'placeholders' => [ + 'backup.name' => [ + 'getters' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'UpdateUser' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{user.name=projects/*/locations/*/clusters/*/users/*}', + 'body' => 'user', + 'placeholders' => [ + 'user.name' => [ + 'getters' => [ + 'getUser', + 'getName', + ], + ], + ], + ], + ], + '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.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/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php new file mode 100644 index 000000000000..12c69d40f054 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php @@ -0,0 +1,3401 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AlloyDBAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AlloyDBAdminClient($options); + } + + /** @test */ + public function batchCreateInstancesTest() + { + $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/batchCreateInstancesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchCreateInstancesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchCreateInstancesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $response = $gapicClient->batchCreateInstances($formattedParent, $requests); + $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.alloydb.v1.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + $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 batchCreateInstancesExceptionTest() + { + $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/batchCreateInstancesTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $response = $gapicClient->batchCreateInstances($formattedParent, $requests); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + 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 createBackupTest() + { + $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/createBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); + $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.alloydb.v1.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupId(); + $this->assertProtobufEquals($backupId, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + $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 createBackupExceptionTest() + { + $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/createBackupTest'); + $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]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + 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 createClusterTest() + { + $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/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $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 createClusterExceptionTest() + { + $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/createClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + 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 createInstanceTest() + { + $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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); + $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.alloydb.v1.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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 createInstanceExceptionTest() + { + $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/createInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + 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 createSecondaryClusterTest() + { + $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/createSecondaryClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + $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 createSecondaryClusterExceptionTest() + { + $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/createSecondaryClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + 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 createSecondaryInstanceTest() + { + $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/createSecondaryInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $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.alloydb.v1.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + $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 createSecondaryInstanceExceptionTest() + { + $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/createSecondaryInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + 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 createUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + $response = $gapicClient->createUser($formattedParent, $userId, $user); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/CreateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserId(); + $this->assertProtobufEquals($userId, $actualValue); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createUserExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + try { + $gapicClient->createUser($formattedParent, $userId, $user); + // 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 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); + $expectedResponse = new GPBEmpty(); + $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]', '[BACKUP]'); + $response = $gapicClient->deleteBackup($formattedName); + $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.alloydb.v1.AlloyDBAdmin/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]', '[BACKUP]'); + $response = $gapicClient->deleteBackup($formattedName); + $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 deleteClusterTest() + { + $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/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->deleteCluster($formattedName); + $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.alloydb.v1.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $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 deleteClusterExceptionTest() + { + $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/deleteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->deleteCluster($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + 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 deleteInstanceTest() + { + $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/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->deleteInstance($formattedName); + $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.alloydb.v1.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $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 deleteInstanceExceptionTest() + { + $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/deleteInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->deleteInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + 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 deleteUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $gapicClient->deleteUser($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/DeleteUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + try { + $gapicClient->deleteUser($formattedName); + // 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 failoverInstanceTest() + { + $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/failoverInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/failoverInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->failoverInstance($formattedName); + $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.alloydb.v1.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + $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 failoverInstanceExceptionTest() + { + $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/failoverInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->failoverInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + 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 generateClientCertificateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $caCert = 'caCert536363365'; + $expectedResponse = new GenerateClientCertificateResponse(); + $expectedResponse->setCaCert($caCert); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->generateClientCertificate($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateClientCertificateExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->generateClientCertificate($formattedParent); + // 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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $response = $gapicClient->getBackup($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/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]', '[BACKUP]'); + try { + $gapicClient->getBackup($formattedName); + // 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 getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->getCluster($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->getCluster($formattedName); + // 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 getConnectionInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $ipAddress = 'ipAddress1480014044'; + $instanceUid = 'instanceUid-737331802'; + $expectedResponse = new ConnectionInfo(); + $expectedResponse->setName($name); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setInstanceUid($instanceUid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->getConnectionInfo($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionInfoExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + try { + $gapicClient->getConnectionInfo($formattedParent); + // 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 getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->getInstance($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + try { + $gapicClient->getInstance($formattedName); + // 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 getUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name2); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $response = $gapicClient->getUser($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + try { + $gapicClient->getUser($formattedName); + // 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 injectFaultTest() + { + $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/injectFaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/injectFaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->injectFault($faultType, $formattedName); + $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.alloydb.v1.AlloyDBAdmin/InjectFault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFaultType(); + $this->assertProtobufEquals($faultType, $actualValue); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + $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 injectFaultExceptionTest() + { + $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/injectFaultTest'); + $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 + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->injectFault($faultType, $formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + 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 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->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listBackups($formattedParent); + $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.alloydb.v1.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listBackups($formattedParent); + // 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 listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [ + $clustersElement, + ]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listClusters($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $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]'); + try { + $gapicClient->listClusters($formattedParent); + // 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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->listInstances($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->listInstances($formattedParent); + // 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 listSupportedDatabaseFlagsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); + $supportedDatabaseFlags = [ + $supportedDatabaseFlagsElement, + ]; + $expectedResponse = new ListSupportedDatabaseFlagsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listSupportedDatabaseFlags($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSupportedDatabaseFlagsExceptionTest() + { + $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]'); + try { + $gapicClient->listSupportedDatabaseFlags($formattedParent); + // 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 listUsersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $usersElement = new User(); + $users = [ + $usersElement, + ]; + $expectedResponse = new ListUsersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUsers($users); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->listUsers($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListUsers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsersExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->listUsers($formattedParent); + // 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 promoteClusterTest() + { + $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/promoteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag2 = 'etag2-1293302904'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag2); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/promoteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->promoteCluster($formattedName); + $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.alloydb.v1.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + $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 promoteClusterExceptionTest() + { + $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/promoteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->promoteCluster($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + 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 restartInstanceTest() + { + $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/restartInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restartInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->restartInstance($formattedName); + $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.alloydb.v1.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + $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 restartInstanceExceptionTest() + { + $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/restartInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->restartInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + 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 restoreClusterTest() + { + $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/restoreClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + $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 restoreClusterExceptionTest() + { + $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/restoreClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + 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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->updateBackup($backup); + $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.alloydb.v1.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->updateBackup($backup); + $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 updateClusterTest() + { + $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/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->updateCluster($cluster); + $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.alloydb.v1.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $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 updateClusterExceptionTest() + { + $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/updateClusterTest'); + $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 + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->updateCluster($cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + 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 updateInstanceTest() + { + $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/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->updateInstance($instance); + $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.alloydb.v1.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $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 updateInstanceExceptionTest() + { + $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/updateInstanceTest'); + $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 + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->updateInstance($instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + 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 updateUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $user = new User(); + $response = $gapicClient->updateUser($user); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/UpdateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateUserExceptionTest() + { + $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 + $user = new User(); + try { + $gapicClient->updateUser($user); + // 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 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php new file mode 100644 index 000000000000..b6a4fbae1e92 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php @@ -0,0 +1,3664 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AlloyDBAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AlloyDBAdminClient($options); + } + + /** @test */ + public function batchCreateInstancesTest() + { + $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/batchCreateInstancesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchCreateInstancesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchCreateInstancesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $request = (new BatchCreateInstancesRequest()) + ->setParent($formattedParent) + ->setRequests($requests); + $response = $gapicClient->batchCreateInstances($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.alloydb.v1.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + $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 batchCreateInstancesExceptionTest() + { + $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/batchCreateInstancesTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $request = (new BatchCreateInstancesRequest()) + ->setParent($formattedParent) + ->setRequests($requests); + $response = $gapicClient->batchCreateInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + 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 createBackupTest() + { + $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/createBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $request = (new CreateBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setBackup($backup); + $response = $gapicClient->createBackup($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.alloydb.v1.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupId(); + $this->assertProtobufEquals($backupId, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + $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 createBackupExceptionTest() + { + $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/createBackupTest'); + $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]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $request = (new CreateBackupRequest()) + ->setParent($formattedParent) + ->setBackupId($backupId) + ->setBackup($backup); + $response = $gapicClient->createBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + 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 createClusterTest() + { + $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/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($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.alloydb.v1.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $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 createClusterExceptionTest() + { + $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/createClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + 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 createInstanceTest() + { + $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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($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.alloydb.v1.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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 createInstanceExceptionTest() + { + $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/createInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + 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 createSecondaryClusterTest() + { + $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/createSecondaryClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new CreateSecondaryClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createSecondaryCluster($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.alloydb.v1.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + $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 createSecondaryClusterExceptionTest() + { + $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/createSecondaryClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new CreateSecondaryClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createSecondaryCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + 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 createSecondaryInstanceTest() + { + $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/createSecondaryInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $request = (new CreateSecondaryInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createSecondaryInstance($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.alloydb.v1.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + $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 createSecondaryInstanceExceptionTest() + { + $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/createSecondaryInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $request = (new CreateSecondaryInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createSecondaryInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + 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 createUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + $request = (new CreateUserRequest()) + ->setParent($formattedParent) + ->setUserId($userId) + ->setUser($user); + $response = $gapicClient->createUser($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.alloydb.v1.AlloyDBAdmin/CreateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserId(); + $this->assertProtobufEquals($userId, $actualValue); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createUserExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + $request = (new CreateUserRequest()) + ->setParent($formattedParent) + ->setUserId($userId) + ->setUser($user); + try { + $gapicClient->createUser($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 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); + $expectedResponse = new GPBEmpty(); + $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]', '[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.alloydb.v1.AlloyDBAdmin/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]', '[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 deleteClusterTest() + { + $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/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCluster($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.alloydb.v1.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $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 deleteClusterExceptionTest() + { + $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/deleteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + 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 deleteInstanceTest() + { + $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/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($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.alloydb.v1.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $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 deleteInstanceExceptionTest() + { + $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/deleteInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + 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 deleteUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $request = (new DeleteUserRequest()) + ->setName($formattedName); + $gapicClient->deleteUser($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/DeleteUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $request = (new DeleteUserRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteUser($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 failoverInstanceTest() + { + $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/failoverInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/failoverInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new FailoverInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->failoverInstance($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.alloydb.v1.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + $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 failoverInstanceExceptionTest() + { + $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/failoverInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new FailoverInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->failoverInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + 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 generateClientCertificateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $caCert = 'caCert536363365'; + $expectedResponse = new GenerateClientCertificateResponse(); + $expectedResponse->setCaCert($caCert); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GenerateClientCertificateRequest()) + ->setParent($formattedParent); + $response = $gapicClient->generateClientCertificate($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.alloydb.v1.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateClientCertificateExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GenerateClientCertificateRequest()) + ->setParent($formattedParent); + try { + $gapicClient->generateClientCertificate($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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[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.alloydb.v1.AlloyDBAdmin/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]', '[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 getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->getCluster($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.alloydb.v1.AlloyDBAdmin/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + try { + $gapicClient->getCluster($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 getConnectionInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $ipAddress = 'ipAddress1480014044'; + $instanceUid = 'instanceUid-737331802'; + $expectedResponse = new ConnectionInfo(); + $expectedResponse->setName($name); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setInstanceUid($instanceUid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new GetConnectionInfoRequest()) + ->setParent($formattedParent); + $response = $gapicClient->getConnectionInfo($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.alloydb.v1.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionInfoExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new GetConnectionInfoRequest()) + ->setParent($formattedParent); + try { + $gapicClient->getConnectionInfo($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 getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->getInstance($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.alloydb.v1.AlloyDBAdmin/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new GetInstanceRequest()) + ->setName($formattedName); + try { + $gapicClient->getInstance($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 getUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name2); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $request = (new GetUserRequest()) + ->setName($formattedName); + $response = $gapicClient->getUser($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.alloydb.v1.AlloyDBAdmin/GetUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $request = (new GetUserRequest()) + ->setName($formattedName); + try { + $gapicClient->getUser($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 injectFaultTest() + { + $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/injectFaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/injectFaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new InjectFaultRequest()) + ->setFaultType($faultType) + ->setName($formattedName); + $response = $gapicClient->injectFault($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.alloydb.v1.AlloyDBAdmin/InjectFault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFaultType(); + $this->assertProtobufEquals($faultType, $actualValue); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + $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 injectFaultExceptionTest() + { + $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/injectFaultTest'); + $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 + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new InjectFaultRequest()) + ->setFaultType($faultType) + ->setName($formattedName); + $response = $gapicClient->injectFault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + 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 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->locationName('[PROJECT]', '[LOCATION]'); + $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.alloydb.v1.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); + $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 listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [ + $clustersElement, + ]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listClusters($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $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 ListClustersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listClusters($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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInstances($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 listSupportedDatabaseFlagsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); + $supportedDatabaseFlags = [ + $supportedDatabaseFlagsElement, + ]; + $expectedResponse = new ListSupportedDatabaseFlagsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSupportedDatabaseFlagsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSupportedDatabaseFlags($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSupportedDatabaseFlagsExceptionTest() + { + $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 ListSupportedDatabaseFlagsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSupportedDatabaseFlags($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 listUsersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $usersElement = new User(); + $users = [ + $usersElement, + ]; + $expectedResponse = new ListUsersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUsers($users); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListUsersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listUsers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListUsers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsersExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListUsersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listUsers($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 promoteClusterTest() + { + $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/promoteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag2 = 'etag2-1293302904'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag2); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/promoteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new PromoteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->promoteCluster($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.alloydb.v1.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + $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 promoteClusterExceptionTest() + { + $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/promoteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new PromoteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->promoteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + 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 restartInstanceTest() + { + $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/restartInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restartInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new RestartInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->restartInstance($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.alloydb.v1.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + $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 restartInstanceExceptionTest() + { + $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/restartInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $request = (new RestartInstanceRequest()) + ->setName($formattedName); + $response = $gapicClient->restartInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + 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 restoreClusterTest() + { + $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/restoreClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new RestoreClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->restoreCluster($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.alloydb.v1.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + $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 restoreClusterExceptionTest() + { + $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/restoreClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new RestoreClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->restoreCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + 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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $request = (new UpdateBackupRequest()) + ->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.alloydb.v1.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $request = (new UpdateBackupRequest()) + ->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 updateClusterTest() + { + $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/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new UpdateClusterRequest()) + ->setCluster($cluster); + $response = $gapicClient->updateCluster($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.alloydb.v1.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $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 updateClusterExceptionTest() + { + $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/updateClusterTest'); + $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 + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $request = (new UpdateClusterRequest()) + ->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + 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 updateInstanceTest() + { + $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/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $request = (new UpdateInstanceRequest()) + ->setInstance($instance); + $response = $gapicClient->updateInstance($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.alloydb.v1.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $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 updateInstanceExceptionTest() + { + $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/updateInstanceTest'); + $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 + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $request = (new UpdateInstanceRequest()) + ->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + 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 updateUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $user = new User(); + $request = (new UpdateUserRequest()) + ->setUser($user); + $response = $gapicClient->updateUser($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.alloydb.v1.AlloyDBAdmin/UpdateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateUserExceptionTest() + { + $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 + $user = new User(); + $request = (new UpdateUserRequest()) + ->setUser($user); + try { + $gapicClient->updateUser($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 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 batchCreateInstancesAsyncTest() + { + $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/batchCreateInstancesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchCreateInstancesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchCreateInstancesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $request = (new BatchCreateInstancesRequest()) + ->setParent($formattedParent) + ->setRequests($requests); + $response = $gapicClient->batchCreateInstancesAsync($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.alloydb.v1.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + $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()); + } +} diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Resources.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Resources.php new file mode 100644 index 0000000000000000000000000000000000000000..d666427d32b4f539552090cce38d5ee9be2d13ad GIT binary patch literal 12477 zcmds7&2t+^b~gZi01qStjYtZDWC@1lnD)w`4a*-3e-1uKK?VT`0I6`7*{LBg1ZOpz zfoBGiX&0}_R_!S{<&ayda@hYPm*kl19`>?TDg6OC_>jtb-93X(5+Ey=T^+>1O!u$5 zU%!6u_g=p*zv-Ry;O*3oW@@(TYMs>4S;{@pQa#&pt+r*Pj{3*Pnw@G}r#;=!>`W?E ztfi{8R;pAix8B08j@7r@S}xVKtgfMLwGFG^*-{O|I_n&5z5GZudME0Zt?_0~h5-YZ z>Z#`R)V7w|spoe!SM8{-dbqQtK%eAe^%#O4HkrT^tm7Zn0ykkD} zCpjeDffZXr!=>S=R`d=>;GcdCQErSBnsOq9*s-jf;mepV;LO;t7wDwMa&rDFUIX&FMr-DW(H-h_C`Y};o& zI#>nEJl4C?8mzoHb(9y{nL^f+uQvVrAjAeu%jU5q)!+s$TXg1&B$39lA6>r4QJ9Rs zDCsH0y^&wyiNh&5DA3SmB>y4G`e*rl*kpQ%jl>A3h)xE5##Vu*VST5a?emW5!$VkL zB3Xm@6bZZucXn#Eok~e5mbT@+N=qqK3yp(12`(Ox9>CqgUb9u(Ej5%~xhn6Jio*?p z>EDGQ(sT?VvTX=Ej-i}d9WJg|cI$Ex_+2yjw2R$nR|C=$h_qFOYYkJSSoXttfeI>D zRfd%QLjaZqw3L9gX0xK~){5hLumLgui(IMHp2q{pU^sw1;{N+a>DgYnQHlrImn2C3 zm;F+synUb)_N!6&gRsKfue1nY9&wN8mwxhQ@>% z&E_u`>QuDMa|YEENKf97j$w^VjdG+qT1P=Qs+n|*5({_;qS@{1j6v2vPjC$n?MXl~ zA@O}*MQrzMVys0r*3;{Z^-N$+jJF2MnyDTcT8Ewe@RQ*00s-kmSUqCGRbJ_4$9lyK zS~Ppd8`?Ac8P88kRk%51AKJ{iB*JXM8L!t=Ka&|)2!6o$=|D?uSZ&4u5=#gZK?}5G zs7IRNB$m-kM6=&q4m*8cD-5Azy7pP}1;j?TS^5Q9aaXlnh50KK2#vGhjpL%x&CsUR zj?v*uk6;BolcQM23Mn2lUa_&(*sgX=gCxr!P42h!F~ogUQjmD)7T<=;M4dc*7dEEv zr?d)-ZL4o`ueF%`0HQ++mZA_sL(gqIHGQcXeSS(Jx!~u4JfLM08lR6s#Ge^`P=uDG z|1|&`xKXZd_N~6dkD#!O6T0*U>C!z|v$eK`M*d7_lR|Q1CudPAPtzN6pV919^=5dM z=)u;;XUY87(-A+WqibXGh-M#o+dNB435NM)=@VEHQeg@s>`l@G@(&4ZJY%H1+Xn+N zn;t{ttj2f896EhGsTX26)Qh&!cQC-=x<~5@N}s}N&q8jCk<}H% z7fk=N1j_{uhd$J^Q^JqlV4Cy3w*}Mpa#$8j#%SNG5I^;3py!n14D5r;!N!=Ghj$Ye zhD6BdBXX^d?(_^*a4kkak&=dJ6G-JFe8V3@v~6qX;I6XA687r%FyIxvxUZO{8Puzz z8R&obSY&CV*_plMF;hH)1B%_s4BMh_V37h>jroXJ_7|56*+Xbj7cQj=tO%vzY&3yW zpUFl&9PxL+Mk^4fWC3}1MbObigdxt@{-Wq5s3^@XAk`seYA(hfFO)X-gl{szemvhQ ztGq9_svPl`uq+T0fKZYAW+K3jWeV<78l~@Q0^2{90)-+VOoen4QR*js2T|2DEy`;U z<6dDd?$i0^B@a3>4~o<=N~Yax>xOQ26RS8vnD0&rRz$)?Vc}Pdt$)V391h$FWdF|=!VrC&n=S0?Mpvx#esmJ|5ip$8VRhudN}mnRD$6?L|7OmU`T!(yvB-Kc#L#<+t(slI&zSU+ zTX181naHmEWpYUj1@g&HV0C06(nGjCB<7(G4r9CA16`3fCbJNqFby-fX8K!vQ zdIzFIJ_0#xqENvc0cHrMv;9V=$2aM^#w6eK@J zL1q{pPbecC(a_2tB32UcI%I`T0LbWBRLao;+FCHj-DiX>YI zUHu~UcM@xCN>>L^Vg36)g|52k=-m_7@%Ck%?aPehl0Tzogn_>pg!fkL61qO5`yC`U zmQPAJUz*|iJe*7eyVKo}0L1VPy@%TAV7TZcC?pb*#TZ|s_(t$Gk0cVSil7#bkVJ{e zZf=bkXNgZ?RYWF&x^cfg?;+V^QH{v*b&%X(D2!2K+cHfwnaE^V;I3Cp>pVO_Km((;sn z!p!iK0Oe)w!Y!`Zj%y=(R}9VUx+iQJtJ2%B!9QZSY9iawY~>U)J~&MZELT~UFrS13 zW+bLgCZB)}@7w4U@^|32G95el5MpDhjH06RJ0jwL3g8{juu^Qp!caE;^Enk@7$QSy z`E(8z=r3N1#HZxX(aVeL1N8F9AGT|B;ew0;)7ru0Pni9fs!@2oAlcgYecfgzowUue ziEW9q7m&Uk2}fubquKex5sDwKO4uHQG{xx7plsKodH;A_nm5et7}N8)-NHC|n?d#_ zxZU5vif1{QN5ku(auq2k62W=c9kEiSUaM7*jE<1KP#Tj+6aMlocvId-CMxI4m2&G~ z+6YK#e^sl>71S$ScB8a|_fq&PnET93&2zKJ$E>Abmk((ru$^8F<#WuWWC zvXx>9@Aiv4Z6fbs4F)EHD9aNAz#IxDWAGOGg!4bdzWWV(K{bry8cEi~!njGOvciTrk3>tXzS+BaOihk-pCgWm(wNnCe4=_{Qh?-Itrc!O?8uXY?Mwh^4$Auy6B zUhA_$f^hN?mbFZ502Y14$n?L$)T@{nUH?ateYiD6j8X<77!dKMjLb)~cfBn_HDpDd z8SMD!V;7z!gqUh9O$=j!?U^KCRIwoy`tQbaf&4ctIwKL;*|X^9ujT5@JL^YNrq?yBBh}av*WidPp3aY!u(fM_{H|XQ b{fJk-4;9K&icN1%DUxR`c`5rjoCEwH?ha2D literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Service.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Service.php new file mode 100644 index 0000000000000000000000000000000000000000..f369ba222eebb357938e75c854aec380c81fd368 GIT binary patch literal 16263 zcmds8No?HK84gF*_GHV_vn|WA9gpcOilEFyV>^z=Tc|ZkWLvQ0pbk_JoDn549+51` zk)s$wgEVaqMbV;5dMXMO-Ozi17U-eqsqvxc1{4*#qzh1>w*W;Cy|n+^xQR35j2)n9 z4zWG_-{b%N`}=>s%h&7;8=c9|>89>zp1zu|Z0EfVJ#RafXH~6QzEWRX)17?P+O&6`f*H<$A>)AP%xVX14?ovL2WuUpo7O)pk!R(-Xo)oRxEYNfa}q1EgSt?25` zmQmFUbX$Z>ZBut`t*Yne7ALRkp0=ua+R7Z=VP%T!u%fUXR$iS@$PSkfs@62u%`dT? z(0!DL|Ll6DW>oX8r+M(l6NalArr{Y{&3F^AT*|!7|sKx@j8b`pQk4*n4Zz z@{M4+&emo}?k@%H&1~AYa`1{lL2ceem3p~%$>Vf+#Sxr z($2|__Z10agy`>{byqisJIJ2+5b9bpYVg+Kee@la@CfR$oK@XXE8D}J{?GCbIvi!w zwIRUi_yX#wa@K*}uvwje!2 z!q-*HtZff>f%tnE$lpomFa!A!!WJ^(J=h3tj%^pP-L?tr7`Ag@c=UIbcs4bvzS4*= z58>JcKl)Qqg_T3>_hFPny^`&^2LJ)b01(BIAaGCJG+Y-_C{-#4_dNhNt=IGfaP7EC z)Oe_WGX4h9J}4H~Ss+Pg8KcfM3yRY)t6!DSkwwSawEnkvl|R*ijzCQV^<>;YrqF?k zR=r!dRaQCCu-R7{6DE?FA`6pr$r3HjUwRCG3=Kor@C>tV)m=5ZUk^2)bItdg@>j=p z{^-Y@$sW|jL@R$644EXHc@xql918rzcp;V;SDvPs@iacwATx>`KD5;M78r7jRh}F# zqFzJr&$HuG&6Vpj+gf`3w1hCEN3mLDqVtjbC?thaCG|oiL#EibcqvJd@*hDKEOCgR z1uyOEZ5Z_#T#B*8cm?%{CpbK|Np;2_0UkFE?xW@1Tk6z z!6~2lr^<^Am)rT-=60UAFV%|tV+kFf)V%6Ol;#lxfLBnD&n3&%X`z;4jH%a6GM*rH z%XiR;WcD9AD9B&SCGRa7H+UEg_zLkf2U;OaAHDc48uXvA1BmWIjY$gj#pbF?0wZ2n z5VBdKXByp|F+FE{#70LFAK*UJaaZ4F^*WwKolt<**)gTBbfIN7*h|Z~7bJN%hmIvM z$|&#x>Li%iL7~5NrOh`L$aXp&M7_G>SdO~suCp>7pGKYZCteX?@d7yR(M5F^D`=m$ zZIkniG}>QEaStIqU%tz*RNg|JjDsU+aA{dto>6b#SX!K!nxCDYnI3oy&UpQcGdHH^ zZ_KGvw`Sn^fP{NdC;WB#&Oi?DM?Lgscs|fU{xvZCID%0QR=2MFq{VitUfpx$1|91h#e4<90I2cEb0M3b>-ei!huqB)MQ-2@uV zEN$1#GUWB6vzk$}wshx1=WWlKgNT-&D?XP)c;0+nuX?juz2*u1FCnx>{;g8eCY_4@ zQdt;(ayh(rmjd0ASU8KULg-9v*{hbQ(6iZvd=B;cuLlDfnpJKuEUU|R7URyzk$viD?y^0wJBU^%rWq>8ulXUV!!hWHj_+}N|228>u&)T3+7Q+?S=Ay zdltys=02OdHtl_U36QZc9!1uU_G4#*Z0-mS#JVDZD&#Lp=rr-rrMhif4$SqYVZc_= zTz$5tt@{o;9dp=o)L{#Fyn(|e?v~MiWe6H_GnTlw-bTZ&U|J<(LBh4VM%d0)<0muO z$eZQ=NXValvQgNS?s&$UQH7#QcyfatM{3WvVRRir-L}4|R$YhpvO0$)(l0-c4piaw zs+be-%I=tmSbjTDjG%~1O2ll~Bvd7JZm8QTqa$??-zFcis`?wy-!|9vaM$%dIxQwQ z2?F41Ie`vRh6CBKa+b2zdN0WLQImnAGm|2X;)r6R1ZwS5>-%g}l8T;@A=xv#_&RAnpzlDxjvT1e2Ez zd>r+YQwnqiVMOS{5GSyo4txd;IjoJZuc}qj5v$ec*fcPp4mkex!9Ylbja|^-a5vOr zOy`pr4e;fvYwK0wRr0qaG(h6OZTKd@k3?r17;IssAtayM@nf%I2hYV66;%~F@^-BQ53WqS5_R0pqH}jx2`F;c?!+kW! zDuytm))n1WwNU!t9NMptk87qUmDNqd#6ObIeq!o;F6H8h=4KtH}BFEJx0KZgH$wvmg(X&oqi-J22{J)9PJ?PpR>DB!o!*U=MJy zIU50`;5*yYSblLYt7HP)fKi`M;CWY}12Ft&2_0ZQDR@m0S%g@yds5&FeRWXq^O?Lu z*}N>bF43|W_3kRim=eahu*IJc0v;$QP`6+|A&veOFfvyaL@5{}#2GPul46`LT@0*- zb6Uu#k`UHI0%Sdyz^0*ufOH@->%=K2Bg7d|ZZd-#3u!VVI&N?elreOKe-Ysqjr7YS zoS?a1NYKNJ3`KEDt1wEP5!LGy)m1s9yNsyHfPsu`%hH$+u(>h52auxk)HFy@>Wq-8 zdm&{EVr7R-djV3K$-R>kBa!&WANZ1p2+1V~iz4w=8L@p{qTm)}CGfSZ;Hq?n;filn zLO$1ieEAu89!Wl;CF!PlUW8bHPBHA*8lJ0eP)S_FS29W>oC1o57{&&9>jx6*gKQ*_ z;OCmFF+?h0Wb9qb3wt@w=5qntp)~eS@G53gKIHP~Vmpa?d_W2D@!cFc8gnI|{Bm>EHCUEW5MO65ct^heP=;5o#@z8y3Fhq_ zI-GRs#TT1PC237Yk$i!P58U*Ht1l<|!s z#VMlHtpUGPnhk&pBhFa+M0`5z9f!q6`z#V!5>z*%*Z6?l|7Bk*k&!p1_up#2cm zT44mAT@J)2VfcJ=+m6#`MEM3q`HCFUZW}1eYkY1Ou9Q;L2;Y|Uh2~>v$tXmc5!z>% z%iajPY&+PDU=&E<9So*`<7B@FN(xdi*n_0Z3k}e4%EuTn@{EY@QDwd?&jha84q#Fu z07Q>dVxp{2v?cspfHtL0tgwMxP!N4nLcLJsu$^(C zxrh0Lg6B;0ANkr|Hk&Dh^BAgr;2YlkEMss!Q)CsU6|AOIJ}e59<(5TR=JUK=-Z0LSuDHgI9ujNsm+3Q$TH0y|;cHBDcPgfxHxjF|lx%~nm} z{T$%2?2`>%m^LH48ndslknUQtuhvr22ND_~?wdI8a`Cn1F4TCX0Q+M58}LKZB2zcM z7N|QVEclbZ$hb0y5-_Yg)^JvZuQunn;X;8pMPyCZbHEw}e5C5~MD03@`velNo;lK(G{(1w=q8Knw}b zg~lkonOvaFU12F>A)9W`Qbt~WpbRBXUw@?(HayRE%f;fod-pga{*^$j?rnglz#Z;q zZI~6q1)R-ENWSC-x!^gmS2?+ViCyi6*0N_UO0Sg}nYh*mw++`V|6)13PTVc$Oxl%8 z{@=czJ26KulNY84BLz0^sucKT@(1Ga3cqa5Zktb6R^Ylhy|Dg|+$pv}xlDH`m)RDR ogoogle.cloud.alloydb.v1alpha.AutomatedBackupPolicy + */ +class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + */ + protected $backup_window = null; + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + */ + protected $location = ''; + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + protected $schedule; + protected $retention; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule $weekly_schedule + * Weekly schedule for the Backup. + * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention $time_based_retention + * Time-based Backup retention policy. + * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention $quantity_based_retention + * Quantity-based Backup retention policy to retain recent backups. + * @type bool $enabled + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * @type \Google\Protobuf\Duration $backup_window + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * @type string $location + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to backups created using this configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Weekly schedule for the Backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule|null + */ + public function getWeeklySchedule() + { + return $this->readOneof(2); + } + + public function hasWeeklySchedule() + { + return $this->hasOneof(2); + } + + /** + * Weekly schedule for the Backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule $var + * @return $this + */ + public function setWeeklySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Time-based Backup retention policy. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention|null + */ + public function getTimeBasedRetention() + { + return $this->readOneof(4); + } + + public function hasTimeBasedRetention() + { + return $this->hasOneof(4); + } + + /** + * Time-based Backup retention policy. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention $var + * @return $this + */ + public function setTimeBasedRetention($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Quantity-based Backup retention policy to retain recent backups. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention|null + */ + public function getQuantityBasedRetention() + { + return $this->readOneof(5); + } + + public function hasQuantityBasedRetention() + { + return $this->hasOneof(5); + } + + /** + * Quantity-based Backup retention policy to retain recent backups. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention $var + * @return $this + */ + public function setQuantityBasedRetention($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getBackupWindow() + { + return $this->backup_window; + } + + public function hasBackupWindow() + { + return isset($this->backup_window); + } + + public function clearBackupWindow() + { + unset($this->backup_window); + } + + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBackupWindow($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->backup_window = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + * @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; + } + + /** + * @return string + */ + public function getSchedule() + { + return $this->whichOneof("schedule"); + } + + /** + * @return string + */ + public function getRetention() + { + return $this->whichOneof("retention"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php new file mode 100644 index 000000000000..113d149b44f3 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + */ +class QuantityBasedRetention extends \Google\Protobuf\Internal\Message +{ + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + */ + protected $count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $count + * The number of backups to retain. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + * @return int + */ + public function getCount() + { + return $this->count; + } + + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt32($var); + $this->count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuantityBasedRetention::class, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy_QuantityBasedRetention::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php new file mode 100644 index 000000000000..9285be82129f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php @@ -0,0 +1,81 @@ +google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + */ +class TimeBasedRetention extends \Google\Protobuf\Internal\Message +{ + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + */ + protected $retention_period = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $retention_period + * The retention period. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getRetentionPeriod() + { + return $this->retention_period; + } + + public function hasRetentionPeriod() + { + return isset($this->retention_period); + } + + public function clearRetentionPeriod() + { + unset($this->retention_period); + } + + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRetentionPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->retention_period = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimeBasedRetention::class, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy_TimeBasedRetention::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php new file mode 100644 index 000000000000..b9ab088ee67d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php @@ -0,0 +1,129 @@ +google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + */ +class WeeklySchedule extends \Google\Protobuf\Internal\Message +{ + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + */ + private $start_times; + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + */ + private $days_of_week; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $start_times + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStartTimes() + { + return $this->start_times; + } + + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + * @param array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStartTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\TimeOfDay::class); + $this->start_times = $arr; + + return $this; + } + + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDaysOfWeek() + { + return $this->days_of_week; + } + + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDaysOfWeek($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->days_of_week = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WeeklySchedule::class, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy_WeeklySchedule::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php new file mode 100644 index 000000000000..bce5253a4d57 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php @@ -0,0 +1,951 @@ +google.cloud.alloydb.v1alpha.Backup + */ +class Backup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + */ + private $labels; + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + */ + protected $type = 0; + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + */ + protected $description = ''; + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cluster_uid = ''; + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $cluster_name = ''; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + */ + private $annotations; + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_bytes = 0; + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expiry_time = null; + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expiry_quantity = null; + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 21; + */ + protected $satisfies_pzs = false; + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $database_version = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * @type string $display_name + * User-settable and human-readable display name for the Backup. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current state of the backup. + * @type int $type + * The backup type, which suggests the trigger for the backup. + * @type string $description + * User-provided description of the backup. + * @type string $cluster_uid + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * @type string $cluster_name + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $encryption_info + * Output only. The encryption information for the backup. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type int|string $size_bytes + * Output only. The size of the backup in bytes. + * @type \Google\Protobuf\Timestamp $expiry_time + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * @type \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry $expiry_quantity + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * @type bool $satisfies_pzs + * Reserved for future use. + * @type int $database_version + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + * @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 current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Backup\State::class); + $this->state = $var; + + return $this; + } + + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.Type type = 8; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Backup\Type::class); + $this->type = $var; + + return $this; + } + + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClusterUid() + { + return $this->cluster_uid; + } + + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClusterUid($var) + { + GPBUtil::checkString($var, True); + $this->cluster_uid = $var; + + return $this; + } + + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getClusterName() + { + return $this->cluster_name; + } + + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setClusterName($var) + { + GPBUtil::checkString($var, True); + $this->cluster_name = $var; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeBytes() + { + return $this->size_bytes; + } + + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->size_bytes = $var; + + return $this; + } + + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpiryTime() + { + return $this->expiry_time; + } + + public function hasExpiryTime() + { + return isset($this->expiry_time); + } + + public function clearExpiryTime() + { + unset($this->expiry_time); + } + + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpiryTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiry_time = $var; + + return $this; + } + + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry|null + */ + public function getExpiryQuantity() + { + return $this->expiry_quantity; + } + + public function hasExpiryQuantity() + { + return isset($this->expiry_quantity); + } + + public function clearExpiryQuantity() + { + unset($this->expiry_quantity); + } + + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry $var + * @return $this + */ + public function setExpiryQuantity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry::class); + $this->expiry_quantity = $var; + + return $this; + } + + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 21; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 21; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDatabaseVersion() + { + return $this->database_version; + } + + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDatabaseVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\DatabaseVersion::class); + $this->database_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php new file mode 100644 index 000000000000..d9700614507c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php @@ -0,0 +1,125 @@ +google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + */ +class QuantityBasedExpiry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retention_count = 0; + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $total_retention_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $retention_count + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * @type int $total_retention_count + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRetentionCount() + { + return $this->retention_count; + } + + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRetentionCount($var) + { + GPBUtil::checkInt32($var); + $this->retention_count = $var; + + return $this; + } + + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTotalRetentionCount() + { + return $this->total_retention_count; + } + + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTotalRetentionCount($var) + { + GPBUtil::checkInt32($var); + $this->total_retention_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuantityBasedExpiry::class, \Google\Cloud\AlloyDb\V1alpha\Backup_QuantityBasedExpiry::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php new file mode 100644 index 000000000000..cb2114f4f8e2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php @@ -0,0 +1,78 @@ +google.cloud.alloydb.v1alpha.Backup.State + */ +class State +{ + /** + * The state of the backup is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The backup is ready. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The backup is creating. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + /** + * The backup failed. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The backup is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::CREATING => 'CREATING', + self::FAILED => 'FAILED', + self::DELETING => 'DELETING', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1alpha\Backup_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php new file mode 100644 index 000000000000..5f953aa43d84 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php @@ -0,0 +1,74 @@ +google.cloud.alloydb.v1alpha.Backup.Type + */ +class Type +{ + /** + * Backup Type is unknown. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * ON_DEMAND backups that were triggered by the customer (e.g., not + * AUTOMATED). + * + * Generated from protobuf enum ON_DEMAND = 1; + */ + const ON_DEMAND = 1; + /** + * AUTOMATED backups triggered by the automated backups scheduler pursuant + * to an automated backup policy. + * + * Generated from protobuf enum AUTOMATED = 2; + */ + const AUTOMATED = 2; + /** + * CONTINUOUS backups triggered by the automated backups scheduler + * due to a continuous backup policy. + * + * Generated from protobuf enum CONTINUOUS = 3; + */ + const CONTINUOUS = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ON_DEMAND => 'ON_DEMAND', + self::AUTOMATED => 'AUTOMATED', + self::CONTINUOUS => 'CONTINUOUS', + ]; + + 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(Type::class, \Google\Cloud\AlloyDb\V1alpha\Backup_Type::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php new file mode 100644 index 000000000000..849d85f34994 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php @@ -0,0 +1,113 @@ +google.cloud.alloydb.v1alpha.BackupSource + */ +class BackupSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_uid = ''; + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_uid + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * @type string $backup_name + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBackupUid() + { + return $this->backup_uid; + } + + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBackupUid($var) + { + GPBUtil::checkString($var, True); + $this->backup_uid = $var; + + return $this; + } + + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackupName() + { + return $this->backup_name; + } + + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupName($var) + { + GPBUtil::checkString($var, True); + $this->backup_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php new file mode 100644 index 000000000000..52ed601803b8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php @@ -0,0 +1,221 @@ +google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + */ +class BatchCreateInstanceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + */ + protected $state = 0; + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + */ + protected $error_msg = ''; + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + */ + protected $error = null; + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * @type string $error_msg + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * @type \Google\Rpc\Status $error + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * @type int $type + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstanceStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + * @return string + */ + public function getErrorMsg() + { + return $this->error_msg; + } + + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + * @param string $var + * @return $this + */ + public function setErrorMsg($var) + { + GPBUtil::checkString($var, True); + $this->error_msg = $var; + + return $this; + } + + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\InstanceType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php new file mode 100644 index 000000000000..805f5c4f5d95 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php @@ -0,0 +1,97 @@ +google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State + */ +class State +{ + /** + * The state of the instance is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Instance is pending creation and has not yet been picked up for + * processsing in the backend. + * + * Generated from protobuf enum PENDING_CREATE = 1; + */ + const PENDING_CREATE = 1; + /** + * The instance is active and running. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 3; + */ + const CREATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The creation of the instance failed or a fatal error occurred during + * an operation on the instance or a batch of instances. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + /** + * The instance was created successfully, but was rolled back and deleted + * due to some other failure during BatchCreateInstances operation. + * + * Generated from protobuf enum ROLLED_BACK = 6; + */ + const ROLLED_BACK = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING_CREATE => 'PENDING_CREATE', + self::READY => 'READY', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::ROLLED_BACK => 'ROLLED_BACK', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstanceStatus_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php new file mode 100644 index 000000000000..38316776ba6b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php @@ -0,0 +1,134 @@ +google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + */ +class BatchCreateInstancesMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + */ + private $instance_targets; + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + */ + private $instance_statuses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instance_targets + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * @type array|\Google\Protobuf\Internal\MapField $instance_statuses + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceTargets() + { + return $this->instance_targets; + } + + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instance_targets = $arr; + + return $this; + } + + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInstanceStatuses() + { + return $this->instance_statuses; + } + + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInstanceStatuses($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstanceStatus::class); + $this->instance_statuses = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php new file mode 100644 index 000000000000..89e196065983 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php @@ -0,0 +1,185 @@ +google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + */ +class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $requests = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. + * @type \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests $requests + * Required. Resources being created. + * @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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. + * + * 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 name of the parent resource. + * + * 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. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests|null + */ + public function getRequests() + { + return $this->requests; + } + + public function hasRequests() + { + return isset($this->requests); + } + + public function clearRequests() + { + unset($this->requests); + } + + /** + * Required. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests $var + * @return $this + */ + public function setRequests($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests::class); + $this->requests = $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 = 3 [(.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 = 3 [(.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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php new file mode 100644 index 000000000000..7ca68670a4de --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php @@ -0,0 +1,67 @@ +google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + */ +class BatchCreateInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * Created instances. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + * @param array<\Google\Cloud\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Instance::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php new file mode 100644 index 000000000000..258d83ea51d9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php @@ -0,0 +1,1223 @@ +google.cloud.alloydb.v1alpha.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Output only. The current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cluster_type = 0; + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $database_version = 0; + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_config = null; + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @deprecated + */ + protected $network = ''; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + */ + private $annotations; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $initial_user = null; + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + */ + protected $automated_backup_policy = null; + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; + * @deprecated + */ + protected $ssl_config = null; + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $continuous_backup_config = null; + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $continuous_backup_info = null; + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + */ + protected $secondary_config = null; + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $primary_config = null; + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 30; + */ + protected $satisfies_pzs = false; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1alpha\BackupSource $backup_source + * Output only. Cluster created from backup. + * @type \Google\Cloud\AlloyDb\V1alpha\MigrationSource $migration_source + * Output only. Cluster created via DMS migration. + * @type string $name + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * @type string $display_name + * User-settable and human-readable display name for the Cluster. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current serving state of the cluster. + * @type int $cluster_type + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * @type int $database_version + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * @type \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig $network_config + * @type string $network + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * @type \Google\Cloud\AlloyDb\V1alpha\UserPassword $initial_user + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy $automated_backup_policy + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * @type \Google\Cloud\AlloyDb\V1alpha\SslConfig $ssl_config + * SSL configuration for this AlloyDB cluster. + * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $encryption_info + * Output only. The encryption information for the cluster. + * @type \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig $continuous_backup_config + * Optional. Continuous backup configuration for this cluster. + * @type \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo $continuous_backup_info + * Output only. Continuous backup properties for this cluster. + * @type \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig $secondary_config + * Cross Region replication config specific to SECONDARY cluster. + * @type \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig $primary_config + * Output only. Cross Region replication config specific to PRIMARY cluster. + * @type bool $satisfies_pzs + * Reserved for future use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Cluster created from backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\BackupSource|null + */ + public function getBackupSource() + { + return $this->readOneof(15); + } + + public function hasBackupSource() + { + return $this->hasOneof(15); + } + + /** + * Output only. Cluster created from backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\BackupSource $var + * @return $this + */ + public function setBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\BackupSource::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. Cluster created via DMS migration. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\MigrationSource|null + */ + public function getMigrationSource() + { + return $this->readOneof(16); + } + + public function hasMigrationSource() + { + return $this->hasOneof(16); + } + + /** + * Output only. Cluster created via DMS migration. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\MigrationSource $var + * @return $this + */ + public function setMigrationSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\MigrationSource::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @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 current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getClusterType() + { + return $this->cluster_type; + } + + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setClusterType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\ClusterType::class); + $this->cluster_type = $var; + + return $this; + } + + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDatabaseVersion() + { + return $this->database_version; + } + + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDatabaseVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\DatabaseVersion::class); + $this->database_version = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig|null + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + public function hasNetworkConfig() + { + return isset($this->network_config); + } + + public function clearNetworkConfig() + { + unset($this->network_config); + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig::class); + $this->network_config = $var; + + return $this; + } + + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + * @deprecated + */ + public function getNetwork() + { + @trigger_error('network is deprecated.', E_USER_DEPRECATED); + return $this->network; + } + + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + * @deprecated + */ + public function setNetwork($var) + { + @trigger_error('network is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\UserPassword|null + */ + public function getInitialUser() + { + return $this->initial_user; + } + + public function hasInitialUser() + { + return isset($this->initial_user); + } + + public function clearInitialUser() + { + unset($this->initial_user); + } + + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\UserPassword $var + * @return $this + */ + public function setInitialUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\UserPassword::class); + $this->initial_user = $var; + + return $this; + } + + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy|null + */ + public function getAutomatedBackupPolicy() + { + return $this->automated_backup_policy; + } + + public function hasAutomatedBackupPolicy() + { + return isset($this->automated_backup_policy); + } + + public function clearAutomatedBackupPolicy() + { + unset($this->automated_backup_policy); + } + + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; + * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy $var + * @return $this + */ + public function setAutomatedBackupPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy::class); + $this->automated_backup_policy = $var; + + return $this; + } + + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; + * @return \Google\Cloud\AlloyDb\V1alpha\SslConfig|null + * @deprecated + */ + public function getSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + return $this->ssl_config; + } + + public function hasSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + return isset($this->ssl_config); + } + + public function clearSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + unset($this->ssl_config); + } + + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; + * @param \Google\Cloud\AlloyDb\V1alpha\SslConfig $var + * @return $this + * @deprecated + */ + public function setSslConfig($var) + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig::class); + $this->ssl_config = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig|null + */ + public function getContinuousBackupConfig() + { + return $this->continuous_backup_config; + } + + public function hasContinuousBackupConfig() + { + return isset($this->continuous_backup_config); + } + + public function clearContinuousBackupConfig() + { + unset($this->continuous_backup_config); + } + + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig $var + * @return $this + */ + public function setContinuousBackupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig::class); + $this->continuous_backup_config = $var; + + return $this; + } + + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo|null + */ + public function getContinuousBackupInfo() + { + return $this->continuous_backup_info; + } + + public function hasContinuousBackupInfo() + { + return isset($this->continuous_backup_info); + } + + public function clearContinuousBackupInfo() + { + unset($this->continuous_backup_info); + } + + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo $var + * @return $this + */ + public function setContinuousBackupInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo::class); + $this->continuous_backup_info = $var; + + return $this; + } + + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * @return \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig|null + */ + public function getSecondaryConfig() + { + return $this->secondary_config; + } + + public function hasSecondaryConfig() + { + return isset($this->secondary_config); + } + + public function clearSecondaryConfig() + { + unset($this->secondary_config); + } + + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; + * @param \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig $var + * @return $this + */ + public function setSecondaryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig::class); + $this->secondary_config = $var; + + return $this; + } + + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig|null + */ + public function getPrimaryConfig() + { + return $this->primary_config; + } + + public function hasPrimaryConfig() + { + return isset($this->primary_config); + } + + public function clearPrimaryConfig() + { + unset($this->primary_config); + } + + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig $var + * @return $this + */ + public function setPrimaryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig::class); + $this->primary_config = $var; + + return $this; + } + + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 30; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 30; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php new file mode 100644 index 000000000000..fb3e38451206 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1alpha.Cluster.ClusterType + */ +class ClusterType +{ + /** + * The type of the cluster is unknown. + * + * Generated from protobuf enum CLUSTER_TYPE_UNSPECIFIED = 0; + */ + const CLUSTER_TYPE_UNSPECIFIED = 0; + /** + * Primary cluster that support read and write operations. + * + * Generated from protobuf enum PRIMARY = 1; + */ + const PRIMARY = 1; + /** + * Secondary cluster that is replicating from another region. + * This only supports read. + * + * Generated from protobuf enum SECONDARY = 2; + */ + const SECONDARY = 2; + + private static $valueToName = [ + self::CLUSTER_TYPE_UNSPECIFIED => 'CLUSTER_TYPE_UNSPECIFIED', + self::PRIMARY => 'PRIMARY', + self::SECONDARY => 'SECONDARY', + ]; + + 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(ClusterType::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_ClusterType::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php new file mode 100644 index 000000000000..12828836847a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php @@ -0,0 +1,148 @@ +google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allocated_ip_range = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * @type string $allocated_ip_range + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAllocatedIpRange() + { + return $this->allocated_ip_range; + } + + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAllocatedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->allocated_ip_range = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkConfig::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_NetworkConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php new file mode 100644 index 000000000000..0d5f41ce6145 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + */ +class PrimaryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $secondary_cluster_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_cluster_names + * Output only. Names of the clusters that are replicating from this + * cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryClusterNames() + { + return $this->secondary_cluster_names; + } + + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryClusterNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_cluster_names = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrimaryConfig::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_PrimaryConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php new file mode 100644 index 000000000000..85e186b7b42c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php @@ -0,0 +1,75 @@ +google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + */ +class SecondaryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + */ + protected $primary_cluster_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $primary_cluster_name + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + * @return string + */ + public function getPrimaryClusterName() + { + return $this->primary_cluster_name; + } + + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + * @param string $var + * @return $this + */ + public function setPrimaryClusterName($var) + { + GPBUtil::checkString($var, True); + $this->primary_cluster_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SecondaryConfig::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_SecondaryConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php new file mode 100644 index 000000000000..ccaebbfd128a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php @@ -0,0 +1,125 @@ +google.cloud.alloydb.v1alpha.Cluster.State + */ +class State +{ + /** + * The state of the cluster is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The cluster is active and running. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The cluster is stopped. All instances in the cluster are stopped. + * Customers can start a stopped cluster at any point and all their + * instances will come back to life with same names and IP resources. In + * this state, customer pays for storage. + * Associated backups could also be present in a stopped cluster. + * + * Generated from protobuf enum STOPPED = 2; + */ + const STOPPED = 2; + /** + * The cluster is empty and has no associated resources. + * All instances, associated storage and backups have been deleted. + * + * Generated from protobuf enum EMPTY = 3; + */ + const PBEMPTY = 3; + /** + * The cluster is being created. + * + * Generated from protobuf enum CREATING = 4; + */ + const CREATING = 4; + /** + * The cluster is being deleted. + * + * Generated from protobuf enum DELETING = 5; + */ + const DELETING = 5; + /** + * The creation of the cluster failed. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * The cluster is bootstrapping with data from some other source. + * Direct mutations to the cluster (e.g. adding read pool) are not allowed. + * + * Generated from protobuf enum BOOTSTRAPPING = 7; + */ + const BOOTSTRAPPING = 7; + /** + * The cluster is under maintenance. AlloyDB regularly performs maintenance + * and upgrades on customer clusters. Updates on the cluster are + * not allowed while the cluster is in this state. + * + * Generated from protobuf enum MAINTENANCE = 8; + */ + const MAINTENANCE = 8; + /** + * The cluster is being promoted. + * + * Generated from protobuf enum PROMOTING = 9; + */ + const PROMOTING = 9; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::STOPPED => 'STOPPED', + self::PBEMPTY => 'EMPTY', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::BOOTSTRAPPING => 'BOOTSTRAPPING', + self::MAINTENANCE => 'MAINTENANCE', + self::PROMOTING => 'PROMOTING', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php new file mode 100644 index 000000000000..b494dbbb0aa3 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php @@ -0,0 +1,66 @@ +google.cloud.alloydb.v1alpha.ClusterView + */ +class ClusterView +{ + /** + * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + * + * Generated from protobuf enum CLUSTER_VIEW_UNSPECIFIED = 0; + */ + const CLUSTER_VIEW_UNSPECIFIED = 0; + /** + * BASIC server responses include all the relevant cluster details, excluding + * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific + * fields. The default value. + * + * Generated from protobuf enum CLUSTER_VIEW_BASIC = 1; + */ + const CLUSTER_VIEW_BASIC = 1; + /** + * CONTINUOUS_BACKUP response returns all the fields from BASIC plus + * the earliest restorable time if continuous backups are enabled. + * May increase latency. + * + * Generated from protobuf enum CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + const CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + + private static $valueToName = [ + self::CLUSTER_VIEW_UNSPECIFIED => 'CLUSTER_VIEW_UNSPECIFIED', + self::CLUSTER_VIEW_BASIC => 'CLUSTER_VIEW_BASIC', + self::CLUSTER_VIEW_CONTINUOUS_BACKUP => 'CLUSTER_VIEW_CONTINUOUS_BACKUP', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php new file mode 100644 index 000000000000..07ab7dcfa02f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php @@ -0,0 +1,195 @@ +google.cloud.alloydb.v1alpha.ConnectionInfo + */ +class ConnectionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ip_address = ''; + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated + */ + private $pem_certificate_chain; + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $instance_uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * @type string $ip_address + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * @type string $instance_uid + * Output only. The unique ID of the Instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getPemCertificateChain() + { + @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); + return $this->pem_certificate_chain; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setPemCertificateChain($var) + { + @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->pem_certificate_chain = $arr; + + return $this; + } + + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getInstanceUid() + { + return $this->instance_uid; + } + + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setInstanceUid($var) + { + GPBUtil::checkString($var, True); + $this->instance_uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php new file mode 100644 index 000000000000..97fcd1aae35d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php @@ -0,0 +1,176 @@ +google.cloud.alloydb.v1alpha.ContinuousBackupConfig + */ +class ContinuousBackupConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + */ + protected $recovery_window_days = 0; + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + */ + protected $encryption_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Whether ContinuousBackup is enabled. + * @type int $recovery_window_days + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + * @return int + */ + public function getRecoveryWindowDays() + { + return $this->recovery_window_days; + } + + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + * @param int $var + * @return $this + */ + public function setRecoveryWindowDays($var) + { + GPBUtil::checkInt32($var); + $this->recovery_window_days = $var; + + return $this; + } + + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; + * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php new file mode 100644 index 000000000000..ec1861fc8ef7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php @@ -0,0 +1,216 @@ +google.cloud.alloydb.v1alpha.ContinuousBackupInfo + */ +class ContinuousBackupInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $enabled_time = null; + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $schedule; + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $earliest_restorable_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $encryption_info + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * @type \Google\Protobuf\Timestamp $enabled_time + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * @type array|\Google\Protobuf\Internal\RepeatedField $schedule + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * @type \Google\Protobuf\Timestamp $earliest_restorable_time + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEnabledTime() + { + return $this->enabled_time; + } + + public function hasEnabledTime() + { + return isset($this->enabled_time); + } + + public function clearEnabledTime() + { + unset($this->enabled_time); + } + + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEnabledTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->enabled_time = $var; + + return $this; + } + + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchedule() + { + return $this->schedule; + } + + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchedule($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->schedule = $arr; + + return $this; + } + + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestRestorableTime() + { + return $this->earliest_restorable_time; + } + + public function hasEarliestRestorableTime() + { + return isset($this->earliest_restorable_time); + } + + public function clearEarliestRestorableTime() + { + unset($this->earliest_restorable_time); + } + + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestRestorableTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_restorable_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php new file mode 100644 index 000000000000..81a495e66d86 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php @@ -0,0 +1,119 @@ +google.cloud.alloydb.v1alpha.ContinuousBackupSource + */ +class ContinuousBackupSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = ''; + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $point_in_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * @type \Google\Protobuf\Timestamp $point_in_time + * Required. The point in time to restore to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCluster() + { + return $this->cluster; + } + + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkString($var, True); + $this->cluster = $var; + + return $this; + } + + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPointInTime() + { + return $this->point_in_time; + } + + public function hasPointInTime() + { + return isset($this->point_in_time); + } + + public function clearPointInTime() + { + unset($this->point_in_time); + } + + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPointInTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->point_in_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php new file mode 100644 index 000000000000..4820325840a1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php @@ -0,0 +1,257 @@ +google.cloud.alloydb.v1alpha.CreateBackupRequest + */ +class CreateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $backup_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1alpha\Backup $backup + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupId() + { + return $this->backup_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupId($var) + { + GPBUtil::checkString($var, True); + $this->backup_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Backup::class); + $this->backup = $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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php new file mode 100644 index 000000000000..758b0dc83a8f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php @@ -0,0 +1,265 @@ +google.cloud.alloydb.v1alpha.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * 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 location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); + $this->cluster = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php new file mode 100644 index 000000000000..abfc159d2310 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php @@ -0,0 +1,265 @@ +google.cloud.alloydb.v1alpha.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @type string $instance_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance $instance + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance::class); + $this->instance = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php new file mode 100644 index 000000000000..c54bd2203db5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1alpha.CreateInstanceRequests + */ +class CreateInstanceRequests extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $create_instance_requests; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $create_instance_requests + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCreateInstanceRequests() + { + return $this->create_instance_requests; + } + + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCreateInstanceRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequest::class); + $this->create_instance_requests = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php new file mode 100644 index 000000000000..2b71e6a4fda9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php @@ -0,0 +1,263 @@ +google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + */ +class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object (the secondary cluster). + * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster + * Required. Configuration of the requesting object (the secondary cluster). + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * 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 location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * 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. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); + $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php new file mode 100644 index 000000000000..853cb6456819 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php @@ -0,0 +1,265 @@ +google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + */ +class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @type string $instance_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance $instance + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance::class); + $this->instance = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php new file mode 100644 index 000000000000..b08ef823dff2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php @@ -0,0 +1,257 @@ +google.cloud.alloydb.v1alpha.CreateUserRequest + */ +class CreateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $user_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1alpha\User $user + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\User::class); + $this->user = $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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php new file mode 100644 index 000000000000..c451ba37c278 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php @@ -0,0 +1,68 @@ +google.cloud.alloydb.v1alpha.DatabaseVersion + */ +class DatabaseVersion +{ + /** + * This is an unknown database version. + * + * Generated from protobuf enum DATABASE_VERSION_UNSPECIFIED = 0; + */ + const DATABASE_VERSION_UNSPECIFIED = 0; + /** + * DEPRECATED - The database version is Postgres 13. + * + * Generated from protobuf enum POSTGRES_13 = 1 [deprecated = true]; + */ + const POSTGRES_13 = 1; + /** + * The database version is Postgres 14. + * + * Generated from protobuf enum POSTGRES_14 = 2; + */ + const POSTGRES_14 = 2; + /** + * The database version is Postgres 15. + * + * Generated from protobuf enum POSTGRES_15 = 3; + */ + const POSTGRES_15 = 3; + + private static $valueToName = [ + self::DATABASE_VERSION_UNSPECIFIED => 'DATABASE_VERSION_UNSPECIFIED', + self::POSTGRES_13 => 'POSTGRES_13', + self::POSTGRES_14 => 'POSTGRES_14', + self::POSTGRES_15 => 'POSTGRES_15', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php new file mode 100644 index 000000000000..b8b0c1eb20f9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php @@ -0,0 +1,225 @@ +google.cloud.alloydb.v1alpha.DeleteBackupRequest + */ +class DeleteBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * + * 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type string $etag + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * + * 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. For the required format, see the comment on + * the Backup.name field. + * + * 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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php new file mode 100644 index 000000000000..95797925a3af --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php @@ -0,0 +1,259 @@ +google.cloud.alloydb.v1alpha.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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 = ''; + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @type bool $force + * Optional. Whether to cascade delete child instances for given cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php new file mode 100644 index 000000000000..48157d8dd4f4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php @@ -0,0 +1,225 @@ +google.cloud.alloydb.v1alpha.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type string $etag + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php new file mode 100644 index 000000000000..ce3b7ef1a424 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php @@ -0,0 +1,183 @@ +google.cloud.alloydb.v1alpha.DeleteUserRequest + */ +class DeleteUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php new file mode 100644 index 000000000000..35dd0478dce4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1alpha.EncryptionConfig + */ +class EncryptionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + */ + protected $kms_key_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kms_key_name + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php new file mode 100644 index 000000000000..7d838620487d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1alpha.EncryptionInfo + */ +class EncryptionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_type = 0; + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $kms_key_versions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $encryption_type + * Output only. Type of encryption. + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_versions + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEncryptionType() + { + return $this->encryption_type; + } + + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEncryptionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo\Type::class); + $this->encryption_type = $var; + + return $this; + } + + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeyVersions() + { + return $this->kms_key_versions; + } + + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeyVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_key_versions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php new file mode 100644 index 000000000000..91bf8c965574 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php @@ -0,0 +1,66 @@ +google.cloud.alloydb.v1alpha.EncryptionInfo.Type + */ +class Type +{ + /** + * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The data is encrypted at rest with a key that is fully managed by Google. + * No key version will be populated. This is the default state. + * + * Generated from protobuf enum GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + const GOOGLE_DEFAULT_ENCRYPTION = 1; + /** + * The data is encrypted at rest with a key that is managed by the customer. + * KMS key versions will be populated. + * + * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + const CUSTOMER_MANAGED_ENCRYPTION = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::GOOGLE_DEFAULT_ENCRYPTION => 'GOOGLE_DEFAULT_ENCRYPTION', + self::CUSTOMER_MANAGED_ENCRYPTION => 'CUSTOMER_MANAGED_ENCRYPTION', + ]; + + 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(Type::class, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo_Type::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php new file mode 100644 index 000000000000..988fd61608e5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php @@ -0,0 +1,183 @@ +google.cloud.alloydb.v1alpha.FailoverInstanceRequest + */ +class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php new file mode 100644 index 000000000000..ca404e21d3e2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php @@ -0,0 +1,321 @@ +google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + */ +class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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 = ''; + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * + * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $pem_csr = ''; + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cert_duration = null; + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $public_key = ''; + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_metadata_exchange = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @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). + * @type string $pem_csr + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * @type \Google\Protobuf\Duration $cert_duration + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * @type string $public_key + * Optional. The public key from the client. + * @type bool $use_metadata_exchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * 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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * 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. 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; + } + + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * + * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getPemCsr() + { + @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); + return $this->pem_csr; + } + + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * + * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setPemCsr($var) + { + @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->pem_csr = $var; + + return $this; + } + + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getCertDuration() + { + return $this->cert_duration; + } + + public function hasCertDuration() + { + return isset($this->cert_duration); + } + + public function clearCertDuration() + { + unset($this->cert_duration); + } + + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setCertDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->cert_duration = $var; + + return $this; + } + + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPublicKey() + { + return $this->public_key; + } + + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPublicKey($var) + { + GPBUtil::checkString($var, True); + $this->public_key = $var; + + return $this; + } + + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseMetadataExchange() + { + return $this->use_metadata_exchange; + } + + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseMetadataExchange($var) + { + GPBUtil::checkBool($var); + $this->use_metadata_exchange = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php new file mode 100644 index 000000000000..2e9cea857d81 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php @@ -0,0 +1,139 @@ +google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + */ +class GenerateClientCertificateResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The pem-encoded, signed X.509 certificate. + * + * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $pem_certificate = ''; + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $pem_certificate_chain; + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ca_cert = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pem_certificate + * Output only. The pem-encoded, signed X.509 certificate. + * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * @type string $ca_cert + * Optional. The pem-encoded cluster ca X.509 certificate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The pem-encoded, signed X.509 certificate. + * + * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPemCertificate() + { + return $this->pem_certificate; + } + + /** + * Output only. The pem-encoded, signed X.509 certificate. + * + * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPemCertificate($var) + { + GPBUtil::checkString($var, True); + $this->pem_certificate = $var; + + return $this; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPemCertificateChain() + { + return $this->pem_certificate_chain; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPemCertificateChain($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->pem_certificate_chain = $arr; + + return $this; + } + + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCaCert() + { + return $this->ca_cert; + } + + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCaCert($var) + { + GPBUtil::checkString($var, True); + $this->ca_cert = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php new file mode 100644 index 000000000000..41131a0add13 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php @@ -0,0 +1,67 @@ +google.cloud.alloydb.v1alpha.GetBackupRequest + */ +class GetBackupRequest 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 = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::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; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php new file mode 100644 index 000000000000..5cee7559048f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php @@ -0,0 +1,109 @@ +google.cloud.alloydb.v1alpha.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @type int $view + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\ClusterView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php new file mode 100644 index 000000000000..9cd7eb1c16c1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php @@ -0,0 +1,145 @@ +google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + */ +class GetConnectionInfoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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 = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * 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 name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * 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. 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php new file mode 100644 index 000000000000..98eaade41c89 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1alpha.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.InstanceView view = 2; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @type int $view + * The view of the instance to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.InstanceView view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\InstanceView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php new file mode 100644 index 000000000000..63713ddc1371 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1alpha.GetUserRequest + */ +class GetUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php new file mode 100644 index 000000000000..96ba7b2d392d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php @@ -0,0 +1,221 @@ +google.cloud.alloydb.v1alpha.InjectFaultRequest + */ +class InjectFaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fault_type = 0; + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $fault_type + * Required. The type of fault to be injected in an instance. + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getFaultType() + { + return $this->fault_type; + } + + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setFaultType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\InjectFaultRequest\FaultType::class); + $this->fault_type = $var; + + return $this; + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php new file mode 100644 index 000000000000..891e891b310f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php @@ -0,0 +1,58 @@ +google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType + */ +class FaultType +{ + /** + * The fault type is unknown. + * + * Generated from protobuf enum FAULT_TYPE_UNSPECIFIED = 0; + */ + const FAULT_TYPE_UNSPECIFIED = 0; + /** + * Stop the VM + * + * Generated from protobuf enum STOP_VM = 1; + */ + const STOP_VM = 1; + + private static $valueToName = [ + self::FAULT_TYPE_UNSPECIFIED => 'FAULT_TYPE_UNSPECIFIED', + self::STOP_VM => 'STOP_VM', + ]; + + 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(FaultType::class, \Google\Cloud\AlloyDb\V1alpha\InjectFaultRequest_FaultType::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php new file mode 100644 index 000000000000..4fe821be9c40 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php @@ -0,0 +1,1112 @@ +google.cloud.alloydb.v1alpha.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Output only. The current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_type = 0; + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + */ + protected $machine_config = null; + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + */ + protected $availability_type = 0; + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + */ + protected $gce_zone = ''; + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + */ + private $database_flags; + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $writable_node = null; + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $nodes; + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + */ + protected $query_insights_config = null; + /** + * Read pool specific config. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + */ + protected $read_pool_config = null; + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ip_address = ''; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + */ + private $annotations; + /** + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + protected $update_policy = null; + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_connection_config = null; + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 24; + */ + protected $satisfies_pzs = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * @type string $display_name + * User-settable and human-readable display name for the Instance. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current serving state of the instance. + * @type int $instance_type + * Required. The type of the instance. Specified at creation time. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig $machine_config + * Configurations for the machines that host the underlying + * database engine. + * @type int $availability_type + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * @type string $gce_zone + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * @type array|\Google\Protobuf\Internal\MapField $database_flags + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance\Node $writable_node + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * @type array<\Google\Cloud\AlloyDb\V1alpha\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $nodes + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig $query_insights_config + * Configuration for query insights. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig $read_pool_config + * Read pool specific config. + * @type string $ip_address + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy $update_policy + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig $client_connection_config + * Optional. Client connection specific configurations + * @type bool $satisfies_pzs + * Reserved for future use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @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 current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getInstanceType() + { + return $this->instance_type; + } + + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setInstanceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\InstanceType::class); + $this->instance_type = $var; + + return $this; + } + + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig|null + */ + public function getMachineConfig() + { + return $this->machine_config; + } + + public function hasMachineConfig() + { + return isset($this->machine_config); + } + + public function clearMachineConfig() + { + unset($this->machine_config); + } + + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig $var + * @return $this + */ + public function setMachineConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig::class); + $this->machine_config = $var; + + return $this; + } + + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * @return int + */ + public function getAvailabilityType() + { + return $this->availability_type; + } + + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; + * @param int $var + * @return $this + */ + public function setAvailabilityType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\AvailabilityType::class); + $this->availability_type = $var; + + return $this; + } + + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + * @return string + */ + public function getGceZone() + { + return $this->gce_zone; + } + + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + * @param string $var + * @return $this + */ + public function setGceZone($var) + { + GPBUtil::checkString($var, True); + $this->gce_zone = $var; + + return $this; + } + + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDatabaseFlags() + { + return $this->database_flags; + } + + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDatabaseFlags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->database_flags = $arr; + + return $this; + } + + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance\Node|null + */ + public function getWritableNode() + { + return $this->writable_node; + } + + public function hasWritableNode() + { + return isset($this->writable_node); + } + + public function clearWritableNode() + { + unset($this->writable_node); + } + + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance\Node $var + * @return $this + */ + public function setWritableNode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\Node::class); + $this->writable_node = $var; + + return $this; + } + + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\AlloyDb\V1alpha\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Instance\Node::class); + $this->nodes = $arr; + + return $this; + } + + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig|null + */ + public function getQueryInsightsConfig() + { + return $this->query_insights_config; + } + + public function hasQueryInsightsConfig() + { + return isset($this->query_insights_config); + } + + public function clearQueryInsightsConfig() + { + unset($this->query_insights_config); + } + + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig $var + * @return $this + */ + public function setQueryInsightsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig::class); + $this->query_insights_config = $var; + + return $this; + } + + /** + * Read pool specific config. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig|null + */ + public function getReadPoolConfig() + { + return $this->read_pool_config; + } + + public function hasReadPoolConfig() + { + return isset($this->read_pool_config); + } + + public function clearReadPoolConfig() + { + unset($this->read_pool_config); + } + + /** + * Read pool specific config. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig $var + * @return $this + */ + public function setReadPoolConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig::class); + $this->read_pool_config = $var; + + return $this; + } + + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy|null + */ + public function getUpdatePolicy() + { + return $this->update_policy; + } + + public function hasUpdatePolicy() + { + return isset($this->update_policy); + } + + public function clearUpdatePolicy() + { + unset($this->update_policy); + } + + /** + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy $var + * @return $this + */ + public function setUpdatePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy::class); + $this->update_policy = $var; + + return $this; + } + + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig|null + */ + public function getClientConnectionConfig() + { + return $this->client_connection_config; + } + + public function hasClientConnectionConfig() + { + return isset($this->client_connection_config); + } + + public function clearClientConnectionConfig() + { + unset($this->client_connection_config); + } + + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig $var + * @return $this + */ + public function setClientConnectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig::class); + $this->client_connection_config = $var; + + return $this; + } + + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 24; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 24; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php new file mode 100644 index 000000000000..5776d323dde0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php @@ -0,0 +1,68 @@ +google.cloud.alloydb.v1alpha.Instance.AvailabilityType + */ +class AvailabilityType +{ + /** + * This is an unknown Availability type. + * + * Generated from protobuf enum AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + const AVAILABILITY_TYPE_UNSPECIFIED = 0; + /** + * Zonal available instance. + * + * Generated from protobuf enum ZONAL = 1; + */ + const ZONAL = 1; + /** + * Regional (or Highly) available instance. + * + * Generated from protobuf enum REGIONAL = 2; + */ + const REGIONAL = 2; + + private static $valueToName = [ + self::AVAILABILITY_TYPE_UNSPECIFIED => 'AVAILABILITY_TYPE_UNSPECIFIED', + self::ZONAL => 'ZONAL', + self::REGIONAL => 'REGIONAL', + ]; + + 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(AvailabilityType::class, \Google\Cloud\AlloyDb\V1alpha\Instance_AvailabilityType::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php new file mode 100644 index 000000000000..14ecee7f2bd3 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php @@ -0,0 +1,118 @@ +google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + */ +class ClientConnectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $require_connectors = false; + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $require_connectors + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * @type \Google\Cloud\AlloyDb\V1alpha\SslConfig $ssl_config + * Optional. SSL config option for this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequireConnectors() + { + return $this->require_connectors; + } + + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequireConnectors($var) + { + GPBUtil::checkBool($var); + $this->require_connectors = $var; + + return $this; + } + + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1alpha\SslConfig|null + */ + public function getSslConfig() + { + return $this->ssl_config; + } + + public function hasSslConfig() + { + return isset($this->ssl_config); + } + + public function clearSslConfig() + { + unset($this->ssl_config); + } + + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1alpha\SslConfig $var + * @return $this + */ + public function setSslConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig::class); + $this->ssl_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClientConnectionConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_ClientConnectionConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php new file mode 100644 index 000000000000..6031f901d1fa --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1alpha.Instance.InstanceType + */ +class InstanceType +{ + /** + * The type of the instance is unknown. + * + * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; + */ + const INSTANCE_TYPE_UNSPECIFIED = 0; + /** + * PRIMARY instances support read and write operations. + * + * Generated from protobuf enum PRIMARY = 1; + */ + const PRIMARY = 1; + /** + * READ POOL instances support read operations only. Each read pool instance + * consists of one or more homogeneous nodes. + * * Read pool of size 1 can only have zonal availability. + * * Read pools with node count of 2 or more can have regional + * availability (nodes are present in 2 or more zones in a region). + * + * Generated from protobuf enum READ_POOL = 2; + */ + const READ_POOL = 2; + /** + * SECONDARY instances support read operations only. SECONDARY instance + * is a cross-region read replica + * + * Generated from protobuf enum SECONDARY = 3; + */ + const SECONDARY = 3; + + private static $valueToName = [ + self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', + self::PRIMARY => 'PRIMARY', + self::READ_POOL => 'READ_POOL', + self::SECONDARY => 'SECONDARY', + ]; + + 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\AlloyDb\V1alpha\Instance_InstanceType::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php new file mode 100644 index 000000000000..655df1f93235 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1alpha.Instance.MachineConfig + */ +class MachineConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + */ + protected $cpu_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $cpu_count + * The number of CPU's in the VM instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + * @return int + */ + public function getCpuCount() + { + return $this->cpu_count; + } + + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + * @param int $var + * @return $this + */ + public function setCpuCount($var) + { + GPBUtil::checkInt32($var); + $this->cpu_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MachineConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_MachineConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php new file mode 100644 index 000000000000..7614f7c0d9b7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php @@ -0,0 +1,186 @@ +google.cloud.alloydb.v1alpha.Instance.Node + */ +class Node extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + */ + protected $zone_id = ''; + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + */ + protected $id = ''; + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + */ + protected $ip = ''; + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + */ + protected $state = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone_id + * The Compute Engine zone of the VM e.g. "us-central1-b". + * @type string $id + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * @type string $ip + * The private IP address of the VM e.g. "10.57.0.34". + * @type string $state + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + * @return string + */ + public function getZoneId() + { + return $this->zone_id; + } + + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + * @param string $var + * @return $this + */ + public function setZoneId($var) + { + GPBUtil::checkString($var, True); + $this->zone_id = $var; + + return $this; + } + + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + * @return string + */ + public function getIp() + { + return $this->ip; + } + + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + * @param string $var + * @return $this + */ + public function setIp($var) + { + GPBUtil::checkString($var, True); + $this->ip = $var; + + return $this; + } + + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Node::class, \Google\Cloud\AlloyDb\V1alpha\Instance_Node::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php new file mode 100644 index 000000000000..cc86f298b500 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php @@ -0,0 +1,222 @@ +google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + */ +class QueryInsightsInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + */ + protected $record_application_tags = null; + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + */ + protected $record_client_address = null; + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + */ + protected $query_string_length = 0; + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + */ + protected $query_plans_per_minute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $record_application_tags + * Record application tags for an instance. + * This flag is turned "on" by default. + * @type bool $record_client_address + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * @type int $query_string_length + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * @type int $query_plans_per_minute + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + * @return bool + */ + public function getRecordApplicationTags() + { + return isset($this->record_application_tags) ? $this->record_application_tags : false; + } + + public function hasRecordApplicationTags() + { + return isset($this->record_application_tags); + } + + public function clearRecordApplicationTags() + { + unset($this->record_application_tags); + } + + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + * @param bool $var + * @return $this + */ + public function setRecordApplicationTags($var) + { + GPBUtil::checkBool($var); + $this->record_application_tags = $var; + + return $this; + } + + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + * @return bool + */ + public function getRecordClientAddress() + { + return isset($this->record_client_address) ? $this->record_client_address : false; + } + + public function hasRecordClientAddress() + { + return isset($this->record_client_address); + } + + public function clearRecordClientAddress() + { + unset($this->record_client_address); + } + + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + * @param bool $var + * @return $this + */ + public function setRecordClientAddress($var) + { + GPBUtil::checkBool($var); + $this->record_client_address = $var; + + return $this; + } + + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + * @return int + */ + public function getQueryStringLength() + { + return $this->query_string_length; + } + + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + * @param int $var + * @return $this + */ + public function setQueryStringLength($var) + { + GPBUtil::checkUint32($var); + $this->query_string_length = $var; + + return $this; + } + + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + * @return int + */ + public function getQueryPlansPerMinute() + { + return isset($this->query_plans_per_minute) ? $this->query_plans_per_minute : 0; + } + + public function hasQueryPlansPerMinute() + { + return isset($this->query_plans_per_minute); + } + + public function clearQueryPlansPerMinute() + { + unset($this->query_plans_per_minute); + } + + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + * @param int $var + * @return $this + */ + public function setQueryPlansPerMinute($var) + { + GPBUtil::checkUint32($var); + $this->query_plans_per_minute = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryInsightsInstanceConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_QueryInsightsInstanceConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php new file mode 100644 index 000000000000..bab7bd31c641 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + */ +class ReadPoolConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $node_count + * Read capacity, i.e. number of nodes in a read pool instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + * @return int + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + * @param int $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt32($var); + $this->node_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReadPoolConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_ReadPoolConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php new file mode 100644 index 000000000000..9f54198a1d9e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php @@ -0,0 +1,112 @@ +google.cloud.alloydb.v1alpha.Instance.State + */ +class State +{ + /** + * The state of the instance is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The instance is active and running. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The instance is stopped. Instance name and IP resources are preserved. + * + * Generated from protobuf enum STOPPED = 2; + */ + const STOPPED = 2; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 3; + */ + const CREATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The instance is down for maintenance. + * + * Generated from protobuf enum MAINTENANCE = 5; + */ + const MAINTENANCE = 5; + /** + * The creation of the instance failed or a fatal error occurred during + * an operation on the instance. + * Note: Instances in this state would tried to be auto-repaired. And + * Customers should be able to restart, update or delete these instances. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that + * index unused in case that state also needs to exposed via consumer apis + * in future. + * The instance has been configured to sync data from some other source. + * + * Generated from protobuf enum BOOTSTRAPPING = 8; + */ + const BOOTSTRAPPING = 8; + /** + * The instance is being promoted. + * + * Generated from protobuf enum PROMOTING = 9; + */ + const PROMOTING = 9; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::STOPPED => 'STOPPED', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::MAINTENANCE => 'MAINTENANCE', + self::FAILED => 'FAILED', + self::BOOTSTRAPPING => 'BOOTSTRAPPING', + self::PROMOTING => 'PROMOTING', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1alpha\Instance_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php new file mode 100644 index 000000000000..16e871196953 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + */ +class UpdatePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Mode for updating the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Mode for updating the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Mode for updating the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Mode for updating the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy\Mode::class); + $this->mode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UpdatePolicy::class, \Google\Cloud\AlloyDb\V1alpha\Instance_UpdatePolicy::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php new file mode 100644 index 000000000000..80aa40437feb --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php @@ -0,0 +1,69 @@ +google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode + */ +class Mode +{ + /** + * Mode is unknown. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Least disruptive way to apply the update. + * + * Generated from protobuf enum DEFAULT = 1; + */ + const PBDEFAULT = 1; + /** + * Performs a forced update when applicable. This will be fast but may + * incur a downtime. + * + * Generated from protobuf enum FORCE_APPLY = 2; + */ + const FORCE_APPLY = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::PBDEFAULT => 'DEFAULT', + self::FORCE_APPLY => 'FORCE_APPLY', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\AlloyDb\V1alpha\Instance_UpdatePolicy_Mode::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php new file mode 100644 index 000000000000..823659026d58 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1alpha.InstanceView + */ +class InstanceView +{ + /** + * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + * + * Generated from protobuf enum INSTANCE_VIEW_UNSPECIFIED = 0; + */ + const INSTANCE_VIEW_UNSPECIFIED = 0; + /** + * BASIC server responses for a primary or read instance include all the + * relevant instance details, excluding the details of each node in the + * instance. The default value. + * + * Generated from protobuf enum INSTANCE_VIEW_BASIC = 1; + */ + const INSTANCE_VIEW_BASIC = 1; + /** + * FULL response is equivalent to BASIC for primary instance (for now). + * For read pool instance, this includes details of each node in the pool. + * + * Generated from protobuf enum INSTANCE_VIEW_FULL = 2; + */ + const INSTANCE_VIEW_FULL = 2; + + private static $valueToName = [ + self::INSTANCE_VIEW_UNSPECIFIED => 'INSTANCE_VIEW_UNSPECIFIED', + self::INSTANCE_VIEW_BASIC => 'INSTANCE_VIEW_BASIC', + self::INSTANCE_VIEW_FULL => 'INSTANCE_VIEW_FULL', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php new file mode 100644 index 000000000000..4043325e0bef --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php @@ -0,0 +1,207 @@ +google.cloud.alloydb.v1alpha.ListBackupsRequest + */ +class ListBackupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListBackupsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListBackupsRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListBackupsRequest + * + * 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. Parent value for ListBackupsRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php new file mode 100644 index 000000000000..e41b58c193b0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1alpha.ListBackupsResponse + */ +class ListBackupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + */ + private $backups; + /** + * 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\AlloyDb\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $backups + * The list of Backup + * @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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackups() + { + return $this->backups; + } + + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; + * @param array<\Google\Cloud\AlloyDb\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Backup::class); + $this->backups = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php new file mode 100644 index 000000000000..693183573339 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php @@ -0,0 +1,219 @@ +google.cloud.alloydb.v1alpha.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * @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 + * 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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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 name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php new file mode 100644 index 000000000000..f64218d54048 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1alpha.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + */ + private $clusters; + /** + * 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\AlloyDb\V1alpha\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters + * The list of Cluster + * @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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; + * @param array<\Google\Cloud\AlloyDb\V1alpha\Cluster>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); + $this->clusters = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php new file mode 100644 index 000000000000..6393c825a01a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php @@ -0,0 +1,227 @@ +google.cloud.alloydb.v1alpha.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * @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 + * 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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php new file mode 100644 index 000000000000..5ef3b7494243 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1alpha.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + */ + private $instances; + /** + * 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\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of Instance + * @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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; + * @param array<\Google\Cloud\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Instance::class); + $this->instances = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php new file mode 100644 index 000000000000..d264b94b533b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php @@ -0,0 +1,159 @@ +google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + */ +class ListSupportedDatabaseFlagsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * 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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php new file mode 100644 index 000000000000..69ac851214b6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php @@ -0,0 +1,101 @@ +google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + */ +class ListSupportedDatabaseFlagsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + */ + private $supported_database_flags; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $supported_database_flags + * The list of SupportedDatabaseFlags. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedDatabaseFlags() + { + return $this->supported_database_flags; + } + + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; + * @param array<\Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedDatabaseFlags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag::class); + $this->supported_database_flags = $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; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php new file mode 100644 index 000000000000..53728f69e137 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php @@ -0,0 +1,207 @@ +google.cloud.alloydb.v1alpha.ListUsersRequest + */ +class ListUsersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListUsersRequest + * + * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListUsersRequest + * @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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListUsersRequest + * + * 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. Parent value for ListUsersRequest + * + * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php new file mode 100644 index 000000000000..ad1058afc0d2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1alpha.ListUsersResponse + */ +class ListUsersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + private $users; + /** + * 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\AlloyDb\V1alpha\User>|\Google\Protobuf\Internal\RepeatedField $users + * The list of User + * @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\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.User users = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsers() + { + return $this->users; + } + + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.User users = 1; + * @param array<\Google\Cloud\AlloyDb\V1alpha\User>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\User::class); + $this->users = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php new file mode 100644 index 000000000000..be816a1f56cb --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php @@ -0,0 +1,144 @@ +google.cloud.alloydb.v1alpha.MigrationSource + */ +class MigrationSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $host_port = ''; + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reference_id = ''; + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_port + * Output only. The host and port of the on-premises instance in host:port + * format + * @type string $reference_id + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * @type int $source_type + * Output only. Type of migration source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getHostPort() + { + return $this->host_port; + } + + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setHostPort($var) + { + GPBUtil::checkString($var, True); + $this->host_port = $var; + + return $this; + } + + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReferenceId() + { + return $this->reference_id; + } + + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReferenceId($var) + { + GPBUtil::checkString($var, True); + $this->reference_id = $var; + + return $this; + } + + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\MigrationSource\MigrationSourceType::class); + $this->source_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php new file mode 100644 index 000000000000..c395671cb399 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php @@ -0,0 +1,57 @@ +google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType + */ +class MigrationSourceType +{ + /** + * Migration source is unknown. + * + * Generated from protobuf enum MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + const MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + /** + * DMS source means the cluster was created via DMS migration job. + * + * Generated from protobuf enum DMS = 1; + */ + const DMS = 1; + + private static $valueToName = [ + self::MIGRATION_SOURCE_TYPE_UNSPECIFIED => 'MIGRATION_SOURCE_TYPE_UNSPECIFIED', + self::DMS => 'DMS', + ]; + + 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(MigrationSourceType::class, \Google\Cloud\AlloyDb\V1alpha\MigrationSource_MigrationSourceType::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php new file mode 100644 index 000000000000..d45e78a3391a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php @@ -0,0 +1,349 @@ +google.cloud.alloydb.v1alpha.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 = ''; + protected $request_specific; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata $batch_create_instances_metadata + * Output only. BatchCreateInstances related metadata. + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Output only. BatchCreateInstances related metadata. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata|null + */ + public function getBatchCreateInstancesMetadata() + { + return $this->readOneof(8); + } + + public function hasBatchCreateInstancesMetadata() + { + return $this->hasOneof(8); + } + + /** + * Output only. BatchCreateInstances related metadata. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata $var + * @return $this + */ + public function setBatchCreateInstancesMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * 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; + } + + /** + * @return string + */ + public function getRequestSpecific() + { + return $this->whichOneof("request_specific"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php new file mode 100644 index 000000000000..6958d1967903 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php @@ -0,0 +1,225 @@ +google.cloud.alloydb.v1alpha.PromoteClusterRequest + */ +class PromoteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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 = ''; + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php new file mode 100644 index 000000000000..459a9f6c3d3c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php @@ -0,0 +1,181 @@ +google.cloud.alloydb.v1alpha.RestartInstanceRequest + */ +class RestartInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php new file mode 100644 index 000000000000..dcde34c3116f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php @@ -0,0 +1,344 @@ +google.cloud.alloydb.v1alpha.RestoreClusterRequest + */ +class RestoreClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1alpha\BackupSource $backup_source + * Backup source. + * @type \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource $continuous_backup_source + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Backup source. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * @return \Google\Cloud\AlloyDb\V1alpha\BackupSource|null + */ + public function getBackupSource() + { + return $this->readOneof(4); + } + + public function hasBackupSource() + { + return $this->hasOneof(4); + } + + /** + * Backup source. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; + * @param \Google\Cloud\AlloyDb\V1alpha\BackupSource $var + * @return $this + */ + public function setBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\BackupSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * @return \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource|null + */ + public function getContinuousBackupSource() + { + return $this->readOneof(8); + } + + public function hasContinuousBackupSource() + { + return $this->hasOneof(8); + } + + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; + * @param \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource $var + * @return $this + */ + public function setContinuousBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); + $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php new file mode 100644 index 000000000000..d71785650e02 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1alpha.SslConfig + */ +class SslConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_mode = 0; + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ca_source = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $ssl_mode + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * @type int $ca_source + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSslMode() + { + return $this->ssl_mode; + } + + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSslMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig\SslMode::class); + $this->ssl_mode = $var; + + return $this; + } + + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCaSource() + { + return $this->ca_source; + } + + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCaSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig\CaSource::class); + $this->ca_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php new file mode 100644 index 000000000000..a68ee5bbf7c1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php @@ -0,0 +1,58 @@ +google.cloud.alloydb.v1alpha.SslConfig.CaSource + */ +class CaSource +{ + /** + * Certificate Authority (CA) source not specified. Defaults to + * CA_SOURCE_MANAGED. + * + * Generated from protobuf enum CA_SOURCE_UNSPECIFIED = 0; + */ + const CA_SOURCE_UNSPECIFIED = 0; + /** + * Certificate Authority (CA) managed by the AlloyDB Cluster. + * + * Generated from protobuf enum CA_SOURCE_MANAGED = 1; + */ + const CA_SOURCE_MANAGED = 1; + + private static $valueToName = [ + self::CA_SOURCE_UNSPECIFIED => 'CA_SOURCE_UNSPECIFIED', + self::CA_SOURCE_MANAGED => 'CA_SOURCE_MANAGED', + ]; + + 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(CaSource::class, \Google\Cloud\AlloyDb\V1alpha\SslConfig_CaSource::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php new file mode 100644 index 000000000000..796a4cc9a6a7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php @@ -0,0 +1,89 @@ +google.cloud.alloydb.v1alpha.SslConfig.SslMode + */ +class SslMode +{ + /** + * SSL mode not specified. Defaults to ENCRYPTED_ONLY. + * + * Generated from protobuf enum SSL_MODE_UNSPECIFIED = 0; + */ + const SSL_MODE_UNSPECIFIED = 0; + /** + * SSL connections are optional. CA verification not enforced. + * + * Generated from protobuf enum SSL_MODE_ALLOW = 1 [deprecated = true]; + */ + const SSL_MODE_ALLOW = 1; + /** + * SSL connections are required. CA verification not enforced. + * Clients may use locally self-signed certificates (default psql client + * behavior). + * + * Generated from protobuf enum SSL_MODE_REQUIRE = 2 [deprecated = true]; + */ + const SSL_MODE_REQUIRE = 2; + /** + * SSL connections are required. CA verification enforced. + * Clients must have certificates signed by a Cluster CA, e.g. via + * GenerateClientCertificate. + * + * Generated from protobuf enum SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + */ + const SSL_MODE_VERIFY_CA = 3; + /** + * SSL connections are optional. CA verification not enforced. + * + * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + /** + * SSL connections are required. CA verification not enforced. + * + * Generated from protobuf enum ENCRYPTED_ONLY = 5; + */ + const ENCRYPTED_ONLY = 5; + + private static $valueToName = [ + self::SSL_MODE_UNSPECIFIED => 'SSL_MODE_UNSPECIFIED', + self::SSL_MODE_ALLOW => 'SSL_MODE_ALLOW', + self::SSL_MODE_REQUIRE => 'SSL_MODE_REQUIRE', + self::SSL_MODE_VERIFY_CA => 'SSL_MODE_VERIFY_CA', + self::ALLOW_UNENCRYPTED_AND_ENCRYPTED => 'ALLOW_UNENCRYPTED_AND_ENCRYPTED', + self::ENCRYPTED_ONLY => 'ENCRYPTED_ONLY', + ]; + + 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(SslMode::class, \Google\Cloud\AlloyDb\V1alpha\SslConfig_SslMode::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php new file mode 100644 index 000000000000..c9fb2230b3be --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php @@ -0,0 +1,337 @@ +google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + */ +class SupportedDatabaseFlag extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + */ + protected $flag_name = ''; + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + */ + protected $value_type = 0; + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + */ + protected $accepts_multiple_values = false; + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + */ + private $supported_db_versions; + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + */ + protected $requires_db_restart = false; + protected $restrictions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions $string_restrictions + * Restriction on STRING type value. + * @type \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions $integer_restrictions + * Restriction on INTEGER type value. + * @type string $name + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * @type string $flag_name + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * @type int $value_type + * @type bool $accepts_multiple_values + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_db_versions + * Major database engine versions for which this flag is supported. + * @type bool $requires_db_restart + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Restriction on STRING type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * @return \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions|null + */ + public function getStringRestrictions() + { + return $this->readOneof(7); + } + + public function hasStringRestrictions() + { + return $this->hasOneof(7); + } + + /** + * Restriction on STRING type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * @param \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions $var + * @return $this + */ + public function setStringRestrictions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Restriction on INTEGER type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * @return \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions|null + */ + public function getIntegerRestrictions() + { + return $this->readOneof(8); + } + + public function hasIntegerRestrictions() + { + return $this->hasOneof(8); + } + + /** + * Restriction on INTEGER type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * @param \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions $var + * @return $this + */ + public function setIntegerRestrictions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + * @return string + */ + public function getFlagName() + { + return $this->flag_name; + } + + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + * @param string $var + * @return $this + */ + public function setFlagName($var) + { + GPBUtil::checkString($var, True); + $this->flag_name = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + * @return bool + */ + public function getAcceptsMultipleValues() + { + return $this->accepts_multiple_values; + } + + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + * @param bool $var + * @return $this + */ + public function setAcceptsMultipleValues($var) + { + GPBUtil::checkBool($var); + $this->accepts_multiple_values = $var; + + return $this; + } + + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedDbVersions() + { + return $this->supported_db_versions; + } + + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedDbVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AlloyDb\V1alpha\DatabaseVersion::class); + $this->supported_db_versions = $arr; + + return $this; + } + + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + * @return bool + */ + public function getRequiresDbRestart() + { + return $this->requires_db_restart; + } + + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + * @param bool $var + * @return $this + */ + public function setRequiresDbRestart($var) + { + GPBUtil::checkBool($var); + $this->requires_db_restart = $var; + + return $this; + } + + /** + * @return string + */ + public function getRestrictions() + { + return $this->whichOneof("restrictions"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php new file mode 100644 index 000000000000..9c66c1e17e3d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php @@ -0,0 +1,178 @@ +google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + */ +class IntegerRestrictions extends \Google\Protobuf\Internal\Message +{ + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + */ + protected $min_value = null; + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + */ + protected $max_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int64Value $min_value + * The minimum value that can be specified, if applicable. + * @type \Google\Protobuf\Int64Value $max_value + * The maximum value that can be specified, if applicable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMinValue() + { + return $this->min_value; + } + + public function hasMinValue() + { + return isset($this->min_value); + } + + public function clearMinValue() + { + unset($this->min_value); + } + + /** + * Returns the unboxed value from getMinValue() + + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @return int|string|null + */ + public function getMinValueUnwrapped() + { + return $this->readWrapperValue("min_value"); + } + + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMinValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->min_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @param int|string|null $var + * @return $this + */ + public function setMinValueUnwrapped($var) + { + $this->writeWrapperValue("min_value", $var); + return $this;} + + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMaxValue() + { + return $this->max_value; + } + + public function hasMaxValue() + { + return isset($this->max_value); + } + + public function clearMaxValue() + { + unset($this->max_value); + } + + /** + * Returns the unboxed value from getMaxValue() + + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @return int|string|null + */ + public function getMaxValueUnwrapped() + { + return $this->readWrapperValue("max_value"); + } + + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMaxValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->max_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @param int|string|null $var + * @return $this + */ + public function setMaxValueUnwrapped($var) + { + $this->writeWrapperValue("max_value", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IntegerRestrictions::class, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag_IntegerRestrictions::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php new file mode 100644 index 000000000000..b5a92631ce5b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php @@ -0,0 +1,74 @@ +google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + */ +class StringRestrictions extends \Google\Protobuf\Internal\Message +{ + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + */ + private $allowed_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedValues() + { + return $this->allowed_values; + } + + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StringRestrictions::class, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag_StringRestrictions::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php new file mode 100644 index 000000000000..26fc5fd68422 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php @@ -0,0 +1,80 @@ +google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType + */ +class ValueType +{ + /** + * This is an unknown flag type. + * + * Generated from protobuf enum VALUE_TYPE_UNSPECIFIED = 0; + */ + const VALUE_TYPE_UNSPECIFIED = 0; + /** + * String type flag. + * + * Generated from protobuf enum STRING = 1; + */ + const STRING = 1; + /** + * Integer type flag. + * + * Generated from protobuf enum INTEGER = 2; + */ + const INTEGER = 2; + /** + * Float type flag. + * + * Generated from protobuf enum FLOAT = 3; + */ + const FLOAT = 3; + /** + * Denotes that the flag does not accept any values. + * + * Generated from protobuf enum NONE = 4; + */ + const NONE = 4; + + private static $valueToName = [ + self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', + self::STRING => 'STRING', + self::INTEGER => 'INTEGER', + self::FLOAT => 'FLOAT', + self::NONE => 'NONE', + ]; + + 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(ValueType::class, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag_ValueType::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php new file mode 100644 index 000000000000..8c09730c698a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php @@ -0,0 +1,287 @@ +google.cloud.alloydb.v1alpha.UpdateBackupRequest + */ +class UpdateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1alpha\Backup $backup + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Backup::class); + $this->backup = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php new file mode 100644 index 000000000000..1a665c7123cd --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php @@ -0,0 +1,291 @@ +google.cloud.alloydb.v1alpha.UpdateClusterRequest + */ +class UpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); + $this->cluster = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php new file mode 100644 index 000000000000..c777ca05973d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php @@ -0,0 +1,291 @@ +google.cloud.alloydb.v1alpha.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1alpha\Instance $instance + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance::class); + $this->instance = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php new file mode 100644 index 000000000000..e424f09f05d4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php @@ -0,0 +1,283 @@ +google.cloud.alloydb.v1alpha.UpdateUserRequest + */ +class UpdateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1alpha\User $user + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allow_missing + * Optional. Allow missing fields in the update mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1alpha\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1alpha\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\User::class); + $this->user = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php new file mode 100644 index 000000000000..84a4fad9db08 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php @@ -0,0 +1,177 @@ +google.cloud.alloydb.v1alpha.User + */ +class User extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $password = ''; + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $database_roles; + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * @type string $password + * Input only. Password for the user. + * @type array|\Google\Protobuf\Internal\RepeatedField $database_roles + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * @type int $user_type + * Optional. Type of this user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatabaseRoles() + { + return $this->database_roles; + } + + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatabaseRoles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->database_roles = $arr; + + return $this; + } + + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getUserType() + { + return $this->user_type; + } + + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setUserType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\User\UserType::class); + $this->user_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php new file mode 100644 index 000000000000..7d3f081756c0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1alpha.User.UserType + */ +class UserType +{ + /** + * Unspecified user type. + * + * Generated from protobuf enum USER_TYPE_UNSPECIFIED = 0; + */ + const USER_TYPE_UNSPECIFIED = 0; + /** + * The default user type that authenticates via password-based + * authentication. + * + * Generated from protobuf enum ALLOYDB_BUILT_IN = 1; + */ + const ALLOYDB_BUILT_IN = 1; + /** + * Database user that can authenticate via IAM-Based authentication. + * + * Generated from protobuf enum ALLOYDB_IAM_USER = 2; + */ + const ALLOYDB_IAM_USER = 2; + + private static $valueToName = [ + self::USER_TYPE_UNSPECIFIED => 'USER_TYPE_UNSPECIFIED', + self::ALLOYDB_BUILT_IN => 'ALLOYDB_BUILT_IN', + self::ALLOYDB_IAM_USER => 'ALLOYDB_IAM_USER', + ]; + + 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(UserType::class, \Google\Cloud\AlloyDb\V1alpha\User_UserType::class); + diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php new file mode 100644 index 000000000000..62343abaae0d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php @@ -0,0 +1,102 @@ +google.cloud.alloydb.v1alpha.UserPassword + */ +class UserPassword extends \Google\Protobuf\Internal\Message +{ + /** + * The database username. + * + * Generated from protobuf field string user = 1; + */ + protected $user = ''; + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + */ + protected $password = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $user + * The database username. + * @type string $password + * The initial password for the user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The database username. + * + * Generated from protobuf field string user = 1; + * @return string + */ + public function getUser() + { + return $this->user; + } + + /** + * The database username. + * + * Generated from protobuf field string user = 1; + * @param string $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkString($var, True); + $this->user = $var; + + return $this; + } + + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php new file mode 100644 index 000000000000..6eee1e0b5d34 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php @@ -0,0 +1,123 @@ +setInstanceType($requestsCreateInstanceRequestsInstanceInstanceType); + $createInstanceRequest = (new CreateInstanceRequest()) + ->setParent($formattedRequestsCreateInstanceRequestsParent) + ->setInstanceId($requestsCreateInstanceRequestsInstanceId) + ->setInstance($requestsCreateInstanceRequestsInstance); + $requestsCreateInstanceRequests = [$createInstanceRequest,]; + $requests = (new CreateInstanceRequests()) + ->setCreateInstanceRequests($requestsCreateInstanceRequests); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchCreateInstancesResponse $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $formattedRequestsCreateInstanceRequestsParent = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + $requestsCreateInstanceRequestsInstanceId = '[INSTANCE_ID]'; + $requestsCreateInstanceRequestsInstanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + batch_create_instances_sample( + $formattedParent, + $formattedRequestsCreateInstanceRequestsParent, + $requestsCreateInstanceRequestsInstanceId, + $requestsCreateInstanceRequestsInstanceInstanceType + ); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php new file mode 100644 index 000000000000..abda32a85b44 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php @@ -0,0 +1,95 @@ +setClusterName($formattedBackupClusterName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $backupId = '[BACKUP_ID]'; + $formattedBackupClusterName = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + create_backup_sample($formattedParent, $backupId, $formattedBackupClusterName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php new file mode 100644 index 000000000000..96ea1b80ebe7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php @@ -0,0 +1,95 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + create_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php new file mode 100644 index 000000000000..e6fe0a81e759 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php @@ -0,0 +1,91 @@ +setInstanceType($instanceInstanceType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = '[INSTANCE_ID]'; + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + create_instance_sample($formattedParent, $instanceId, $instanceInstanceType); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php new file mode 100644 index 000000000000..4047d99f70fe --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php @@ -0,0 +1,96 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + create_secondary_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php new file mode 100644 index 000000000000..3e820205bdae --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php @@ -0,0 +1,91 @@ +setInstanceType($instanceInstanceType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = '[INSTANCE_ID]'; + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + create_secondary_instance_sample($formattedParent, $instanceId, $instanceInstanceType); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php new file mode 100644 index 000000000000..1d9104352ce2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php @@ -0,0 +1,71 @@ +createUser($formattedParent, $userId, $user); + 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 +{ + $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = '[USER_ID]'; + + create_user_sample($formattedParent, $userId); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php new file mode 100644 index 000000000000..a2ff825fbd2f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php @@ -0,0 +1,76 @@ +deleteBackup($formattedName); + $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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + delete_backup_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php new file mode 100644 index 000000000000..c6c523a317f0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php @@ -0,0 +1,76 @@ +deleteCluster($formattedName); + $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php new file mode 100644 index 000000000000..24d9fa333d53 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php @@ -0,0 +1,81 @@ +deleteInstance($formattedName); + $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 = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + delete_instance_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php new file mode 100644 index 000000000000..1538f759473b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php @@ -0,0 +1,65 @@ +deleteUser($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + + delete_user_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php new file mode 100644 index 000000000000..8323a7670394 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php @@ -0,0 +1,86 @@ +failoverInstance($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + failover_instance_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php new file mode 100644 index 000000000000..6609e26c45e9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php @@ -0,0 +1,71 @@ +generateClientCertificate($formattedParent); + 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 +{ + $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + generate_client_certificate_sample($formattedParent); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php new file mode 100644 index 000000000000..2d91670b9f8b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php @@ -0,0 +1,66 @@ +getBackup($formattedName); + 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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + get_backup_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php new file mode 100644 index 000000000000..698c95c92ab1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php @@ -0,0 +1,67 @@ +getCluster($formattedName); + 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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php new file mode 100644 index 000000000000..e6258d304278 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php @@ -0,0 +1,72 @@ +getConnectionInfo($formattedParent); + 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 +{ + $formattedParent = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + get_connection_info_sample($formattedParent); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php new file mode 100644 index 000000000000..4d62ee36ca6b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php @@ -0,0 +1,72 @@ +getInstance($formattedName); + 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 = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + get_instance_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php new file mode 100644 index 000000000000..22d386b5cb08 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php new file mode 100644 index 000000000000..998ee4887eb5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php @@ -0,0 +1,67 @@ +getUser($formattedName); + 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + + get_user_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php new file mode 100644 index 000000000000..d99b91cb6f0f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php @@ -0,0 +1,88 @@ +injectFault($faultType, $formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + inject_fault_sample($faultType, $formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php new file mode 100644 index 000000000000..c5973c3a478c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php @@ -0,0 +1,71 @@ +listBackups($formattedParent); + + /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backups_sample($formattedParent); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php new file mode 100644 index 000000000000..f788df0033ec --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php @@ -0,0 +1,74 @@ +listClusters($formattedParent); + + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_clusters_sample($formattedParent); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php new file mode 100644 index 000000000000..6e7e861adef2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php @@ -0,0 +1,76 @@ +listInstances($formattedParent); + + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_instances_sample($formattedParent); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php new file mode 100644 index 000000000000..7d2ef19587be --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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 alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php new file mode 100644 index 000000000000..700c6fbe9930 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php @@ -0,0 +1,77 @@ +listSupportedDatabaseFlags($formattedParent); + + /** @var SupportedDatabaseFlag $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_supported_database_flags_sample($formattedParent); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php new file mode 100644 index 000000000000..279b515b8f7f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php @@ -0,0 +1,71 @@ +listUsers($formattedParent); + + /** @var User $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_users_sample($formattedParent); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php new file mode 100644 index 000000000000..ac3df299e9b9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php @@ -0,0 +1,82 @@ +promoteCluster($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 +{ + $formattedName = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + promote_cluster_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php new file mode 100644 index 000000000000..a4a5b4f3d4e1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php @@ -0,0 +1,85 @@ +restartInstance($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + restart_instance_sample($formattedName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php new file mode 100644 index 000000000000..85b7f58762e4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php @@ -0,0 +1,97 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + restore_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php new file mode 100644 index 000000000000..e1ae38c03684 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php @@ -0,0 +1,87 @@ +setClusterName($formattedBackupClusterName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateBackup($backup); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $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 +{ + $formattedBackupClusterName = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + update_backup_sample($formattedBackupClusterName); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php new file mode 100644 index 000000000000..5a7374432dd6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php @@ -0,0 +1,86 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateCluster($cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 +{ + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + update_cluster_sample($formattedClusterNetwork); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php new file mode 100644 index 000000000000..b9093e91c94c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php @@ -0,0 +1,82 @@ +setInstanceType($instanceInstanceType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateInstance($instance); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + update_instance_sample($instanceInstanceType); +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php new file mode 100644 index 000000000000..94e0b43edf17 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php @@ -0,0 +1,56 @@ +updateUser($user); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php new file mode 100644 index 000000000000..674370c0ea34 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php @@ -0,0 +1,36 @@ +clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $requests = new CreateInstanceRequests(); + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class AlloyDBAdminGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.alloydb.v1alpha.AlloyDBAdmin'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'alloydb.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $backupNameTemplate; + + private static $clusterNameTemplate; + + private static $cryptoKeyVersionNameTemplate; + + private static $instanceNameTemplate; + + private static $locationNameTemplate; + + private static $networkNameTemplate; + + private static $userNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_rest_client_config.php', + ], + ], + ]; + } + + private static function getBackupNameTemplate() + { + if (self::$backupNameTemplate == null) { + self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); + } + + return self::$backupNameTemplate; + } + + private static function getClusterNameTemplate() + { + if (self::$clusterNameTemplate == null) { + self::$clusterNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}'); + } + + return self::$clusterNameTemplate; + } + + private static function getCryptoKeyVersionNameTemplate() + { + if (self::$cryptoKeyVersionNameTemplate == null) { + self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); + } + + return self::$cryptoKeyVersionNameTemplate; + } + + private static function getInstanceNameTemplate() + { + if (self::$instanceNameTemplate == null) { + self::$instanceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}'); + } + + return self::$instanceNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getNetworkNameTemplate() + { + if (self::$networkNameTemplate == null) { + self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); + } + + return self::$networkNameTemplate; + } + + private static function getUserNameTemplate() + { + if (self::$userNameTemplate == null) { + self::$userNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/users/{user}'); + } + + return self::$userNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'backup' => self::getBackupNameTemplate(), + 'cluster' => self::getClusterNameTemplate(), + 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), + 'instance' => self::getInstanceNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'network' => self::getNetworkNameTemplate(), + 'user' => self::getUserNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backup + * + * @return string The formatted backup resource. + * + * @experimental + */ + public static function backupName($project, $location, $backup) + { + return self::getBackupNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + * + * @experimental + */ + public static function clusterName($project, $location, $cluster) + { + return self::getClusterNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + * + * @experimental + */ + public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) + { + return self::getCryptoKeyVersionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $instance + * + * @return string The formatted instance resource. + * + * @experimental + */ + public static function instanceName($project, $location, $cluster, $instance) + { + return self::getInstanceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'instance' => $instance, + ]); + } + + /** + * 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. + * + * @experimental + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + * + * @experimental + */ + public static function networkName($project, $network) + { + return self::getNetworkNameTemplate()->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a user + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $user + * + * @return string The formatted user resource. + * + * @experimental + */ + public static function userName($project, $location, $cluster, $user) + { + return self::getUserNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'user' => $user, + ]); + } + + /** + * 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}/backups/{backup} + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} + * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} + * + * 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. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + 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 + * + * @experimental + */ + 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; + } + + /** + * 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 'alloydb.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 + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates new instances under the given project, location and cluster. + * There can be only one primary instance in a cluster. If the primary + * instance exists in the cluster as well as this request, then API will + * throw an error. + * The primary instance should exist before any read pool instance is + * created. If the primary instance is a part of the request payload, then + * the API will take care of creating instances in the correct order. + * This method is here to support Google-internal use cases, and is not meant + * for external customers to consume. Please do not start relying on it; its + * behavior is subject to change without notice. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $requests = new CreateInstanceRequests(); + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. + * @param CreateInstanceRequests $requests Required. Resources being created. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function batchCreateInstances($parent, $requests, array $optionalArgs = []) + { + $request = new BatchCreateInstancesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setRequests($requests); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchCreateInstances', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Backup in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $backupId = 'backup_id'; + * $backup = new Backup(); + * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Value for parent. + * @param string $backupId Required. ID of the requesting object. + * @param Backup $backup Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) + { + $request = new CreateBackupRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setBackupId($backupId); + $request->setBackup($backup); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Cluster in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object. + * @param Cluster $cluster Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new CreateClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Instance in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $instanceId = 'instance_id'; + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param string $instanceId Required. ID of the requesting object. + * @param Instance $instance Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createInstance($parent, $instanceId, $instance, array $optionalArgs = []) + { + $request = new CreateInstanceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInstanceId($instanceId); + $request->setInstance($instance); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object (the secondary cluster). + * @param Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createSecondaryCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new CreateSecondaryClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateSecondaryCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new SECONDARY Instance in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $instanceId = 'instance_id'; + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param string $instanceId Required. ID of the requesting object. + * @param Instance $instance Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createSecondaryInstance($parent, $instanceId, $instance, array $optionalArgs = []) + { + $request = new CreateSecondaryInstanceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInstanceId($instanceId); + $request->setInstance($instance); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateSecondaryInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new User in a given project, location, and cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $userId = 'user_id'; + * $user = new User(); + * $response = $alloyDBAdminClient->createUser($formattedParent, $userId, $user); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Value for parent. + * @param string $userId Required. ID of the requesting object. + * @param User $user Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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 \Google\Cloud\AlloyDb\V1alpha\User + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createUser($parent, $userId, $user, array $optionalArgs = []) + { + $request = new CreateUserRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setUserId($userId); + $request->setUser($user); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type string $etag + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteBackup($name, array $optionalArgs = []) + { + $request = new DeleteBackupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @type bool $force + * Optional. Whether to cascade delete child instances for given cluster. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteCluster($name, array $optionalArgs = []) + { + $request = new DeleteClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteInstance($name, array $optionalArgs = []) + { + $request = new DeleteInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + * $alloyDBAdminClient->deleteUser($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteUser($name, array $optionalArgs = []) + { + $request = new DeleteUserRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteUser', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'failoverInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function failoverInstance($name, array $optionalArgs = []) + { + $request = new FailoverInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('FailoverInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Generate a client certificate signed by a Cluster CA. + * The sole purpose of this endpoint is to support AlloyDB connectors and the + * Auth Proxy client. The endpoint's behavior is subject to change without + * notice, so do not rely on its behavior remaining constant. Future changes + * will not break AlloyDB connectors or the Auth Proxy client. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $response = $alloyDBAdminClient->generateClientCertificate($formattedParent); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $pemCsr + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * @type Duration $certDuration + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * @type string $publicKey + * Optional. The public key from the client. + * @type bool $useMetadataExchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * @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 \Google\Cloud\AlloyDb\V1alpha\GenerateClientCertificateResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function generateClientCertificate($parent, array $optionalArgs = []) + { + $request = new GenerateClientCertificateRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['pemCsr'])) { + $request->setPemCsr($optionalArgs['pemCsr']); + } + + if (isset($optionalArgs['certDuration'])) { + $request->setCertDuration($optionalArgs['certDuration']); + } + + if (isset($optionalArgs['publicKey'])) { + $request->setPublicKey($optionalArgs['publicKey']); + } + + if (isset($optionalArgs['useMetadataExchange'])) { + $request->setUseMetadataExchange($optionalArgs['useMetadataExchange']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GenerateClientCertificate', GenerateClientCertificateResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $response = $alloyDBAdminClient->getBackup($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the resource + * @param array $optionalArgs { + * 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 \Google\Cloud\AlloyDb\V1alpha\Backup + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getBackup($name, array $optionalArgs = []) + { + $request = new GetBackupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $response = $alloyDBAdminClient->getCluster($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1alpha\ClusterView} + * @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 \Google\Cloud\AlloyDb\V1alpha\Cluster + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getCluster($name, array $optionalArgs = []) + { + $request = new GetClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetCluster', Cluster::class, $optionalArgs, $request)->wait(); + } + + /** + * Get instance metadata used for a connection. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $response = $alloyDBAdminClient->getConnectionInfo($formattedParent); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @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 \Google\Cloud\AlloyDb\V1alpha\ConnectionInfo + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getConnectionInfo($parent, array $optionalArgs = []) + { + $request = new GetConnectionInfoRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConnectionInfo', ConnectionInfo::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $response = $alloyDBAdminClient->getInstance($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * The view of the instance to return. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1alpha\InstanceView} + * @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 \Google\Cloud\AlloyDb\V1alpha\Instance + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getInstance($name, array $optionalArgs = []) + { + $request = new GetInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + * $response = $alloyDBAdminClient->getUser($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param array $optionalArgs { + * 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 \Google\Cloud\AlloyDb\V1alpha\User + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getUser($name, array $optionalArgs = []) + { + $request = new GetUserRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Injects fault in an instance. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'injectFault'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param int $faultType Required. The type of fault to be injected in an instance. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1alpha\InjectFaultRequest\FaultType} + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function injectFault($faultType, $name, array $optionalArgs = []) + { + $request = new InjectFaultRequest(); + $requestParamHeaders = []; + $request->setFaultType($faultType); + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('InjectFault', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Lists Backups in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent value for ListBackupsRequest + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Filtering results + * @type string $orderBy + * Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listBackups($parent, array $optionalArgs = []) + { + $request = new ListBackupsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); + } + + /** + * Lists Clusters in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listClusters($parent, array $optionalArgs = []) + { + $request = new ListClustersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListClusters', $optionalArgs, ListClustersResponse::class, $request); + } + + /** + * Lists Instances in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listInstances($parent, array $optionalArgs = []) + { + $request = new ListInstancesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListInstances', $optionalArgs, ListInstancesResponse::class, $request); + } + + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listSupportedDatabaseFlags($parent, array $optionalArgs = []) + { + $request = new ListSupportedDatabaseFlagsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListSupportedDatabaseFlags', $optionalArgs, ListSupportedDatabaseFlagsResponse::class, $request); + } + + /** + * Lists Users in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent value for ListUsersRequest + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listUsers($parent, array $optionalArgs = []) + { + $request = new ListUsersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListUsers', $optionalArgs, ListUsersResponse::class, $request); + } + + /** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'promoteCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function promoteCluster($name, array $optionalArgs = []) + { + $request = new PromoteClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('PromoteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Restart an Instance in a cluster. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restartInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function restartInstance($name, array $optionalArgs = []) + { + $request = new RestartInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestartInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Cluster in a given project and location, with a volume + * restored from the provided source, either a backup ID or a point-in-time + * and a source cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restoreCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object. + * @param Cluster $cluster Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type BackupSource $backupSource + * Backup source. + * @type ContinuousBackupSource $continuousBackupSource + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function restoreCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new RestoreClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['backupSource'])) { + $request->setBackupSource($optionalArgs['backupSource']); + } + + if (isset($optionalArgs['continuousBackupSource'])) { + $request->setContinuousBackupSource($optionalArgs['continuousBackupSource']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestoreCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $backup = new Backup(); + * $operationResponse = $alloyDBAdminClient->updateBackup($backup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateBackup($backup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Backup $backup Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateBackup($backup, array $optionalArgs = []) + { + $request = new UpdateBackupRequest(); + $requestParamHeaders = []; + $request->setBackup($backup); + $requestParamHeaders['backup.name'] = $backup->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Cluster $cluster Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateCluster($cluster, array $optionalArgs = []) + { + $request = new UpdateClusterRequest(); + $requestParamHeaders = []; + $request->setCluster($cluster); + $requestParamHeaders['cluster.name'] = $cluster->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->updateInstance($instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateInstance($instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Instance $instance Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateInstance($instance, array $optionalArgs = []) + { + $request = new UpdateInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $requestParamHeaders['instance.name'] = $instance->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $user = new User(); + * $response = $alloyDBAdminClient->updateUser($user); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param User $user Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allowMissing + * Optional. Allow missing fields in the update mask. + * @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 \Google\Cloud\AlloyDb\V1alpha\User + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateUser($user, array $optionalArgs = []) + { + $request = new UpdateUserRequest(); + $requestParamHeaders = []; + $request->setUser($user); + $requestParamHeaders['user.name'] = $user->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $response = $alloyDBAdminClient->getLocation(); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json new file mode 100644 index 000000000000..ed35ebdfea2a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json @@ -0,0 +1,183 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.alloydb.v1alpha", + "libraryPackage": "Google\\Cloud\\AlloyDb\\V1alpha", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminGapicClient", + "rpcs": { + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags" + ] + }, + "ListUsers": { + "methods": [ + "listUsers" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json new file mode 100644 index 000000000000..5a4e197bbaad --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json @@ -0,0 +1,209 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1alpha.AlloyDBAdmin": { + "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": 60000, + "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": { + "BatchCreateInstances": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSecondaryCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSecondaryInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateUser": { + "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_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "FailoverInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GenerateClientCertificate": { + "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" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConnectionInfo": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSupportedDatabaseFlags": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PromoteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestoreCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateUser": { + "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_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php new file mode 100644 index 000000000000..57312ffe3f42 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php @@ -0,0 +1,242 @@ + [ + 'google.cloud.alloydb.v1alpha.AlloyDBAdmin' => [ + 'BatchCreateInstances' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesResponse', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Backup', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateSecondaryCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateSecondaryInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'FailoverInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'InjectFault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'PromoteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'RestartInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'RestoreCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Backup', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListBackups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackups', + ], + ], + 'ListClusters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClusters', + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + ], + 'ListSupportedDatabaseFlags' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSupportedDatabaseFlags', + ], + ], + 'ListUsers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUsers', + ], + ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + ], + ], +]; diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php new file mode 100644 index 000000000000..61d0cde235b2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php @@ -0,0 +1,454 @@ + [ + 'google.cloud.alloydb.v1alpha.AlloyDBAdmin' => [ + 'BatchCreateInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate', + 'body' => 'requests', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/backups', + 'body' => 'backup', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_id', + ], + ], + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'instance_id', + ], + ], + 'CreateSecondaryCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSecondaryInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateUser' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/users', + 'body' => 'user', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'user_id', + ], + ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteUser' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FailoverInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GenerateClientCertificate' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConnectionInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetUser' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InjectFault' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSupportedDatabaseFlags' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListUsers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/users', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PromoteCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*}:promote', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestartInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestoreCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters:restore', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{backup.name=projects/*/locations/*/backups/*}', + 'body' => 'backup', + 'placeholders' => [ + 'backup.name' => [ + 'getters' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'UpdateUser' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}', + 'body' => 'user', + 'placeholders' => [ + 'user.name' => [ + 'getters' => [ + 'getUser', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php new file mode 100644 index 000000000000..0e8fa9b6f95b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php @@ -0,0 +1,3435 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AlloyDBAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AlloyDBAdminClient($options); + } + + /** @test */ + public function batchCreateInstancesTest() + { + $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/batchCreateInstancesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchCreateInstancesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchCreateInstancesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $response = $gapicClient->batchCreateInstances($formattedParent, $requests); + $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.alloydb.v1alpha.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + $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 batchCreateInstancesExceptionTest() + { + $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/batchCreateInstancesTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $response = $gapicClient->batchCreateInstances($formattedParent, $requests); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + 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 createBackupTest() + { + $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/createBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $satisfiesPzs = false; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); + $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.alloydb.v1alpha.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupId(); + $this->assertProtobufEquals($backupId, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + $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 createBackupExceptionTest() + { + $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/createBackupTest'); + $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]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + 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 createClusterTest() + { + $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/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $satisfiesPzs = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1alpha.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $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 createClusterExceptionTest() + { + $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/createClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + 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 createInstanceTest() + { + $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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); + $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.alloydb.v1alpha.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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 createInstanceExceptionTest() + { + $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/createInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + 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 createSecondaryClusterTest() + { + $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/createSecondaryClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $satisfiesPzs = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + $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 createSecondaryClusterExceptionTest() + { + $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/createSecondaryClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + 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 createSecondaryInstanceTest() + { + $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/createSecondaryInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $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.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + $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 createSecondaryInstanceExceptionTest() + { + $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/createSecondaryInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + 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 createUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + $response = $gapicClient->createUser($formattedParent, $userId, $user); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserId(); + $this->assertProtobufEquals($userId, $actualValue); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createUserExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + try { + $gapicClient->createUser($formattedParent, $userId, $user); + // 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 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); + $expectedResponse = new GPBEmpty(); + $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]', '[BACKUP]'); + $response = $gapicClient->deleteBackup($formattedName); + $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.alloydb.v1alpha.AlloyDBAdmin/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]', '[BACKUP]'); + $response = $gapicClient->deleteBackup($formattedName); + $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 deleteClusterTest() + { + $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/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->deleteCluster($formattedName); + $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.alloydb.v1alpha.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $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 deleteClusterExceptionTest() + { + $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/deleteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->deleteCluster($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + 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 deleteInstanceTest() + { + $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/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->deleteInstance($formattedName); + $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.alloydb.v1alpha.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $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 deleteInstanceExceptionTest() + { + $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/deleteInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->deleteInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + 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 deleteUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $gapicClient->deleteUser($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + try { + $gapicClient->deleteUser($formattedName); + // 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 failoverInstanceTest() + { + $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/failoverInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/failoverInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->failoverInstance($formattedName); + $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.alloydb.v1alpha.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + $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 failoverInstanceExceptionTest() + { + $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/failoverInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->failoverInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + 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 generateClientCertificateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $pemCertificate = 'pemCertificate1234463984'; + $caCert = 'caCert536363365'; + $expectedResponse = new GenerateClientCertificateResponse(); + $expectedResponse->setPemCertificate($pemCertificate); + $expectedResponse->setCaCert($caCert); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->generateClientCertificate($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateClientCertificateExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->generateClientCertificate($formattedParent); + // 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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $satisfiesPzs = false; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $response = $gapicClient->getBackup($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/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]', '[BACKUP]'); + try { + $gapicClient->getBackup($formattedName); + // 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 getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $satisfiesPzs = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->getCluster($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->getCluster($formattedName); + // 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 getConnectionInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $ipAddress = 'ipAddress1480014044'; + $instanceUid = 'instanceUid-737331802'; + $expectedResponse = new ConnectionInfo(); + $expectedResponse->setName($name); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setInstanceUid($instanceUid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->getConnectionInfo($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionInfoExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + try { + $gapicClient->getConnectionInfo($formattedParent); + // 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 getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->getInstance($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + try { + $gapicClient->getInstance($formattedName); + // 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 getUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name2); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $response = $gapicClient->getUser($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + try { + $gapicClient->getUser($formattedName); + // 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 injectFaultTest() + { + $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/injectFaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/injectFaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->injectFault($faultType, $formattedName); + $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.alloydb.v1alpha.AlloyDBAdmin/InjectFault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFaultType(); + $this->assertProtobufEquals($faultType, $actualValue); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + $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 injectFaultExceptionTest() + { + $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/injectFaultTest'); + $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 + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->injectFault($faultType, $formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + 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 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->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listBackups($formattedParent); + $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.alloydb.v1alpha.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listBackups($formattedParent); + // 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 listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [ + $clustersElement, + ]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listClusters($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $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]'); + try { + $gapicClient->listClusters($formattedParent); + // 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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->listInstances($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->listInstances($formattedParent); + // 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 listSupportedDatabaseFlagsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); + $supportedDatabaseFlags = [ + $supportedDatabaseFlagsElement, + ]; + $expectedResponse = new ListSupportedDatabaseFlagsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listSupportedDatabaseFlags($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSupportedDatabaseFlagsExceptionTest() + { + $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]'); + try { + $gapicClient->listSupportedDatabaseFlags($formattedParent); + // 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 listUsersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $usersElement = new User(); + $users = [ + $usersElement, + ]; + $expectedResponse = new ListUsersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUsers($users); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->listUsers($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListUsers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsersExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->listUsers($formattedParent); + // 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 promoteClusterTest() + { + $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/promoteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag2 = 'etag2-1293302904'; + $reconciling = false; + $satisfiesPzs = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag2); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/promoteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->promoteCluster($formattedName); + $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.alloydb.v1alpha.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + $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 promoteClusterExceptionTest() + { + $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/promoteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->promoteCluster($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + 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 restartInstanceTest() + { + $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/restartInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restartInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->restartInstance($formattedName); + $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.alloydb.v1alpha.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + $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 restartInstanceExceptionTest() + { + $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/restartInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->restartInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + 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 restoreClusterTest() + { + $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/restoreClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $satisfiesPzs = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1alpha.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + $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 restoreClusterExceptionTest() + { + $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/restoreClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + 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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $satisfiesPzs = false; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->updateBackup($backup); + $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.alloydb.v1alpha.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->updateBackup($backup); + $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 updateClusterTest() + { + $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/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $satisfiesPzs = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->updateCluster($cluster); + $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.alloydb.v1alpha.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $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 updateClusterExceptionTest() + { + $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/updateClusterTest'); + $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 + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->updateCluster($cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + 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 updateInstanceTest() + { + $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/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $satisfiesPzs = false; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->updateInstance($instance); + $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.alloydb.v1alpha.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $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 updateInstanceExceptionTest() + { + $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/updateInstanceTest'); + $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 + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->updateInstance($instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + 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 updateUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $user = new User(); + $response = $gapicClient->updateUser($user); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateUserExceptionTest() + { + $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 + $user = new User(); + try { + $gapicClient->updateUser($user); + // 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 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Resources.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Resources.php new file mode 100644 index 0000000000000000000000000000000000000000..aabead8c4481abe28cb622492d26f061e114c61a GIT binary patch literal 12342 zcmds7&2t-9ayI~ep+Q2>h@>FMmSEUk)3yxQuA;`)l(Lo%{yzcj2 zzkc1n{`mUa;qegON$+R_%~Bn$pYEQfontLMv`okBnMS%hIy}^@bk95)>V{@z)9G?O zU8}d#m2$QHHj>)r$m(f@^pR;E8CtGqn4^A9H4O8#-_5=Jw5vI4&eHfOJInY24Ac|N z9;!Vpz0)Y};gG)Ss0TZY#X*T!9LSu-!TzU3{Qea{&roeU-E>*OPmsoc!%^4JduiKI z9sKjIZY%mgcXZXzf5hEm~+g-qV4P$mF4Zu&rxGzo;FnFLl!@6vn$6Gr5S=73%y{o;b=Q z)EkuIHAve!DuJV(46i}^%uo@9gL#--rMDEqru^>muFdgR|^zWyRgf^1GF~BRHu;-MeS}nx*cE zPwdj6?&kX9u*CQKv)>)}L@r|RN{C&27YoZdDBB!Lhs)OQBXMQ|5Ee(y9hId-g`wB~oa~$q4d}=YO3IkZ*Qo*4f{rR*ZM10=H(y(l_Zn zczdt9)0ErQdQEB7JIzu>X+LjNluoVHsFbSP)k-<>hO`Wk@?I+u%4|WRGU!>SL%LNZ zb8x61N$ars;>1>7Xr~HUPQKa9KZYSb9$Fn7nomc-`;`yj0tL*5GBe?u6c4py<3nZ)FCcs{8+E;K2I!WzJ?Wd^>~>!O0uiB z(<-|GH^-mEnV;oG=YNW>}IdY`q`5RDKR7J2npdZt4K95Y+-nbA0|en^v~svw;|Z0R#dcxt2|+|W&a2tk5Q9lQ^l{--Ie z!D7!G4Y;>jOnnToi499Jh@ge%#+`<~RE-h8Akjkj%TN)}rU`8?#vtmgj6NtrM>78! zf=xUpM<0yLk5fJf8?I>B`Qi>m^+p}hgBgHrY^$Jq+CAU1)*bSD3p_ZJQgzE zsR+8xX$A9Ch7Xq^si~HsBMY=RHUmDF{t61NBas(U%=YXL_CYp)D^@R z&iv<1ST1pP=saB;B^>AtrZ*qBN8o#ulcHcEM#H`bi4zz5xz0Gjcs&T@H3P?7b~j;R zLVyf1BEahF_RvrTz+#{iVQ7SofYd$8kNY9SdX|Qc?J6fMA=PMz5w4)(PU14XAgaD* zpyT0lk&%t%FQxkRj1>+Be&VRIlV<1izf(r#anASK-#)uAac1#@%OiE%9 z#9n2d?en>oC6DQt-$bw&BZEHZ>4rWyO0MAqEBs{2uqu)x3JbR4Z1=(UaWYCHE(=l% zZmTZ5LjXkh4nr^kc*&cLVX!!T9l!JlfbhCF7K!osMd1ED#9j<1L;mRI7GrZoKgBe~ z#}BPDW>@z^-$4?0CH%1~FR{~6A(OWqzT=6oJoP!O zO|4jZ7j92TbArHT5SF`^D}upP9untn{v`l1^UonzWQJP8(5=;$+q3a!6c(Emx%?dC z?HI-Bc4-IN;*8oVssfY_c~t+gvPxmKzqRuJPx8_oJ&osmZ~I}n?&{|HQzrCkj9G2r(} z7vTCD&FY@qq{SkmR;5(0mFZ`=(0wf{aPI;@B&LuGhyZ`D^&C6*lXyDIxe*P%b05zz zqs`C}z7tPp%}}Vg0!tj#Wd3CxR;mMZnV4?EZT~;U7V-?X2sSUSOs2rax6|Mv*qnMC zCeTF<)^s6k4lg(w2(~01Blp1t7-8uN#81@Tu|CjTLr0!GmJc?{E}!fkrxkYYDcn?F zsyc?j=zB3eKp`pf@bUZ?friuLCr^;mA}JMmglWtl&4GrnfUrUX;vOVAG}I#-T|5QC zU(Pp!i;T93lp}_1SbJsZh_Wzp8BoTIJI-L_=PkJ=vSkr;;)_IXC)e46u1x=Tu<`wf z;!u5H>qp0q?H$^RC@9#mxoomcq^9DI z;D@mq`V6(-$JozKQhXx*)8M}Q>-p5J#JHfi1QRYe?piajHhq6?V!CxW z!gZ0#^{3Q=%IW?J-M|WMD>j!GoMOY3$016j+=W|Qdu_);;H?eTBqkAj7gJ2aru%Jr3B@~bTk+?edKcm| z3X7tmD>^0Oe+pqSX7cbWurQH0|K)rKJ;@{fPMrU(LZnfMjXkk93O}Y|<*zA|NF$SV;PIDwLo@jOFJIB?$aq6^T6r z$;YN%g2k?d-|(QWhu`JkM1(gFY$Ld- zH0t$TM43}4E|Ni8ea;)c4R6W&2r=bib+_7n?l%Ks)$i&xc^9<`x81DlVEqVxg$qBt zmPc^^0#xYkL8@OL7UpyTOb{x%kAxL7f51ZB*aA|RMdANA2PI9r5te*naSnzK8$<0x z>1mduAChrGr9W2n0ZUCri;I+QU%&LC(zr6We z&$Iiq>&%~Hu*9R-|D!;eXD}~K!hP!jRP++a{89z%U>${1xur_PxaBhuhW$6Z%GM-I;VVEO=3tuC7?*d&7&4lRY|K^t_jNKUPv>{U zlfE}Rks_J#!G z?ZG7>>C1VIeV65U(W&tV=ForMlm6DIWwF2egV z%(fVu#uhb?8J2_&VV%0Iju1yrO~VV?+kqC(e;VrRLv}OsO#5k!PblK%**@l`F&YO} zr{%FeZzu{5jr^zIr(!QN!uK)1-s@>Y41Z5XhNBNLDrZyhn(PY3j2pHqdZpiW>moLW z5>&6e(p99WMZjsBc#$x%!p=(iE2#(AU2;zP*mo5t)BXw*rea-GiI1j6aLY%CQWl~Z z>hPfqr^oVl-Sa^eWL=e6B>dtblK~sA{vgJ4_#QMq(}Cz%cq!Q2mv=k9*b~!}n2w}e zBuj5nCUU3JMB12bj3bM;fQL9v30bCr9%O+|gg%C(B1Ea$!xfaG&C6TotA%679&0CIC@?#D#cC}Tezy!x;62(D(@*ojBwm|E$eXi0{PNp z($2i%JfES>jgSFaEc!$C>ciiS!<2npdnHYVDf`vRvzczZ+o;NJ6vI9jMI7=`?Vn-@^^p+=|+!l!iCU za$CkFRut?3Yf+=&bf*^Lx<fMotu^ pk+*m{>n`DF$NcPluNCf;LgFqSk>CX(o)98JfT#o|0#PL3fd?KCPY9{}=QcOb&dzR9 ziIRudp83z2|NHOf|7XrVUB6yO$I=U$p;@YDtaR1f ztm`$+%B0h!rSz4h)%09xarG!HwatcA)$-{L)7+?O*=o&ftYy_&&D>tAWVcRKG)K+a znzf}@wG7=AAw%8N?7CXj(hJMQ%RsQEI%;`=Zcv^j8GwPtIub|>w6!>BsCX{5=5C8MfM z9#6A93GG956Of-v3zn9NFhCIHMZ?i7L#>rdnq9T@x?@_)K$_2QXpSpFa%J*3e=ONf zUr$dm9`pGfOrA?SRzveYJ)O2Rr(qdqDBom*+wO1W2!R#qdbwa2CXs?^*!jGN$=jmY z!r7Xx8BTj^=5?*MR@APmTe@krxAdyU%_T9DQRYw<+q41pl4)#M4a3lljq*~R7<+rd za&4g0U~7{Dcb9_l<~Hljb_YwT%rC3fmmUx>--Y_G-OaUIBw@G?6g%kjKvJ z+#d>SYp(gvLztL!4VIYiBj{ZR9Zwt|@B|~x&`^@$p(MjX$@l@jk6PCu))3=mQDyvy z@5VZ@P^H36loK5E5m?*~`K?F!t;padXl+h>j1$*9i^`g=MRB6ToQOs|2p!oqZZ`Zr z$C!2RYs4`4O%Y4on+(q;sGm~^ur7robj%5an5=p=OJYxhb1#2OLi;Z1wliC6*bvO@ ztJ)_UU>*1g)Kgb25a*bbmL~g)A9=5k`gb9X4-5G-Kp=KI1IZxE*W*#tUspFY#fF$W zmV%|-#jf`X62=J8>yCLtGse2eo_HVXS=Vdu)UjRk8I*7Y^_kY1W+|2Jv2ORW{0iD1 zWYexgaMOU#zA9%OIPIDo$UT%{tVP;OM(}w6?KQNQ9mU5K;g&Ep&@e1btzK6vH4QlJ zn(UW9E1}^9O$bTIXa?;fsVgWU)Jj5U(5@|AyGeyJn43((?ejoS#VG$-LWgF7J4aj5 zs;04~TH73vV5(Ea9UwWC+JK_3QRe!|BU3n!dif2iwuAy^YhhE185G&nQzsrrd$u4i zL!#Fd)2MBa^?>mE7{+%cw4Y)8@Idn!@D6AMHi!0mfOf4;P=}z+fYs6K3h`=cQ3JVg zVH?7&Gj7F5!gC$ zlc4EP-(>s^qg_w}Zm<~Anq`c-*G;HM{j9z%p^;_F+%*5Uc$Hu6LL*SiKp7dfk0RPr zQL8r^b%hm7G-3|qjtdKk%8i*KU9mz7@@F2vA4OvjG92A#m;Io3wb5v#CT;v8L@!$S zz@eVGrou}Lo7;FU*2W{Zr8<#+B%z6->Qt`>Y3_sTKa2WYCRv7V5n?IAkZ$cL%kdJn z`~rF~n)`bV2lCsg=&ePM29Kd3R~wFMLED2VqaVM7hTS{tz@gbtRgwaIDOOKWP{i{x zLNY7#2&36^hGT7yn`k8R1|C3NH?(b5pW`{y4JBuTok|9BPqfPgduBd$T9V&Qp@R{8 zG75YVbrZzwTrikB+u4IMWH${Dqkhe@OiS6cH&|7UkD_jRiPr#F>j(X>u?Z?-)XKu5edjrM!i@83Q9|cxAP)I;UK_va&okyEwl%R~mW%&U1syb5}}> zR~D4nt8;LFNW%T78-6XlIF!P>Q6Iew_lLU3U!}QAbF1X9U2qcYnJ+9}f^E9-UNmrZ z=@R^|6brK#hkE2cKrCk!vfxX^^3FhJN`E&so(fgP57VOf2tL%LC}zt^ zR10;9A{#`5!3Gf?3ipQOZPvYVx#B5r2K83x;YZX4$6_sobJbq;yMTtE_+?9lk)8~c zzFZh6UKsK_(1K%?M{u(aWeXiRhCNibo<=?FIXz>UGnC!CeVPXcg7g z=4#e1bx6V*+&EV-K-Ws`ELg$s=l#m?95_i>AG-eB?6*BlETr2B@?L>8bG>^?( zS$(O$~1CmU8pljnC~cueT70?*M6THw>RaTneXZDUm-=s0A;xm-hIq>pYI2IO~` zxGfs%rjUBG!+Pt^K{L6_@2AkPJKYnf2&|(c6>{8DLI+CQ72Fu>hsD7 z8YG7kXaK?x(1uBkXFgr{7#g)$yIxyUs-*o@tI@%zXFpwV<{N;ij{+Oppun+SsKl7c zix>^@<%(U`s>G?}Z%Sy0M1gBC^LOLW$xs|RM&r;SJkcZ$k;P5hXv7)F#K|{VVqVhD zc*#b?J}$WvJdV1-n=BEBjtZ}gtTri+&B9LfRB09sf-{hX!UawQ>IW_s6ekw>=P;UL z)q{VdjwB2&OYny32AFb@tGsGxEd(O`4*Oic1}v;*@MGz$Vi0UI|LKhF`%o?1Lc^?B z@FQwp%^ejAxo^*)-39XIOsQB{+tdyGLkaCBcFw0yHhw(Trv0ScM8{9Gv4Z)LTzKuB zzr2~s;m5`MKeyOu`5dG-a?Z1}Q`wpc37EWsk)65?gM2oOzFXi!X#5QcA(A-Q4V;N( z!Xp$+Cz=V%Pw(K9jCY%G=`sln-!0Gy7ygrk_Ap-*jK)hVKr47XB(V8jD9E@;On!wj zc}8wqn0YbAy<0fQ+Jp!{O%cxKPP^v9 z`OG9#hY#sK0kPptS6gBH6<`buGI2b{0Bu5yHD+p4o)!~g!R;42fTfBYZ z^R>>S%1^=LNUjlmN4tf`1!x82c#94#;hE_&6~lRaHklawF+Zz|5v!M_zAvExNIn7v z&crKlScd(tz(>$JiN$a2BOU#&DzT-t1Bo?f13`i~VAw=|IiX!Xe-tia}P$B!nF#P6+#D7PzLoAkcZ> zYOe%(5Bd<{@fMzmwdyc=LX0;l#%ErpbPH3N3JgsqQ89oNpwC<6o-?Q76Q^MHRUyms}U^1THBB zfzvkhNU8`@uCVcf-9nE(N`b5Op`LFo;-GwiLOp@AF4Pv~V1-TBywc}u66%M7hHZ== zi*+oQPB5Hgnj@dz!DE~{ID@`A2VN`Q%`yaMGG0u6Qo(178i#rQQ*ygf%=5wA-NFH0 z(=hI**$-OJOrRdlc0|s)3(!~^N(9YMnh@GH75;_X6Rv?U-eQv#BOx6f4NiQI@omJgwMtD+jO0P8!xVyKlYL2jwu?A z^`dk6JO1fNVC02QwSXNxA{&1+c3E(&CV!k_Tf&!t@9N70|@!V zAW3K2ZV~cbI-$7u4z7=!D{7H~$z!j%6l<0~Ft@X0d|`Whe_cYokb(%?I9{NfO7Prz zh#)WQU^6b1@a81xe^VZP+3Ls8@MbB9@)<8KkFX6^%Vo;z1z*3eO_Ap5VCZgPAJ19@ z!!-F1G8X;`0APtG0RWG%4FJr(=W^#<`zFth%}5af7a)ch_g`Up}=r%(C1>OrV?f?J) literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php new file mode 100644 index 000000000000..9f51a8eccea1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php @@ -0,0 +1,392 @@ +google.cloud.alloydb.v1beta.AutomatedBackupPolicy + */ +class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + */ + protected $backup_window = null; + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + */ + protected $location = ''; + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + protected $schedule; + protected $retention; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule $weekly_schedule + * Weekly schedule for the Backup. + * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention $time_based_retention + * Time-based Backup retention policy. + * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention $quantity_based_retention + * Quantity-based Backup retention policy to retain recent backups. + * @type bool $enabled + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * @type \Google\Protobuf\Duration $backup_window + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * @type string $location + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to backups created using this configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Weekly schedule for the Backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule|null + */ + public function getWeeklySchedule() + { + return $this->readOneof(2); + } + + public function hasWeeklySchedule() + { + return $this->hasOneof(2); + } + + /** + * Weekly schedule for the Backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; + * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule $var + * @return $this + */ + public function setWeeklySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Time-based Backup retention policy. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention|null + */ + public function getTimeBasedRetention() + { + return $this->readOneof(4); + } + + public function hasTimeBasedRetention() + { + return $this->hasOneof(4); + } + + /** + * Time-based Backup retention policy. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; + * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention $var + * @return $this + */ + public function setTimeBasedRetention($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Quantity-based Backup retention policy to retain recent backups. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention|null + */ + public function getQuantityBasedRetention() + { + return $this->readOneof(5); + } + + public function hasQuantityBasedRetention() + { + return $this->hasOneof(5); + } + + /** + * Quantity-based Backup retention policy to retain recent backups. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; + * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention $var + * @return $this + */ + public function setQuantityBasedRetention($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Whether automated automated backups are enabled. If not set, defaults to + * true. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getBackupWindow() + { + return $this->backup_window; + } + + public function hasBackupWindow() + { + return isset($this->backup_window); + } + + public function clearBackupWindow() + { + unset($this->backup_window); + } + + /** + * The length of the time window during which a backup can be + * taken. If a backup does not succeed within this time window, it will be + * canceled and considered failed. + * The backup window must be at least 5 minutes long. There is no upper bound + * on the window. If not set, it defaults to 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration backup_window = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBackupWindow($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->backup_window = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * The location where the backup will be stored. Currently, the only supported + * option is to store the backup in the same region as the cluster. + * If empty, defaults to the region of the cluster. + * + * Generated from protobuf field string location = 6; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to backups created using this configuration. + * + * Generated from protobuf field map labels = 7; + * @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; + } + + /** + * @return string + */ + public function getSchedule() + { + return $this->whichOneof("schedule"); + } + + /** + * @return string + */ + public function getRetention() + { + return $this->whichOneof("retention"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php new file mode 100644 index 000000000000..66c0a2f3d5e9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + */ +class QuantityBasedRetention extends \Google\Protobuf\Internal\Message +{ + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + */ + protected $count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $count + * The number of backups to retain. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + * @return int + */ + public function getCount() + { + return $this->count; + } + + /** + * The number of backups to retain. + * + * Generated from protobuf field int32 count = 1; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt32($var); + $this->count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuantityBasedRetention::class, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy_QuantityBasedRetention::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php new file mode 100644 index 000000000000..2ed7e5644557 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php @@ -0,0 +1,81 @@ +google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + */ +class TimeBasedRetention extends \Google\Protobuf\Internal\Message +{ + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + */ + protected $retention_period = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $retention_period + * The retention period. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getRetentionPeriod() + { + return $this->retention_period; + } + + public function hasRetentionPeriod() + { + return isset($this->retention_period); + } + + public function clearRetentionPeriod() + { + unset($this->retention_period); + } + + /** + * The retention period. + * + * Generated from protobuf field .google.protobuf.Duration retention_period = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRetentionPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->retention_period = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimeBasedRetention::class, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy_TimeBasedRetention::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php new file mode 100644 index 000000000000..ff5c67a97ea7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php @@ -0,0 +1,129 @@ +google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + */ +class WeeklySchedule extends \Google\Protobuf\Internal\Message +{ + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + */ + private $start_times; + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + */ + private $days_of_week; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $start_times + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStartTimes() + { + return $this->start_times; + } + + /** + * The times during the day to start a backup. The start times are assumed + * to be in UTC and to be an exact hour (e.g., 04:00:00). + * If no start times are provided, a single fixed start time is chosen + * arbitrarily. + * + * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; + * @param array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStartTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\TimeOfDay::class); + $this->start_times = $arr; + + return $this; + } + + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDaysOfWeek() + { + return $this->days_of_week; + } + + /** + * The days of the week to perform a backup. + * If this field is left empty, the default of every day of the week is + * used. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDaysOfWeek($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->days_of_week = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WeeklySchedule::class, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy_WeeklySchedule::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php new file mode 100644 index 000000000000..dacfed1b4c3d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php @@ -0,0 +1,917 @@ +google.cloud.alloydb.v1beta.Backup + */ +class Backup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + */ + private $labels; + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.Type type = 8; + */ + protected $type = 0; + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + */ + protected $description = ''; + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cluster_uid = ''; + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $cluster_name = ''; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + */ + private $annotations; + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_bytes = 0; + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expiry_time = null; + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expiry_quantity = null; + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $database_version = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * @type string $display_name + * User-settable and human-readable display name for the Backup. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current state of the backup. + * @type int $type + * The backup type, which suggests the trigger for the backup. + * @type string $description + * User-provided description of the backup. + * @type string $cluster_uid + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * @type string $cluster_name + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * @type \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $encryption_info + * Output only. The encryption information for the backup. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type int|string $size_bytes + * Output only. The size of the backup in bytes. + * @type \Google\Protobuf\Timestamp $expiry_time + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * @type \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry $expiry_quantity + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * @type int $database_version + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * where the cluster and backup ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the backup resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Backup. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 6; + * @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 current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Backup\State::class); + $this->state = $var; + + return $this; + } + + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The backup type, which suggests the trigger for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.Type type = 8; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Backup\Type::class); + $this->type = $var; + + return $this; + } + + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User-provided description of the backup. + * + * Generated from protobuf field string description = 9; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClusterUid() + { + return $this->cluster_uid; + } + + /** + * Output only. The system-generated UID of the cluster which was used to + * create this resource. + * + * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClusterUid($var) + { + GPBUtil::checkString($var, True); + $this->cluster_uid = $var; + + return $this; + } + + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getClusterName() + { + return $this->cluster_name; + } + + /** + * Required. The full resource name of the backup source cluster + * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + * + * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setClusterName($var) + { + GPBUtil::checkString($var, True); + $this->cluster_name = $var; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + * true, indicates that the service is actively updating the resource. This + * can happen due to user-triggered updates or system actions like failover or + * maintenance. + * + * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the + * backup with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 14; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 16; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeBytes() + { + return $this->size_bytes; + } + + /** + * Output only. The size of the backup in bytes. + * + * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->size_bytes = $var; + + return $this; + } + + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpiryTime() + { + return $this->expiry_time; + } + + public function hasExpiryTime() + { + return isset($this->expiry_time); + } + + public function clearExpiryTime() + { + unset($this->expiry_time); + } + + /** + * Output only. The time at which after the backup is eligible to be garbage + * collected. It is the duration specified by the backup's retention policy, + * added to the backup's create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpiryTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiry_time = $var; + + return $this; + } + + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry|null + */ + public function getExpiryQuantity() + { + return $this->expiry_quantity; + } + + public function hasExpiryQuantity() + { + return isset($this->expiry_quantity); + } + + public function clearExpiryQuantity() + { + unset($this->expiry_quantity); + } + + /** + * Output only. The QuantityBasedExpiry of the backup, specified by the + * backup's retention policy. Once the expiry quantity is over retention, the + * backup is eligible to be garbage collected. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry $var + * @return $this + */ + public function setExpiryQuantity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry::class); + $this->expiry_quantity = $var; + + return $this; + } + + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDatabaseVersion() + { + return $this->database_version; + } + + /** + * Output only. The database engine major version of the cluster this backup + * was created from. Any restored cluster created from this backup will have + * the same database version. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDatabaseVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\DatabaseVersion::class); + $this->database_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php new file mode 100644 index 000000000000..d460888686a4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php @@ -0,0 +1,125 @@ +google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + */ +class QuantityBasedExpiry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retention_count = 0; + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $total_retention_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $retention_count + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * @type int $total_retention_count + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRetentionCount() + { + return $this->retention_count; + } + + /** + * Output only. The backup's position among its backups with the same source + * cluster and type, by descending chronological order create time(i.e. + * newest first). + * + * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRetentionCount($var) + { + GPBUtil::checkInt32($var); + $this->retention_count = $var; + + return $this; + } + + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTotalRetentionCount() + { + return $this->total_retention_count; + } + + /** + * Output only. The length of the quantity-based queue, specified by the + * backup's retention policy. + * + * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTotalRetentionCount($var) + { + GPBUtil::checkInt32($var); + $this->total_retention_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuantityBasedExpiry::class, \Google\Cloud\AlloyDb\V1beta\Backup_QuantityBasedExpiry::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php new file mode 100644 index 000000000000..bd87c613c3e4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php @@ -0,0 +1,78 @@ +google.cloud.alloydb.v1beta.Backup.State + */ +class State +{ + /** + * The state of the backup is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The backup is ready. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The backup is creating. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + /** + * The backup failed. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The backup is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::CREATING => 'CREATING', + self::FAILED => 'FAILED', + self::DELETING => 'DELETING', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1beta\Backup_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php new file mode 100644 index 000000000000..bdb758166726 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php @@ -0,0 +1,74 @@ +google.cloud.alloydb.v1beta.Backup.Type + */ +class Type +{ + /** + * Backup Type is unknown. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * ON_DEMAND backups that were triggered by the customer (e.g., not + * AUTOMATED). + * + * Generated from protobuf enum ON_DEMAND = 1; + */ + const ON_DEMAND = 1; + /** + * AUTOMATED backups triggered by the automated backups scheduler pursuant + * to an automated backup policy. + * + * Generated from protobuf enum AUTOMATED = 2; + */ + const AUTOMATED = 2; + /** + * CONTINUOUS backups triggered by the automated backups scheduler + * due to a continuous backup policy. + * + * Generated from protobuf enum CONTINUOUS = 3; + */ + const CONTINUOUS = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ON_DEMAND => 'ON_DEMAND', + self::AUTOMATED => 'AUTOMATED', + self::CONTINUOUS => 'CONTINUOUS', + ]; + + 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(Type::class, \Google\Cloud\AlloyDb\V1beta\Backup_Type::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php new file mode 100644 index 000000000000..cd85e48f7c60 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php @@ -0,0 +1,113 @@ +google.cloud.alloydb.v1beta.BackupSource + */ +class BackupSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_uid = ''; + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_uid + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * @type string $backup_name + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBackupUid() + { + return $this->backup_uid; + } + + /** + * Output only. The system-generated UID of the backup which was used to + * create this resource. The UID is generated when the backup is created, and + * it is retained until the backup is deleted. + * + * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBackupUid($var) + { + GPBUtil::checkString($var, True); + $this->backup_uid = $var; + + return $this; + } + + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackupName() + { + return $this->backup_name; + } + + /** + * Required. The name of the backup resource with the format: + * * projects/{project}/locations/{region}/backups/{backup_id} + * + * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupName($var) + { + GPBUtil::checkString($var, True); + $this->backup_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php new file mode 100644 index 000000000000..8f5aef1eeac6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php @@ -0,0 +1,221 @@ +google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + */ +class BatchCreateInstanceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + */ + protected $state = 0; + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + */ + protected $error_msg = ''; + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + */ + protected $error = null; + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * @type string $error_msg + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * @type \Google\Rpc\Status $error + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * @type int $type + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The current state of an instance involved in the batch create operation. + * Once the operation is complete, the final state of the instances in the + * LRO can be one of: + * 1. ACTIVE, indicating that instances were created successfully + * 2. FAILED, indicating that a particular instance failed creation + * 3. ROLLED_BACK indicating that although the instance was created + * successfully, it had to be rolled back and deleted due to failure in + * other steps of the workflow. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstanceStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + * @return string + */ + public function getErrorMsg() + { + return $this->error_msg; + } + + /** + * DEPRECATED - Use the error field instead. + * Error, if any error occurred and is available, during instance creation. + * + * Generated from protobuf field string error_msg = 2; + * @param string $var + * @return $this + */ + public function setErrorMsg($var) + { + GPBUtil::checkString($var, True); + $this->error_msg = $var; + + return $this; + } + + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * The RPC status of the instance creation operation. This field will be + * present if an error happened during the instance creation. + * + * Generated from protobuf field .google.rpc.Status error = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\InstanceType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php new file mode 100644 index 000000000000..079a5e357c56 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php @@ -0,0 +1,97 @@ +google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State + */ +class State +{ + /** + * The state of the instance is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Instance is pending creation and has not yet been picked up for + * processsing in the backend. + * + * Generated from protobuf enum PENDING_CREATE = 1; + */ + const PENDING_CREATE = 1; + /** + * The instance is active and running. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 3; + */ + const CREATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The creation of the instance failed or a fatal error occurred during + * an operation on the instance or a batch of instances. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + /** + * The instance was created successfully, but was rolled back and deleted + * due to some other failure during BatchCreateInstances operation. + * + * Generated from protobuf enum ROLLED_BACK = 6; + */ + const ROLLED_BACK = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING_CREATE => 'PENDING_CREATE', + self::READY => 'READY', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::ROLLED_BACK => 'ROLLED_BACK', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstanceStatus_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php new file mode 100644 index 000000000000..918b59168228 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php @@ -0,0 +1,134 @@ +google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + */ +class BatchCreateInstancesMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + */ + private $instance_targets; + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + */ + private $instance_statuses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instance_targets + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * @type array|\Google\Protobuf\Internal\MapField $instance_statuses + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceTargets() + { + return $this->instance_targets; + } + + /** + * The instances being created in the API call. Each string in this list + * is the server defined resource path for target instances in the request + * and for the format of each string, see the comment on the Instance.name + * field. + * + * Generated from protobuf field repeated string instance_targets = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instance_targets = $arr; + + return $this; + } + + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInstanceStatuses() + { + return $this->instance_statuses; + } + + /** + * A map representing state of the instances involved in the + * BatchCreateInstances operation during the operation execution. + * The instance state will be in STATE_UNSPECIFIED state if the instance has + * not yet been picked up for processing. + * The key of the map is the name of the instance resource. + * For the format, see the comment on the Instance.name field. + * + * Generated from protobuf field map instance_statuses = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInstanceStatuses($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstanceStatus::class); + $this->instance_statuses = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php new file mode 100644 index 000000000000..413efcf08245 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php @@ -0,0 +1,185 @@ +google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + */ +class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $requests = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. + * @type \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests $requests + * Required. Resources being created. + * @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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. + * + * 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 name of the parent resource. + * + * 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. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests|null + */ + public function getRequests() + { + return $this->requests; + } + + public function hasRequests() + { + return isset($this->requests); + } + + public function clearRequests() + { + unset($this->requests); + } + + /** + * Required. Resources being created. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests $var + * @return $this + */ + public function setRequests($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests::class); + $this->requests = $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 = 3 [(.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 = 3 [(.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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php new file mode 100644 index 000000000000..b518af308ff1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php @@ -0,0 +1,67 @@ +google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + */ +class BatchCreateInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * Created instances. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Created instances. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + * @param array<\Google\Cloud\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Instance::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php new file mode 100644 index 000000000000..b1c8edfc1190 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php @@ -0,0 +1,1189 @@ +google.cloud.alloydb.v1beta.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Output only. The current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cluster_type = 0; + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $database_version = 0; + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_config = null; + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @deprecated + */ + protected $network = ''; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + */ + private $annotations; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $initial_user = null; + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + */ + protected $automated_backup_policy = null; + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; + * @deprecated + */ + protected $ssl_config = null; + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_config = null; + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $continuous_backup_config = null; + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $continuous_backup_info = null; + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + */ + protected $secondary_config = null; + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $primary_config = null; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1beta\BackupSource $backup_source + * Output only. Cluster created from backup. + * @type \Google\Cloud\AlloyDb\V1beta\MigrationSource $migration_source + * Output only. Cluster created via DMS migration. + * @type string $name + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * @type string $display_name + * User-settable and human-readable display name for the Cluster. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current serving state of the cluster. + * @type int $cluster_type + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * @type int $database_version + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * @type \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig $network_config + * @type string $network + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * @type \Google\Cloud\AlloyDb\V1beta\UserPassword $initial_user + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy $automated_backup_policy + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * @type \Google\Cloud\AlloyDb\V1beta\SslConfig $ssl_config + * SSL configuration for this AlloyDB cluster. + * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * @type \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $encryption_info + * Output only. The encryption information for the cluster. + * @type \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig $continuous_backup_config + * Optional. Continuous backup configuration for this cluster. + * @type \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo $continuous_backup_info + * Output only. Continuous backup properties for this cluster. + * @type \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig $secondary_config + * Cross Region replication config specific to SECONDARY cluster. + * @type \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig $primary_config + * Output only. Cross Region replication config specific to PRIMARY cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Cluster created from backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\BackupSource|null + */ + public function getBackupSource() + { + return $this->readOneof(15); + } + + public function hasBackupSource() + { + return $this->hasOneof(15); + } + + /** + * Output only. Cluster created from backup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\BackupSource $var + * @return $this + */ + public function setBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\BackupSource::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. Cluster created via DMS migration. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\MigrationSource|null + */ + public function getMigrationSource() + { + return $this->readOneof(16); + } + + public function hasMigrationSource() + { + return $this->hasOneof(16); + } + + /** + * Output only. Cluster created via DMS migration. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\MigrationSource $var + * @return $this + */ + public function setMigrationSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\MigrationSource::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the cluster resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * where the cluster ID segment should satisfy the regex expression + * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + * The prefix of the cluster resource name is the name of the parent resource: + * * projects/{project}/locations/{region} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Cluster. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @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 current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current serving state of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Cluster\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getClusterType() + { + return $this->cluster_type; + } + + /** + * Output only. The type of the cluster. This is an output-only field and it's + * populated at the Cluster creation time or the Cluster promotion + * time. The cluster type is determined by which RPC was used to create + * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setClusterType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Cluster\ClusterType::class); + $this->cluster_type = $var; + + return $this; + } + + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDatabaseVersion() + { + return $this->database_version; + } + + /** + * Optional. The database engine major version. This is an optional field and + * it is populated at the Cluster creation time. If a database version is not + * supplied at cluster creation time, then a default database version will + * be used. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDatabaseVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\DatabaseVersion::class); + $this->database_version = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig|null + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + public function hasNetworkConfig() + { + return isset($this->network_config); + } + + public function clearNetworkConfig() + { + unset($this->network_config); + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig::class); + $this->network_config = $var; + + return $this; + } + + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + * @deprecated + */ + public function getNetwork() + { + @trigger_error('network is deprecated.', E_USER_DEPRECATED); + return $this->network; + } + + /** + * Required. The resource link for the VPC network in which cluster resources + * are created and from which they are accessible via Private IP. The network + * must belong to the same project as the cluster. It is specified in the + * form: "projects/{project}/global/networks/{network_id}". This is required + * to create a cluster. Deprecated, use network_config.network instead. + * + * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + * @deprecated + */ + public function setNetwork($var) + { + @trigger_error('network is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 11; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Cluster does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\UserPassword|null + */ + public function getInitialUser() + { + return $this->initial_user; + } + + public function hasInitialUser() + { + return isset($this->initial_user); + } + + public function clearInitialUser() + { + unset($this->initial_user); + } + + /** + * Input only. Initial user to setup during cluster creation. Required. + * If used in `RestoreCluster` this is ignored. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\UserPassword $var + * @return $this + */ + public function setInitialUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\UserPassword::class); + $this->initial_user = $var; + + return $this; + } + + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy|null + */ + public function getAutomatedBackupPolicy() + { + return $this->automated_backup_policy; + } + + public function hasAutomatedBackupPolicy() + { + return isset($this->automated_backup_policy); + } + + public function clearAutomatedBackupPolicy() + { + unset($this->automated_backup_policy); + } + + /** + * The automated backup policy for this cluster. + * If no policy is provided then the default policy will be used. If backups + * are supported for the cluster, the default policy takes one backup a day, + * has a backup window of 1 hour, and retains backups for 14 days. + * For more information on the defaults, consult the + * documentation for the message type. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; + * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy $var + * @return $this + */ + public function setAutomatedBackupPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy::class); + $this->automated_backup_policy = $var; + + return $this; + } + + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; + * @return \Google\Cloud\AlloyDb\V1beta\SslConfig|null + * @deprecated + */ + public function getSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + return $this->ssl_config; + } + + public function hasSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + return isset($this->ssl_config); + } + + public function clearSslConfig() + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + unset($this->ssl_config); + } + + /** + * SSL configuration for this AlloyDB cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; + * @param \Google\Cloud\AlloyDb\V1beta\SslConfig $var + * @return $this + * @deprecated + */ + public function setSslConfig($var) + { + @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SslConfig::class); + $this->ssl_config = $var; + + return $this; + } + + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Optional. The encryption config can be specified to encrypt the data disks + * and other persistent data resources of a cluster with a + * customer-managed encryption key (CMEK). When this field is not + * specified, the cluster will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig|null + */ + public function getContinuousBackupConfig() + { + return $this->continuous_backup_config; + } + + public function hasContinuousBackupConfig() + { + return isset($this->continuous_backup_config); + } + + public function clearContinuousBackupConfig() + { + unset($this->continuous_backup_config); + } + + /** + * Optional. Continuous backup configuration for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig $var + * @return $this + */ + public function setContinuousBackupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig::class); + $this->continuous_backup_config = $var; + + return $this; + } + + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo|null + */ + public function getContinuousBackupInfo() + { + return $this->continuous_backup_info; + } + + public function hasContinuousBackupInfo() + { + return isset($this->continuous_backup_info); + } + + public function clearContinuousBackupInfo() + { + unset($this->continuous_backup_info); + } + + /** + * Output only. Continuous backup properties for this cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo $var + * @return $this + */ + public function setContinuousBackupInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo::class); + $this->continuous_backup_info = $var; + + return $this; + } + + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * @return \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig|null + */ + public function getSecondaryConfig() + { + return $this->secondary_config; + } + + public function hasSecondaryConfig() + { + return isset($this->secondary_config); + } + + public function clearSecondaryConfig() + { + unset($this->secondary_config); + } + + /** + * Cross Region replication config specific to SECONDARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; + * @param \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig $var + * @return $this + */ + public function setSecondaryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig::class); + $this->secondary_config = $var; + + return $this; + } + + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig|null + */ + public function getPrimaryConfig() + { + return $this->primary_config; + } + + public function hasPrimaryConfig() + { + return isset($this->primary_config); + } + + public function clearPrimaryConfig() + { + unset($this->primary_config); + } + + /** + * Output only. Cross Region replication config specific to PRIMARY cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig $var + * @return $this + */ + public function setPrimaryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig::class); + $this->primary_config = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php new file mode 100644 index 000000000000..f6b5b79f2a22 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1beta.Cluster.ClusterType + */ +class ClusterType +{ + /** + * The type of the cluster is unknown. + * + * Generated from protobuf enum CLUSTER_TYPE_UNSPECIFIED = 0; + */ + const CLUSTER_TYPE_UNSPECIFIED = 0; + /** + * Primary cluster that support read and write operations. + * + * Generated from protobuf enum PRIMARY = 1; + */ + const PRIMARY = 1; + /** + * Secondary cluster that is replicating from another region. + * This only supports read. + * + * Generated from protobuf enum SECONDARY = 2; + */ + const SECONDARY = 2; + + private static $valueToName = [ + self::CLUSTER_TYPE_UNSPECIFIED => 'CLUSTER_TYPE_UNSPECIFIED', + self::PRIMARY => 'PRIMARY', + self::SECONDARY => 'SECONDARY', + ]; + + 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(ClusterType::class, \Google\Cloud\AlloyDb\V1beta\Cluster_ClusterType::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php new file mode 100644 index 000000000000..00049b553979 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php @@ -0,0 +1,148 @@ +google.cloud.alloydb.v1beta.Cluster.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allocated_ip_range = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * @type string $allocated_ip_range + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. The resource link for the VPC network in which cluster + * resources are created and from which they are accessible via Private IP. + * The network must belong to the same project as the cluster. It is + * specified in the form: + * "projects/{project_number}/global/networks/{network_id}". This is + * required to create a cluster. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAllocatedIpRange() + { + return $this->allocated_ip_range; + } + + /** + * Optional. Name of the allocated IP range for the private IP AlloyDB + * cluster, for example: "google-managed-services-default". If set, the + * instance IPs for this cluster will be created in the allocated range. The + * range name must comply with RFC 1035. Specifically, the name must be 1-63 + * characters long and match the regular expression + * [a-z]([-a-z0-9]*[a-z0-9])?. + * Field name is intended to be consistent with CloudSQL. + * + * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAllocatedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->allocated_ip_range = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkConfig::class, \Google\Cloud\AlloyDb\V1beta\Cluster_NetworkConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php new file mode 100644 index 000000000000..5e654105841f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + */ +class PrimaryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $secondary_cluster_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_cluster_names + * Output only. Names of the clusters that are replicating from this + * cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryClusterNames() + { + return $this->secondary_cluster_names; + } + + /** + * Output only. Names of the clusters that are replicating from this + * cluster. + * + * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryClusterNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_cluster_names = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrimaryConfig::class, \Google\Cloud\AlloyDb\V1beta\Cluster_PrimaryConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php new file mode 100644 index 000000000000..ad40743a50b5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php @@ -0,0 +1,75 @@ +google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + */ +class SecondaryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + */ + protected $primary_cluster_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $primary_cluster_name + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + * @return string + */ + public function getPrimaryClusterName() + { + return $this->primary_cluster_name; + } + + /** + * The name of the primary cluster name with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string primary_cluster_name = 1; + * @param string $var + * @return $this + */ + public function setPrimaryClusterName($var) + { + GPBUtil::checkString($var, True); + $this->primary_cluster_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SecondaryConfig::class, \Google\Cloud\AlloyDb\V1beta\Cluster_SecondaryConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php new file mode 100644 index 000000000000..a5594b7961b4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php @@ -0,0 +1,125 @@ +google.cloud.alloydb.v1beta.Cluster.State + */ +class State +{ + /** + * The state of the cluster is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The cluster is active and running. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The cluster is stopped. All instances in the cluster are stopped. + * Customers can start a stopped cluster at any point and all their + * instances will come back to life with same names and IP resources. In + * this state, customer pays for storage. + * Associated backups could also be present in a stopped cluster. + * + * Generated from protobuf enum STOPPED = 2; + */ + const STOPPED = 2; + /** + * The cluster is empty and has no associated resources. + * All instances, associated storage and backups have been deleted. + * + * Generated from protobuf enum EMPTY = 3; + */ + const PBEMPTY = 3; + /** + * The cluster is being created. + * + * Generated from protobuf enum CREATING = 4; + */ + const CREATING = 4; + /** + * The cluster is being deleted. + * + * Generated from protobuf enum DELETING = 5; + */ + const DELETING = 5; + /** + * The creation of the cluster failed. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * The cluster is bootstrapping with data from some other source. + * Direct mutations to the cluster (e.g. adding read pool) are not allowed. + * + * Generated from protobuf enum BOOTSTRAPPING = 7; + */ + const BOOTSTRAPPING = 7; + /** + * The cluster is under maintenance. AlloyDB regularly performs maintenance + * and upgrades on customer clusters. Updates on the cluster are + * not allowed while the cluster is in this state. + * + * Generated from protobuf enum MAINTENANCE = 8; + */ + const MAINTENANCE = 8; + /** + * The cluster is being promoted. + * + * Generated from protobuf enum PROMOTING = 9; + */ + const PROMOTING = 9; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::STOPPED => 'STOPPED', + self::PBEMPTY => 'EMPTY', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::BOOTSTRAPPING => 'BOOTSTRAPPING', + self::MAINTENANCE => 'MAINTENANCE', + self::PROMOTING => 'PROMOTING', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\AlloyDb\V1beta\Cluster_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php new file mode 100644 index 000000000000..350d113876a5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php @@ -0,0 +1,66 @@ +google.cloud.alloydb.v1beta.ClusterView + */ +class ClusterView +{ + /** + * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + * + * Generated from protobuf enum CLUSTER_VIEW_UNSPECIFIED = 0; + */ + const CLUSTER_VIEW_UNSPECIFIED = 0; + /** + * BASIC server responses include all the relevant cluster details, excluding + * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific + * fields. The default value. + * + * Generated from protobuf enum CLUSTER_VIEW_BASIC = 1; + */ + const CLUSTER_VIEW_BASIC = 1; + /** + * CONTINUOUS_BACKUP response returns all the fields from BASIC plus + * the earliest restorable time if continuous backups are enabled. + * May increase latency. + * + * Generated from protobuf enum CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + const CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + + private static $valueToName = [ + self::CLUSTER_VIEW_UNSPECIFIED => 'CLUSTER_VIEW_UNSPECIFIED', + self::CLUSTER_VIEW_BASIC => 'CLUSTER_VIEW_BASIC', + self::CLUSTER_VIEW_CONTINUOUS_BACKUP => 'CLUSTER_VIEW_CONTINUOUS_BACKUP', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php new file mode 100644 index 000000000000..4e10d548d22d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php @@ -0,0 +1,195 @@ +google.cloud.alloydb.v1beta.ConnectionInfo + */ +class ConnectionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ip_address = ''; + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated + */ + private $pem_certificate_chain; + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $instance_uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * @type string $ip_address + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * @type string $instance_uid + * Output only. The unique ID of the Instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the ConnectionInfo singleton resource, e.g.: + * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Output only. The private network IP address for the Instance. This is the + * default IP for the instance and is always created (even if enable_public_ip + * is set). This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getPemCertificateChain() + { + @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); + return $this->pem_certificate_chain; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setPemCertificateChain($var) + { + @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->pem_certificate_chain = $arr; + + return $this; + } + + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getInstanceUid() + { + return $this->instance_uid; + } + + /** + * Output only. The unique ID of the Instance. + * + * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setInstanceUid($var) + { + GPBUtil::checkString($var, True); + $this->instance_uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php new file mode 100644 index 000000000000..4d2878a30c7e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php @@ -0,0 +1,176 @@ +google.cloud.alloydb.v1beta.ContinuousBackupConfig + */ +class ContinuousBackupConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + */ + protected $recovery_window_days = 0; + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + */ + protected $encryption_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Whether ContinuousBackup is enabled. + * @type int $recovery_window_days + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Whether ContinuousBackup is enabled. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + * @return int + */ + public function getRecoveryWindowDays() + { + return $this->recovery_window_days; + } + + /** + * The number of days that are eligible to restore from using PITR. To support + * the entire recovery window, backups and logs are retained for one day more + * than the recovery window. If not set, defaults to 14 days. + * + * Generated from protobuf field int32 recovery_window_days = 4; + * @param int $var + * @return $this + */ + public function setRecoveryWindowDays($var) + { + GPBUtil::checkInt32($var); + $this->recovery_window_days = $var; + + return $this; + } + + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * The encryption config can be specified to encrypt the + * backups with a customer-managed encryption key (CMEK). When this field is + * not specified, the backup will then use default encryption scheme to + * protect the user data. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; + * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php new file mode 100644 index 000000000000..e83c1b3905b6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php @@ -0,0 +1,216 @@ +google.cloud.alloydb.v1beta.ContinuousBackupInfo + */ +class ContinuousBackupInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_info = null; + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $enabled_time = null; + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $schedule; + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $earliest_restorable_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $encryption_info + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * @type \Google\Protobuf\Timestamp $enabled_time + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * @type array|\Google\Protobuf\Internal\RepeatedField $schedule + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * @type \Google\Protobuf\Timestamp $earliest_restorable_time + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\EncryptionInfo|null + */ + public function getEncryptionInfo() + { + return $this->encryption_info; + } + + public function hasEncryptionInfo() + { + return isset($this->encryption_info); + } + + public function clearEncryptionInfo() + { + unset($this->encryption_info); + } + + /** + * Output only. The encryption information for the WALs and backups required + * for ContinuousBackup. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $var + * @return $this + */ + public function setEncryptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo::class); + $this->encryption_info = $var; + + return $this; + } + + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEnabledTime() + { + return $this->enabled_time; + } + + public function hasEnabledTime() + { + return isset($this->enabled_time); + } + + public function clearEnabledTime() + { + unset($this->enabled_time); + } + + /** + * Output only. When ContinuousBackup was most recently enabled. Set to null + * if ContinuousBackup is not enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEnabledTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->enabled_time = $var; + + return $this; + } + + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchedule() + { + return $this->schedule; + } + + /** + * Output only. Days of the week on which a continuous backup is taken. Output + * only field. Ignored if passed into the request. + * + * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchedule($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->schedule = $arr; + + return $this; + } + + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestRestorableTime() + { + return $this->earliest_restorable_time; + } + + public function hasEarliestRestorableTime() + { + return isset($this->earliest_restorable_time); + } + + public function clearEarliestRestorableTime() + { + unset($this->earliest_restorable_time); + } + + /** + * Output only. The earliest restorable time that can be restored to. Output + * only field. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestRestorableTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_restorable_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php new file mode 100644 index 000000000000..66bc25214a76 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php @@ -0,0 +1,119 @@ +google.cloud.alloydb.v1beta.ContinuousBackupSource + */ +class ContinuousBackupSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = ''; + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $point_in_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * @type \Google\Protobuf\Timestamp $point_in_time + * Required. The point in time to restore to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCluster() + { + return $this->cluster; + } + + /** + * Required. The source cluster from which to restore. This cluster must have + * continuous backup enabled for this operation to succeed. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkString($var, True); + $this->cluster = $var; + + return $this; + } + + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPointInTime() + { + return $this->point_in_time; + } + + public function hasPointInTime() + { + return isset($this->point_in_time); + } + + public function clearPointInTime() + { + unset($this->point_in_time); + } + + /** + * Required. The point in time to restore to. + * + * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPointInTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->point_in_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php new file mode 100644 index 000000000000..b105775eac50 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php @@ -0,0 +1,257 @@ +google.cloud.alloydb.v1beta.CreateBackupRequest + */ +class CreateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $backup_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1beta\Backup $backup + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupId() + { + return $this->backup_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupId($var) + { + GPBUtil::checkString($var, True); + $this->backup_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Backup::class); + $this->backup = $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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php new file mode 100644 index 000000000000..0c9e36e9c90b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php @@ -0,0 +1,265 @@ +google.cloud.alloydb.v1beta.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * 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 location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); + $this->cluster = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php new file mode 100644 index 000000000000..b330b8e68a2a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php @@ -0,0 +1,265 @@ +google.cloud.alloydb.v1beta.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @type string $instance_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1beta\Instance $instance + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance::class); + $this->instance = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php new file mode 100644 index 000000000000..26e9b5390090 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1beta.CreateInstanceRequests + */ +class CreateInstanceRequests extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $create_instance_requests; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1beta\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $create_instance_requests + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCreateInstanceRequests() + { + return $this->create_instance_requests; + } + + /** + * Required. Primary and read replica instances to be created. This list + * should not be empty. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\AlloyDb\V1beta\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCreateInstanceRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequest::class); + $this->create_instance_requests = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php new file mode 100644 index 000000000000..29febd8ae980 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php @@ -0,0 +1,263 @@ +google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + */ +class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object (the secondary cluster). + * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster + * Required. Configuration of the requesting object (the secondary cluster). + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * 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 location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * + * 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. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object (the secondary cluster). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Configuration of the requesting object (the secondary cluster). + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); + $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php new file mode 100644 index 000000000000..47c2979f0739 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php @@ -0,0 +1,265 @@ +google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + */ +class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @type string $instance_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1beta\Instance $instance + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance::class); + $this->instance = $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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php new file mode 100644 index 000000000000..1d2e3e5e8b4d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php @@ -0,0 +1,257 @@ +google.cloud.alloydb.v1beta.CreateUserRequest + */ +class CreateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $user_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1beta\User $user + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\User::class); + $this->user = $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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php new file mode 100644 index 000000000000..a564379cd37c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php @@ -0,0 +1,68 @@ +google.cloud.alloydb.v1beta.DatabaseVersion + */ +class DatabaseVersion +{ + /** + * This is an unknown database version. + * + * Generated from protobuf enum DATABASE_VERSION_UNSPECIFIED = 0; + */ + const DATABASE_VERSION_UNSPECIFIED = 0; + /** + * DEPRECATED - The database version is Postgres 13. + * + * Generated from protobuf enum POSTGRES_13 = 1 [deprecated = true]; + */ + const POSTGRES_13 = 1; + /** + * The database version is Postgres 14. + * + * Generated from protobuf enum POSTGRES_14 = 2; + */ + const POSTGRES_14 = 2; + /** + * The database version is Postgres 15. + * + * Generated from protobuf enum POSTGRES_15 = 3; + */ + const POSTGRES_15 = 3; + + private static $valueToName = [ + self::DATABASE_VERSION_UNSPECIFIED => 'DATABASE_VERSION_UNSPECIFIED', + self::POSTGRES_13 => 'POSTGRES_13', + self::POSTGRES_14 => 'POSTGRES_14', + self::POSTGRES_15 => 'POSTGRES_15', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php new file mode 100644 index 000000000000..27d8cc420c20 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php @@ -0,0 +1,225 @@ +google.cloud.alloydb.v1beta.DeleteBackupRequest + */ +class DeleteBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * + * 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type string $etag + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * + * 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. For the required format, see the comment on + * the Backup.name field. + * + * 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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php new file mode 100644 index 000000000000..d580897f1f88 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php @@ -0,0 +1,259 @@ +google.cloud.alloydb.v1beta.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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 = ''; + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @type bool $force + * Optional. Whether to cascade delete child instances for given cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. Whether to cascade delete child instances for given cluster. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php new file mode 100644 index 000000000000..1666a6ec9898 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php @@ -0,0 +1,225 @@ +google.cloud.alloydb.v1beta.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type string $etag + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php new file mode 100644 index 000000000000..ad9652e2b333 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php @@ -0,0 +1,183 @@ +google.cloud.alloydb.v1beta.DeleteUserRequest + */ +class DeleteUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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 = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php new file mode 100644 index 000000000000..889b996900d2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1beta.EncryptionConfig + */ +class EncryptionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + */ + protected $kms_key_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kms_key_name + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * The fully-qualified resource name of the KMS key. + * Each Cloud KMS key is regionalized and has the following format: + * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + * + * Generated from protobuf field string kms_key_name = 1; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php new file mode 100644 index 000000000000..ae4a15a5fea2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1beta.EncryptionInfo + */ +class EncryptionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $encryption_type = 0; + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $kms_key_versions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $encryption_type + * Output only. Type of encryption. + * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_versions + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEncryptionType() + { + return $this->encryption_type; + } + + /** + * Output only. Type of encryption. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEncryptionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo\Type::class); + $this->encryption_type = $var; + + return $this; + } + + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKmsKeyVersions() + { + return $this->kms_key_versions; + } + + /** + * Output only. Cloud KMS key versions that are being used to protect the + * database or the backup. + * + * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKmsKeyVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kms_key_versions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php new file mode 100644 index 000000000000..8f3c5ae0ae5d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php @@ -0,0 +1,66 @@ +google.cloud.alloydb.v1beta.EncryptionInfo.Type + */ +class Type +{ + /** + * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The data is encrypted at rest with a key that is fully managed by Google. + * No key version will be populated. This is the default state. + * + * Generated from protobuf enum GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + const GOOGLE_DEFAULT_ENCRYPTION = 1; + /** + * The data is encrypted at rest with a key that is managed by the customer. + * KMS key versions will be populated. + * + * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + const CUSTOMER_MANAGED_ENCRYPTION = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::GOOGLE_DEFAULT_ENCRYPTION => 'GOOGLE_DEFAULT_ENCRYPTION', + self::CUSTOMER_MANAGED_ENCRYPTION => 'CUSTOMER_MANAGED_ENCRYPTION', + ]; + + 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(Type::class, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo_Type::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php new file mode 100644 index 000000000000..4e86f1d59317 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php @@ -0,0 +1,183 @@ +google.cloud.alloydb.v1beta.FailoverInstanceRequest + */ +class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php new file mode 100644 index 000000000000..44bfd85932e7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php @@ -0,0 +1,321 @@ +google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + */ +class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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 = ''; + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * + * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $pem_csr = ''; + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cert_duration = null; + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $public_key = ''; + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_metadata_exchange = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @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). + * @type string $pem_csr + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * @type \Google\Protobuf\Duration $cert_duration + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * @type string $public_key + * Optional. The public key from the client. + * @type bool $use_metadata_exchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * 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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * + * 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. 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; + } + + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * + * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getPemCsr() + { + @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); + return $this->pem_csr; + } + + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * + * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setPemCsr($var) + { + @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->pem_csr = $var; + + return $this; + } + + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getCertDuration() + { + return $this->cert_duration; + } + + public function hasCertDuration() + { + return isset($this->cert_duration); + } + + public function clearCertDuration() + { + unset($this->cert_duration); + } + + /** + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * + * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setCertDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->cert_duration = $var; + + return $this; + } + + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPublicKey() + { + return $this->public_key; + } + + /** + * Optional. The public key from the client. + * + * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPublicKey($var) + { + GPBUtil::checkString($var, True); + $this->public_key = $var; + + return $this; + } + + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseMetadataExchange() + { + return $this->use_metadata_exchange; + } + + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseMetadataExchange($var) + { + GPBUtil::checkBool($var); + $this->use_metadata_exchange = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php new file mode 100644 index 000000000000..d5063bdd9df9 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php @@ -0,0 +1,139 @@ +google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + */ +class GenerateClientCertificateResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The pem-encoded, signed X.509 certificate. + * + * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $pem_certificate = ''; + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $pem_certificate_chain; + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ca_cert = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pem_certificate + * Output only. The pem-encoded, signed X.509 certificate. + * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * @type string $ca_cert + * Optional. The pem-encoded cluster ca X.509 certificate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The pem-encoded, signed X.509 certificate. + * + * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPemCertificate() + { + return $this->pem_certificate; + } + + /** + * Output only. The pem-encoded, signed X.509 certificate. + * + * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPemCertificate($var) + { + GPBUtil::checkString($var, True); + $this->pem_certificate = $var; + + return $this; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPemCertificateChain() + { + return $this->pem_certificate_chain; + } + + /** + * Output only. The pem-encoded chain that may be used to verify the X.509 + * certificate. Expected to be in issuer-to-root order according to RFC 5246. + * + * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPemCertificateChain($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->pem_certificate_chain = $arr; + + return $this; + } + + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCaCert() + { + return $this->ca_cert; + } + + /** + * Optional. The pem-encoded cluster ca X.509 certificate. + * + * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCaCert($var) + { + GPBUtil::checkString($var, True); + $this->ca_cert = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php new file mode 100644 index 000000000000..a5863ee3745a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php @@ -0,0 +1,67 @@ +google.cloud.alloydb.v1beta.GetBackupRequest + */ +class GetBackupRequest 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 = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::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; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php new file mode 100644 index 000000000000..059f44808fb1 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php @@ -0,0 +1,109 @@ +google.cloud.alloydb.v1beta.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @type int $view + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\ClusterView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php new file mode 100644 index 000000000000..321d3f02e8e4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php @@ -0,0 +1,145 @@ +google.cloud.alloydb.v1beta.GetConnectionInfoRequest + */ +class GetConnectionInfoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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 = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * 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 name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * + * 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. 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php new file mode 100644 index 000000000000..a257b0e4165e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1beta.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.InstanceView view = 2; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @type int $view + * The view of the instance to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.InstanceView view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The view of the instance to return. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.InstanceView view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\InstanceView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php new file mode 100644 index 000000000000..8c12f9de8093 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php @@ -0,0 +1,71 @@ +google.cloud.alloydb.v1beta.GetUserRequest + */ +class GetUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the User.name field. + * + * 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php new file mode 100644 index 000000000000..2dec96d9b87d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php @@ -0,0 +1,221 @@ +google.cloud.alloydb.v1beta.InjectFaultRequest + */ +class InjectFaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fault_type = 0; + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $fault_type + * Required. The type of fault to be injected in an instance. + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getFaultType() + { + return $this->fault_type; + } + + /** + * Required. The type of fault to be injected in an instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setFaultType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\InjectFaultRequest\FaultType::class); + $this->fault_type = $var; + + return $this; + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * Generated from protobuf field string name = 2 [(.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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php new file mode 100644 index 000000000000..1fcf2b72d0cd --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php @@ -0,0 +1,58 @@ +google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType + */ +class FaultType +{ + /** + * The fault type is unknown. + * + * Generated from protobuf enum FAULT_TYPE_UNSPECIFIED = 0; + */ + const FAULT_TYPE_UNSPECIFIED = 0; + /** + * Stop the VM + * + * Generated from protobuf enum STOP_VM = 1; + */ + const STOP_VM = 1; + + private static $valueToName = [ + self::FAULT_TYPE_UNSPECIFIED => 'FAULT_TYPE_UNSPECIFIED', + self::STOP_VM => 'STOP_VM', + ]; + + 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(FaultType::class, \Google\Cloud\AlloyDb\V1beta\InjectFaultRequest_FaultType::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php new file mode 100644 index 000000000000..3446690251e6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php @@ -0,0 +1,1078 @@ +google.cloud.alloydb.v1beta.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + */ + private $labels; + /** + * Output only. The current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_type = 0; + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + */ + protected $machine_config = null; + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + */ + protected $availability_type = 0; + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + */ + protected $gce_zone = ''; + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + */ + private $database_flags; + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $writable_node = null; + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $nodes; + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + */ + protected $query_insights_config = null; + /** + * Read pool specific config. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + */ + protected $read_pool_config = null; + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ip_address = ''; + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + */ + protected $etag = ''; + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + */ + private $annotations; + /** + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + protected $update_policy = null; + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_connection_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * @type string $display_name + * User-settable and human-readable display name for the Instance. + * @type string $uid + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time stamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time stamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Delete time stamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type int $state + * Output only. The current serving state of the instance. + * @type int $instance_type + * Required. The type of the instance. Specified at creation time. + * @type \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig $machine_config + * Configurations for the machines that host the underlying + * database engine. + * @type int $availability_type + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * @type string $gce_zone + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * @type array|\Google\Protobuf\Internal\MapField $database_flags + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * @type \Google\Cloud\AlloyDb\V1beta\Instance\Node $writable_node + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * @type array<\Google\Cloud\AlloyDb\V1beta\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $nodes + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * @type \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig $query_insights_config + * Configuration for query insights. + * @type \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig $read_pool_config + * Read pool specific config. + * @type string $ip_address + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * @type bool $reconciling + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * @type string $etag + * For Resource freshness validation (https://google.aip.dev/154) + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * @type \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy $update_policy + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * @type \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig $client_connection_config + * Optional. Client connection specific configurations + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the instance resource with the format: + * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} + * where the cluster and instance ID segments should satisfy the regex + * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + * lowercase letters, numbers, and dashes, starting with a letter, and ending + * with a letter or number. For more details see https://google.aip.dev/122. + * The prefix of the instance resource name is the name of the parent + * resource: + * * projects/{project}/locations/{region}/clusters/{cluster_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User-settable and human-readable display name for the Instance. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UID of the resource. The UID is assigned + * when the resource is created, and it is retained until it is deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Delete time stamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 7; + * @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 current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current serving state of the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getInstanceType() + { + return $this->instance_type; + } + + /** + * Required. The type of the instance. Specified at creation time. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setInstanceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\InstanceType::class); + $this->instance_type = $var; + + return $this; + } + + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * @return \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig|null + */ + public function getMachineConfig() + { + return $this->machine_config; + } + + public function hasMachineConfig() + { + return isset($this->machine_config); + } + + public function clearMachineConfig() + { + unset($this->machine_config); + } + + /** + * Configurations for the machines that host the underlying + * database engine. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; + * @param \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig $var + * @return $this + */ + public function setMachineConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig::class); + $this->machine_config = $var; + + return $this; + } + + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * @return int + */ + public function getAvailabilityType() + { + return $this->availability_type; + } + + /** + * Availability type of an Instance. + * If empty, defaults to REGIONAL for primary instances. + * For read pools, availability_type is always UNSPECIFIED. Instances in the + * read pools are evenly distributed across available zones within the region + * (i.e. read pools with more than one node will have a node in at + * least two zones). + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; + * @param int $var + * @return $this + */ + public function setAvailabilityType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\AvailabilityType::class); + $this->availability_type = $var; + + return $this; + } + + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + * @return string + */ + public function getGceZone() + { + return $this->gce_zone; + } + + /** + * The Compute Engine zone that the instance should serve from, per + * https://cloud.google.com/compute/docs/regions-zones + * This can ONLY be specified for ZONAL instances. + * If present for a REGIONAL instance, an error will be thrown. + * If this is absent for a ZONAL instance, instance is created in a random + * zone with available capacity. + * + * Generated from protobuf field string gce_zone = 12; + * @param string $var + * @return $this + */ + public function setGceZone($var) + { + GPBUtil::checkString($var, True); + $this->gce_zone = $var; + + return $this; + } + + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDatabaseFlags() + { + return $this->database_flags; + } + + /** + * Database flags. Set at instance level. + * * They are copied from primary instance on read instance creation. + * * Read instances can set new or override existing flags that are relevant + * for reads, e.g. for enabling columnar cache on a read instance. Flags + * set on read instance may or may not be present on primary. + * This is a list of "key": "value" pairs. + * "key": The name of the flag. These flags are passed at instance setup time, + * so include both server options and system variables for Postgres. Flags are + * specified with underscores, not hyphens. + * "value": The value of the flag. Booleans are set to **on** for true + * and **off** for false. This field must be omitted if the flag + * doesn't take a value. + * + * Generated from protobuf field map database_flags = 13; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDatabaseFlags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->database_flags = $arr; + + return $this; + } + + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\Instance\Node|null + */ + public function getWritableNode() + { + return $this->writable_node; + } + + public function hasWritableNode() + { + return isset($this->writable_node); + } + + public function clearWritableNode() + { + unset($this->writable_node); + } + + /** + * Output only. This is set for the read-write VM of the PRIMARY instance + * only. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\Instance\Node $var + * @return $this + */ + public function setWritableNode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\Node::class); + $this->writable_node = $var; + + return $this; + } + + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Output only. List of available read-only VMs in this instance, including + * the standby for a PRIMARY instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\AlloyDb\V1beta\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Instance\Node::class); + $this->nodes = $arr; + + return $this; + } + + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * @return \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig|null + */ + public function getQueryInsightsConfig() + { + return $this->query_insights_config; + } + + public function hasQueryInsightsConfig() + { + return isset($this->query_insights_config); + } + + public function clearQueryInsightsConfig() + { + unset($this->query_insights_config); + } + + /** + * Configuration for query insights. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; + * @param \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig $var + * @return $this + */ + public function setQueryInsightsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig::class); + $this->query_insights_config = $var; + + return $this; + } + + /** + * Read pool specific config. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * @return \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig|null + */ + public function getReadPoolConfig() + { + return $this->read_pool_config; + } + + public function hasReadPoolConfig() + { + return isset($this->read_pool_config); + } + + public function clearReadPoolConfig() + { + unset($this->read_pool_config); + } + + /** + * Read pool specific config. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; + * @param \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig $var + * @return $this + */ + public function setReadPoolConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig::class); + $this->read_pool_config = $var; + + return $this; + } + + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Output only. The IP address for the Instance. + * This is the connection endpoint for an end-user application. + * + * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Reconciling (https://google.aip.dev/128#reconciliation). + * Set to true if the current state of Instance does not match the user's + * intended state, and the service is actively updating the resource to + * reconcile them. This can happen due to user-triggered updates or + * system actions like failover or maintenance. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * For Resource freshness validation (https://google.aip.dev/154) + * + * Generated from protobuf field string etag = 17; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Annotations to allow client tools to store small amount of arbitrary data. + * This is distinct from labels. + * https://google.aip.dev/128 + * + * Generated from protobuf field map annotations = 18; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * @return \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy|null + */ + public function getUpdatePolicy() + { + return $this->update_policy; + } + + public function hasUpdatePolicy() + { + return isset($this->update_policy); + } + + public function clearUpdatePolicy() + { + unset($this->update_policy); + } + + /** + * Update policy that will be applied during instance update. + * This field is not persisted when you update the instance. + * To use a non-default update policy, you must + * specify explicitly specify the value in each update request. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * @param \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy $var + * @return $this + */ + public function setUpdatePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy::class); + $this->update_policy = $var; + + return $this; + } + + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig|null + */ + public function getClientConnectionConfig() + { + return $this->client_connection_config; + } + + public function hasClientConnectionConfig() + { + return isset($this->client_connection_config); + } + + public function clearClientConnectionConfig() + { + unset($this->client_connection_config); + } + + /** + * Optional. Client connection specific configurations + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig $var + * @return $this + */ + public function setClientConnectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig::class); + $this->client_connection_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php new file mode 100644 index 000000000000..55bf4ab06611 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php @@ -0,0 +1,68 @@ +google.cloud.alloydb.v1beta.Instance.AvailabilityType + */ +class AvailabilityType +{ + /** + * This is an unknown Availability type. + * + * Generated from protobuf enum AVAILABILITY_TYPE_UNSPECIFIED = 0; + */ + const AVAILABILITY_TYPE_UNSPECIFIED = 0; + /** + * Zonal available instance. + * + * Generated from protobuf enum ZONAL = 1; + */ + const ZONAL = 1; + /** + * Regional (or Highly) available instance. + * + * Generated from protobuf enum REGIONAL = 2; + */ + const REGIONAL = 2; + + private static $valueToName = [ + self::AVAILABILITY_TYPE_UNSPECIFIED => 'AVAILABILITY_TYPE_UNSPECIFIED', + self::ZONAL => 'ZONAL', + self::REGIONAL => 'REGIONAL', + ]; + + 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(AvailabilityType::class, \Google\Cloud\AlloyDb\V1beta\Instance_AvailabilityType::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php new file mode 100644 index 000000000000..9bdea08746a5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php @@ -0,0 +1,118 @@ +google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + */ +class ClientConnectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $require_connectors = false; + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $require_connectors + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * @type \Google\Cloud\AlloyDb\V1beta\SslConfig $ssl_config + * Optional. SSL config option for this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequireConnectors() + { + return $this->require_connectors; + } + + /** + * Optional. Configuration to enforce connectors only (ex: AuthProxy) + * connections to the database. + * + * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequireConnectors($var) + { + GPBUtil::checkBool($var); + $this->require_connectors = $var; + + return $this; + } + + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1beta\SslConfig|null + */ + public function getSslConfig() + { + return $this->ssl_config; + } + + public function hasSslConfig() + { + return isset($this->ssl_config); + } + + public function clearSslConfig() + { + unset($this->ssl_config); + } + + /** + * Optional. SSL config option for this instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1beta\SslConfig $var + * @return $this + */ + public function setSslConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SslConfig::class); + $this->ssl_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClientConnectionConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_ClientConnectionConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php new file mode 100644 index 000000000000..2c89a5a8f11d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php @@ -0,0 +1,76 @@ +google.cloud.alloydb.v1beta.Instance.InstanceType + */ +class InstanceType +{ + /** + * The type of the instance is unknown. + * + * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; + */ + const INSTANCE_TYPE_UNSPECIFIED = 0; + /** + * PRIMARY instances support read and write operations. + * + * Generated from protobuf enum PRIMARY = 1; + */ + const PRIMARY = 1; + /** + * READ POOL instances support read operations only. Each read pool instance + * consists of one or more homogeneous nodes. + * * Read pool of size 1 can only have zonal availability. + * * Read pools with node count of 2 or more can have regional + * availability (nodes are present in 2 or more zones in a region). + * + * Generated from protobuf enum READ_POOL = 2; + */ + const READ_POOL = 2; + /** + * SECONDARY instances support read operations only. SECONDARY instance + * is a cross-region read replica + * + * Generated from protobuf enum SECONDARY = 3; + */ + const SECONDARY = 3; + + private static $valueToName = [ + self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', + self::PRIMARY => 'PRIMARY', + self::READ_POOL => 'READ_POOL', + self::SECONDARY => 'SECONDARY', + ]; + + 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\AlloyDb\V1beta\Instance_InstanceType::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php new file mode 100644 index 000000000000..15d3ebd714c2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1beta.Instance.MachineConfig + */ +class MachineConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + */ + protected $cpu_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $cpu_count + * The number of CPU's in the VM instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + * @return int + */ + public function getCpuCount() + { + return $this->cpu_count; + } + + /** + * The number of CPU's in the VM instance. + * + * Generated from protobuf field int32 cpu_count = 1; + * @param int $var + * @return $this + */ + public function setCpuCount($var) + { + GPBUtil::checkInt32($var); + $this->cpu_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MachineConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_MachineConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php new file mode 100644 index 000000000000..65edd54cb74b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php @@ -0,0 +1,186 @@ +google.cloud.alloydb.v1beta.Instance.Node + */ +class Node extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + */ + protected $zone_id = ''; + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + */ + protected $id = ''; + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + */ + protected $ip = ''; + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + */ + protected $state = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone_id + * The Compute Engine zone of the VM e.g. "us-central1-b". + * @type string $id + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * @type string $ip + * The private IP address of the VM e.g. "10.57.0.34". + * @type string $state + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + * @return string + */ + public function getZoneId() + { + return $this->zone_id; + } + + /** + * The Compute Engine zone of the VM e.g. "us-central1-b". + * + * Generated from protobuf field string zone_id = 1; + * @param string $var + * @return $this + */ + public function setZoneId($var) + { + GPBUtil::checkString($var, True); + $this->zone_id = $var; + + return $this; + } + + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + * + * Generated from protobuf field string id = 2; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + * @return string + */ + public function getIp() + { + return $this->ip; + } + + /** + * The private IP address of the VM e.g. "10.57.0.34". + * + * Generated from protobuf field string ip = 3; + * @param string $var + * @return $this + */ + public function setIp($var) + { + GPBUtil::checkString($var, True); + $this->ip = $var; + + return $this; + } + + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * Determined by state of the compute VM and postgres-service health. + * Compute VM state can have values listed in + * https://cloud.google.com/compute/docs/instances/instance-life-cycle and + * postgres-service health can have values: HEALTHY and UNHEALTHY. + * + * Generated from protobuf field string state = 4; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Node::class, \Google\Cloud\AlloyDb\V1beta\Instance_Node::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php new file mode 100644 index 000000000000..08641330ed26 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php @@ -0,0 +1,222 @@ +google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + */ +class QueryInsightsInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + */ + protected $record_application_tags = null; + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + */ + protected $record_client_address = null; + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + */ + protected $query_string_length = 0; + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + */ + protected $query_plans_per_minute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $record_application_tags + * Record application tags for an instance. + * This flag is turned "on" by default. + * @type bool $record_client_address + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * @type int $query_string_length + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * @type int $query_plans_per_minute + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + * @return bool + */ + public function getRecordApplicationTags() + { + return isset($this->record_application_tags) ? $this->record_application_tags : false; + } + + public function hasRecordApplicationTags() + { + return isset($this->record_application_tags); + } + + public function clearRecordApplicationTags() + { + unset($this->record_application_tags); + } + + /** + * Record application tags for an instance. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_application_tags = 2; + * @param bool $var + * @return $this + */ + public function setRecordApplicationTags($var) + { + GPBUtil::checkBool($var); + $this->record_application_tags = $var; + + return $this; + } + + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + * @return bool + */ + public function getRecordClientAddress() + { + return isset($this->record_client_address) ? $this->record_client_address : false; + } + + public function hasRecordClientAddress() + { + return isset($this->record_client_address); + } + + public function clearRecordClientAddress() + { + unset($this->record_client_address); + } + + /** + * Record client address for an instance. Client address is PII information. + * This flag is turned "on" by default. + * + * Generated from protobuf field optional bool record_client_address = 3; + * @param bool $var + * @return $this + */ + public function setRecordClientAddress($var) + { + GPBUtil::checkBool($var); + $this->record_client_address = $var; + + return $this; + } + + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + * @return int + */ + public function getQueryStringLength() + { + return $this->query_string_length; + } + + /** + * Query string length. The default value is 1024. + * Any integer between 256 and 4500 is considered valid. + * + * Generated from protobuf field uint32 query_string_length = 4; + * @param int $var + * @return $this + */ + public function setQueryStringLength($var) + { + GPBUtil::checkUint32($var); + $this->query_string_length = $var; + + return $this; + } + + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + * @return int + */ + public function getQueryPlansPerMinute() + { + return isset($this->query_plans_per_minute) ? $this->query_plans_per_minute : 0; + } + + public function hasQueryPlansPerMinute() + { + return isset($this->query_plans_per_minute); + } + + public function clearQueryPlansPerMinute() + { + unset($this->query_plans_per_minute); + } + + /** + * Number of query execution plans captured by Insights per minute + * for all queries combined. The default value is 5. + * Any integer between 0 and 20 is considered valid. + * + * Generated from protobuf field optional uint32 query_plans_per_minute = 5; + * @param int $var + * @return $this + */ + public function setQueryPlansPerMinute($var) + { + GPBUtil::checkUint32($var); + $this->query_plans_per_minute = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryInsightsInstanceConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_QueryInsightsInstanceConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php new file mode 100644 index 000000000000..214e155a2d4c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + */ +class ReadPoolConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $node_count + * Read capacity, i.e. number of nodes in a read pool instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + * @return int + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Read capacity, i.e. number of nodes in a read pool instance. + * + * Generated from protobuf field int32 node_count = 1; + * @param int $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt32($var); + $this->node_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReadPoolConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_ReadPoolConfig::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php new file mode 100644 index 000000000000..e3bc6a4b7e94 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php @@ -0,0 +1,112 @@ +google.cloud.alloydb.v1beta.Instance.State + */ +class State +{ + /** + * The state of the instance is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The instance is active and running. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The instance is stopped. Instance name and IP resources are preserved. + * + * Generated from protobuf enum STOPPED = 2; + */ + const STOPPED = 2; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 3; + */ + const CREATING = 3; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + /** + * The instance is down for maintenance. + * + * Generated from protobuf enum MAINTENANCE = 5; + */ + const MAINTENANCE = 5; + /** + * The creation of the instance failed or a fatal error occurred during + * an operation on the instance. + * Note: Instances in this state would tried to be auto-repaired. And + * Customers should be able to restart, update or delete these instances. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that + * index unused in case that state also needs to exposed via consumer apis + * in future. + * The instance has been configured to sync data from some other source. + * + * Generated from protobuf enum BOOTSTRAPPING = 8; + */ + const BOOTSTRAPPING = 8; + /** + * The instance is being promoted. + * + * Generated from protobuf enum PROMOTING = 9; + */ + const PROMOTING = 9; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::STOPPED => 'STOPPED', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::MAINTENANCE => 'MAINTENANCE', + self::FAILED => 'FAILED', + self::BOOTSTRAPPING => 'BOOTSTRAPPING', + self::PROMOTING => 'PROMOTING', + ]; + + 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(State::class, \Google\Cloud\AlloyDb\V1beta\Instance_State::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php new file mode 100644 index 000000000000..d400f401c594 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php @@ -0,0 +1,70 @@ +google.cloud.alloydb.v1beta.Instance.UpdatePolicy + */ +class UpdatePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Mode for updating the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Mode for updating the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Mode for updating the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Mode for updating the instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy\Mode::class); + $this->mode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UpdatePolicy::class, \Google\Cloud\AlloyDb\V1beta\Instance_UpdatePolicy::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php new file mode 100644 index 000000000000..87165195dffe --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php @@ -0,0 +1,69 @@ +google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode + */ +class Mode +{ + /** + * Mode is unknown. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Least disruptive way to apply the update. + * + * Generated from protobuf enum DEFAULT = 1; + */ + const PBDEFAULT = 1; + /** + * Performs a forced update when applicable. This will be fast but may + * incur a downtime. + * + * Generated from protobuf enum FORCE_APPLY = 2; + */ + const FORCE_APPLY = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::PBDEFAULT => 'DEFAULT', + self::FORCE_APPLY => 'FORCE_APPLY', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\AlloyDb\V1beta\Instance_UpdatePolicy_Mode::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php new file mode 100644 index 000000000000..6cf60b54e17a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1beta.InstanceView + */ +class InstanceView +{ + /** + * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + * + * Generated from protobuf enum INSTANCE_VIEW_UNSPECIFIED = 0; + */ + const INSTANCE_VIEW_UNSPECIFIED = 0; + /** + * BASIC server responses for a primary or read instance include all the + * relevant instance details, excluding the details of each node in the + * instance. The default value. + * + * Generated from protobuf enum INSTANCE_VIEW_BASIC = 1; + */ + const INSTANCE_VIEW_BASIC = 1; + /** + * FULL response is equivalent to BASIC for primary instance (for now). + * For read pool instance, this includes details of each node in the pool. + * + * Generated from protobuf enum INSTANCE_VIEW_FULL = 2; + */ + const INSTANCE_VIEW_FULL = 2; + + private static $valueToName = [ + self::INSTANCE_VIEW_UNSPECIFIED => 'INSTANCE_VIEW_UNSPECIFIED', + self::INSTANCE_VIEW_BASIC => 'INSTANCE_VIEW_BASIC', + self::INSTANCE_VIEW_FULL => 'INSTANCE_VIEW_FULL', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php new file mode 100644 index 000000000000..97c8e67e0c9c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php @@ -0,0 +1,207 @@ +google.cloud.alloydb.v1beta.ListBackupsRequest + */ +class ListBackupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListBackupsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListBackupsRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListBackupsRequest + * + * 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. Parent value for ListBackupsRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php new file mode 100644 index 000000000000..38fecf7acff7 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1beta.ListBackupsResponse + */ +class ListBackupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + */ + private $backups; + /** + * 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\AlloyDb\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $backups + * The list of Backup + * @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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackups() + { + return $this->backups; + } + + /** + * The list of Backup + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Backup backups = 1; + * @param array<\Google\Cloud\AlloyDb\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Backup::class); + $this->backups = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php new file mode 100644 index 000000000000..79fe6741e205 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php @@ -0,0 +1,219 @@ +google.cloud.alloydb.v1beta.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * @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 + * 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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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 name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * + * 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; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php new file mode 100644 index 000000000000..90673b1a4358 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1beta.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + */ + private $clusters; + /** + * 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\AlloyDb\V1beta\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters + * The list of Cluster + * @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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * The list of Cluster + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; + * @param array<\Google\Cloud\AlloyDb\V1beta\Cluster>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Cluster::class); + $this->clusters = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php new file mode 100644 index 000000000000..61a7c9a1f142 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php @@ -0,0 +1,227 @@ +google.cloud.alloydb.v1beta.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * @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 + * 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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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 name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * + * 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; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php new file mode 100644 index 000000000000..fb10a034d42f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1beta.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + */ + private $instances; + /** + * 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\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of Instance + * @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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of Instance + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; + * @param array<\Google\Cloud\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Instance::class); + $this->instances = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php new file mode 100644 index 000000000000..5f0dd98c3470 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php @@ -0,0 +1,159 @@ +google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + */ +class ListSupportedDatabaseFlagsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * 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 name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php new file mode 100644 index 000000000000..519a0fed0ade --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php @@ -0,0 +1,101 @@ +google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + */ +class ListSupportedDatabaseFlagsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + */ + private $supported_database_flags; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $supported_database_flags + * The list of SupportedDatabaseFlags. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedDatabaseFlags() + { + return $this->supported_database_flags; + } + + /** + * The list of SupportedDatabaseFlags. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; + * @param array<\Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedDatabaseFlags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag::class); + $this->supported_database_flags = $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; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php new file mode 100644 index 000000000000..c0e4f33ec832 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php @@ -0,0 +1,207 @@ +google.cloud.alloydb.v1beta.ListUsersRequest + */ +class ListUsersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListUsersRequest + * + * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListUsersRequest + * @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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListUsersRequest + * + * 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. Parent value for ListUsersRequest + * + * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php new file mode 100644 index 000000000000..931a533b9be6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php @@ -0,0 +1,135 @@ +google.cloud.alloydb.v1beta.ListUsersResponse + */ +class ListUsersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + private $users; + /** + * 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\AlloyDb\V1beta\User>|\Google\Protobuf\Internal\RepeatedField $users + * The list of User + * @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\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.User users = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsers() + { + return $this->users; + } + + /** + * The list of User + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.User users = 1; + * @param array<\Google\Cloud\AlloyDb\V1beta\User>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\User::class); + $this->users = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php new file mode 100644 index 000000000000..c3bcc142fd39 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php @@ -0,0 +1,144 @@ +google.cloud.alloydb.v1beta.MigrationSource + */ +class MigrationSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $host_port = ''; + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reference_id = ''; + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_port + * Output only. The host and port of the on-premises instance in host:port + * format + * @type string $reference_id + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * @type int $source_type + * Output only. Type of migration source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getHostPort() + { + return $this->host_port; + } + + /** + * Output only. The host and port of the on-premises instance in host:port + * format + * + * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setHostPort($var) + { + GPBUtil::checkString($var, True); + $this->host_port = $var; + + return $this; + } + + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReferenceId() + { + return $this->reference_id; + } + + /** + * Output only. Place holder for the external source identifier(e.g DMS job + * name) that created the cluster. + * + * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReferenceId($var) + { + GPBUtil::checkString($var, True); + $this->reference_id = $var; + + return $this; + } + + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * Output only. Type of migration source. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\MigrationSource\MigrationSourceType::class); + $this->source_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php new file mode 100644 index 000000000000..0042f58cb5db --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php @@ -0,0 +1,57 @@ +google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType + */ +class MigrationSourceType +{ + /** + * Migration source is unknown. + * + * Generated from protobuf enum MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + */ + const MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + /** + * DMS source means the cluster was created via DMS migration job. + * + * Generated from protobuf enum DMS = 1; + */ + const DMS = 1; + + private static $valueToName = [ + self::MIGRATION_SOURCE_TYPE_UNSPECIFIED => 'MIGRATION_SOURCE_TYPE_UNSPECIFIED', + self::DMS => 'DMS', + ]; + + 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(MigrationSourceType::class, \Google\Cloud\AlloyDb\V1beta\MigrationSource_MigrationSourceType::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php new file mode 100644 index 000000000000..b7a852470274 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php @@ -0,0 +1,349 @@ +google.cloud.alloydb.v1beta.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 = ''; + protected $request_specific; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata $batch_create_instances_metadata + * Output only. BatchCreateInstances related metadata. + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Output only. BatchCreateInstances related metadata. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata|null + */ + public function getBatchCreateInstancesMetadata() + { + return $this->readOneof(8); + } + + public function hasBatchCreateInstancesMetadata() + { + return $this->hasOneof(8); + } + + /** + * Output only. BatchCreateInstances related metadata. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata $var + * @return $this + */ + public function setBatchCreateInstancesMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * 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; + } + + /** + * @return string + */ + public function getRequestSpecific() + { + return $this->whichOneof("request_specific"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php new file mode 100644 index 000000000000..daf0cacf087f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php @@ -0,0 +1,225 @@ +google.cloud.alloydb.v1beta.PromoteClusterRequest + */ +class PromoteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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 = ''; + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * 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; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php new file mode 100644 index 000000000000..a651f553da3e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php @@ -0,0 +1,181 @@ +google.cloud.alloydb.v1beta.RestartInstanceRequest + */ +class RestartInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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 = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * + * 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; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php new file mode 100644 index 000000000000..46651d5bb3ca --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php @@ -0,0 +1,344 @@ +google.cloud.alloydb.v1beta.RestoreClusterRequest + */ +class RestoreClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1beta\BackupSource $backup_source + * Backup source. + * @type \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource $continuous_backup_source + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @type string $parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @type string $cluster_id + * Required. ID of the requesting object. + * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster + * Required. The resource being created + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Backup source. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * @return \Google\Cloud\AlloyDb\V1beta\BackupSource|null + */ + public function getBackupSource() + { + return $this->readOneof(4); + } + + public function hasBackupSource() + { + return $this->hasOneof(4); + } + + /** + * Backup source. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; + * @param \Google\Cloud\AlloyDb\V1beta\BackupSource $var + * @return $this + */ + public function setBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\BackupSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * @return \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource|null + */ + public function getContinuousBackupSource() + { + return $this->readOneof(8); + } + + public function hasContinuousBackupSource() + { + return $this->hasOneof(8); + } + + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; + * @param \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource $var + * @return $this + */ + public function setContinuousBackupSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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 name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * + * 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. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the requesting object. + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); + $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * + * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php new file mode 100644 index 000000000000..5b713a89f411 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1beta.SslConfig + */ +class SslConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_mode = 0; + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ca_source = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $ssl_mode + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * @type int $ca_source + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSslMode() + { + return $this->ssl_mode; + } + + /** + * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSslMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\SslConfig\SslMode::class); + $this->ssl_mode = $var; + + return $this; + } + + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCaSource() + { + return $this->ca_source; + } + + /** + * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + * supported currently, and is the default value. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCaSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\SslConfig\CaSource::class); + $this->ca_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php new file mode 100644 index 000000000000..d0cd73cbada3 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php @@ -0,0 +1,58 @@ +google.cloud.alloydb.v1beta.SslConfig.CaSource + */ +class CaSource +{ + /** + * Certificate Authority (CA) source not specified. Defaults to + * CA_SOURCE_MANAGED. + * + * Generated from protobuf enum CA_SOURCE_UNSPECIFIED = 0; + */ + const CA_SOURCE_UNSPECIFIED = 0; + /** + * Certificate Authority (CA) managed by the AlloyDB Cluster. + * + * Generated from protobuf enum CA_SOURCE_MANAGED = 1; + */ + const CA_SOURCE_MANAGED = 1; + + private static $valueToName = [ + self::CA_SOURCE_UNSPECIFIED => 'CA_SOURCE_UNSPECIFIED', + self::CA_SOURCE_MANAGED => 'CA_SOURCE_MANAGED', + ]; + + 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(CaSource::class, \Google\Cloud\AlloyDb\V1beta\SslConfig_CaSource::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php new file mode 100644 index 000000000000..f85486b17cf8 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php @@ -0,0 +1,89 @@ +google.cloud.alloydb.v1beta.SslConfig.SslMode + */ +class SslMode +{ + /** + * SSL mode not specified. Defaults to ENCRYPTED_ONLY. + * + * Generated from protobuf enum SSL_MODE_UNSPECIFIED = 0; + */ + const SSL_MODE_UNSPECIFIED = 0; + /** + * SSL connections are optional. CA verification not enforced. + * + * Generated from protobuf enum SSL_MODE_ALLOW = 1 [deprecated = true]; + */ + const SSL_MODE_ALLOW = 1; + /** + * SSL connections are required. CA verification not enforced. + * Clients may use locally self-signed certificates (default psql client + * behavior). + * + * Generated from protobuf enum SSL_MODE_REQUIRE = 2 [deprecated = true]; + */ + const SSL_MODE_REQUIRE = 2; + /** + * SSL connections are required. CA verification enforced. + * Clients must have certificates signed by a Cluster CA, e.g. via + * GenerateClientCertificate. + * + * Generated from protobuf enum SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + */ + const SSL_MODE_VERIFY_CA = 3; + /** + * SSL connections are optional. CA verification not enforced. + * + * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + /** + * SSL connections are required. CA verification not enforced. + * + * Generated from protobuf enum ENCRYPTED_ONLY = 5; + */ + const ENCRYPTED_ONLY = 5; + + private static $valueToName = [ + self::SSL_MODE_UNSPECIFIED => 'SSL_MODE_UNSPECIFIED', + self::SSL_MODE_ALLOW => 'SSL_MODE_ALLOW', + self::SSL_MODE_REQUIRE => 'SSL_MODE_REQUIRE', + self::SSL_MODE_VERIFY_CA => 'SSL_MODE_VERIFY_CA', + self::ALLOW_UNENCRYPTED_AND_ENCRYPTED => 'ALLOW_UNENCRYPTED_AND_ENCRYPTED', + self::ENCRYPTED_ONLY => 'ENCRYPTED_ONLY', + ]; + + 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(SslMode::class, \Google\Cloud\AlloyDb\V1beta\SslConfig_SslMode::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php new file mode 100644 index 000000000000..7aea82a4c7cb --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php @@ -0,0 +1,337 @@ +google.cloud.alloydb.v1beta.SupportedDatabaseFlag + */ +class SupportedDatabaseFlag extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + */ + protected $flag_name = ''; + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + */ + protected $value_type = 0; + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + */ + protected $accepts_multiple_values = false; + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + */ + private $supported_db_versions; + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + */ + protected $requires_db_restart = false; + protected $restrictions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions $string_restrictions + * Restriction on STRING type value. + * @type \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions $integer_restrictions + * Restriction on INTEGER type value. + * @type string $name + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * @type string $flag_name + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * @type int $value_type + * @type bool $accepts_multiple_values + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_db_versions + * Major database engine versions for which this flag is supported. + * @type bool $requires_db_restart + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Restriction on STRING type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * @return \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions|null + */ + public function getStringRestrictions() + { + return $this->readOneof(7); + } + + public function hasStringRestrictions() + { + return $this->hasOneof(7); + } + + /** + * Restriction on STRING type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; + * @param \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions $var + * @return $this + */ + public function setStringRestrictions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Restriction on INTEGER type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * @return \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions|null + */ + public function getIntegerRestrictions() + { + return $this->readOneof(8); + } + + public function hasIntegerRestrictions() + { + return $this->hasOneof(8); + } + + /** + * Restriction on INTEGER type value. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; + * @param \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions $var + * @return $this + */ + public function setIntegerRestrictions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the flag resource, following Google Cloud conventions, e.g.: + * * projects/{project}/locations/{location}/flags/{flag} + * This field currently has no semantic meaning. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + * @return string + */ + public function getFlagName() + { + return $this->flag_name; + } + + /** + * The name of the database flag, e.g. "max_allowed_packets". + * The is a possibly key for the Instance.database_flags map field. + * + * Generated from protobuf field string flag_name = 2; + * @param string $var + * @return $this + */ + public function setFlagName($var) + { + GPBUtil::checkString($var, True); + $this->flag_name = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + * @return bool + */ + public function getAcceptsMultipleValues() + { + return $this->accepts_multiple_values; + } + + /** + * Whether the database flag accepts multiple values. If true, + * a comma-separated list of stringified values may be specified. + * + * Generated from protobuf field bool accepts_multiple_values = 4; + * @param bool $var + * @return $this + */ + public function setAcceptsMultipleValues($var) + { + GPBUtil::checkBool($var); + $this->accepts_multiple_values = $var; + + return $this; + } + + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedDbVersions() + { + return $this->supported_db_versions; + } + + /** + * Major database engine versions for which this flag is supported. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedDbVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AlloyDb\V1beta\DatabaseVersion::class); + $this->supported_db_versions = $arr; + + return $this; + } + + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + * @return bool + */ + public function getRequiresDbRestart() + { + return $this->requires_db_restart; + } + + /** + * Whether setting or updating this flag on an Instance requires a database + * restart. If a flag that requires database restart is set, the backend + * will automatically restart the database (making sure to satisfy any + * availability SLO's). + * + * Generated from protobuf field bool requires_db_restart = 6; + * @param bool $var + * @return $this + */ + public function setRequiresDbRestart($var) + { + GPBUtil::checkBool($var); + $this->requires_db_restart = $var; + + return $this; + } + + /** + * @return string + */ + public function getRestrictions() + { + return $this->whichOneof("restrictions"); + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php new file mode 100644 index 000000000000..696f2ff77b67 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php @@ -0,0 +1,178 @@ +google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + */ +class IntegerRestrictions extends \Google\Protobuf\Internal\Message +{ + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + */ + protected $min_value = null; + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + */ + protected $max_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int64Value $min_value + * The minimum value that can be specified, if applicable. + * @type \Google\Protobuf\Int64Value $max_value + * The maximum value that can be specified, if applicable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMinValue() + { + return $this->min_value; + } + + public function hasMinValue() + { + return isset($this->min_value); + } + + public function clearMinValue() + { + unset($this->min_value); + } + + /** + * Returns the unboxed value from getMinValue() + + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @return int|string|null + */ + public function getMinValueUnwrapped() + { + return $this->readWrapperValue("min_value"); + } + + /** + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMinValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->min_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * The minimum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; + * @param int|string|null $var + * @return $this + */ + public function setMinValueUnwrapped($var) + { + $this->writeWrapperValue("min_value", $var); + return $this;} + + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMaxValue() + { + return $this->max_value; + } + + public function hasMaxValue() + { + return isset($this->max_value); + } + + public function clearMaxValue() + { + unset($this->max_value); + } + + /** + * Returns the unboxed value from getMaxValue() + + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @return int|string|null + */ + public function getMaxValueUnwrapped() + { + return $this->readWrapperValue("max_value"); + } + + /** + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMaxValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->max_value = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * The maximum value that can be specified, if applicable. + * + * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; + * @param int|string|null $var + * @return $this + */ + public function setMaxValueUnwrapped($var) + { + $this->writeWrapperValue("max_value", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IntegerRestrictions::class, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag_IntegerRestrictions::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php new file mode 100644 index 000000000000..eed5b5cd7cfe --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php @@ -0,0 +1,74 @@ +google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + */ +class StringRestrictions extends \Google\Protobuf\Internal\Message +{ + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + */ + private $allowed_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedValues() + { + return $this->allowed_values; + } + + /** + * The list of allowed values, if bounded. This field will be empty + * if there is a unbounded number of allowed values. + * + * Generated from protobuf field repeated string allowed_values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StringRestrictions::class, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag_StringRestrictions::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php new file mode 100644 index 000000000000..70ee918dffa2 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php @@ -0,0 +1,80 @@ +google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType + */ +class ValueType +{ + /** + * This is an unknown flag type. + * + * Generated from protobuf enum VALUE_TYPE_UNSPECIFIED = 0; + */ + const VALUE_TYPE_UNSPECIFIED = 0; + /** + * String type flag. + * + * Generated from protobuf enum STRING = 1; + */ + const STRING = 1; + /** + * Integer type flag. + * + * Generated from protobuf enum INTEGER = 2; + */ + const INTEGER = 2; + /** + * Float type flag. + * + * Generated from protobuf enum FLOAT = 3; + */ + const FLOAT = 3; + /** + * Denotes that the flag does not accept any values. + * + * Generated from protobuf enum NONE = 4; + */ + const NONE = 4; + + private static $valueToName = [ + self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', + self::STRING => 'STRING', + self::INTEGER => 'INTEGER', + self::FLOAT => 'FLOAT', + self::NONE => 'NONE', + ]; + + 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(ValueType::class, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag_ValueType::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php new file mode 100644 index 000000000000..acf677a37046 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php @@ -0,0 +1,287 @@ +google.cloud.alloydb.v1beta.UpdateBackupRequest + */ +class UpdateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1beta\Backup $backup + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Backup::class); + $this->backup = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php new file mode 100644 index 000000000000..a84bb6b0f1cd --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php @@ -0,0 +1,291 @@ +google.cloud.alloydb.v1beta.UpdateClusterRequest + */ +class UpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); + $this->cluster = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php new file mode 100644 index 000000000000..9e384c42caf5 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php @@ -0,0 +1,291 @@ +google.cloud.alloydb.v1beta.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1beta\Instance $instance + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allow_missing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance::class); + $this->instance = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php new file mode 100644 index 000000000000..8f9004b51523 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php @@ -0,0 +1,283 @@ +google.cloud.alloydb.v1beta.UpdateUserRequest + */ +class UpdateUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\AlloyDb\V1beta\User $user + * Required. The resource being updated + * @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). + * @type bool $validate_only + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allow_missing + * Optional. Allow missing fields in the update mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AlloyDb\V1beta\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AlloyDb\V1beta\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\User::class); + $this->user = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. Allow missing fields in the update mask. + * + * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php new file mode 100644 index 000000000000..b8a8e5c1a62f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php @@ -0,0 +1,177 @@ +google.cloud.alloydb.v1beta.User + */ +class User extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $password = ''; + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $database_roles; + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * @type string $password + * Input only. Password for the user. + * @type array|\Google\Protobuf\Internal\RepeatedField $database_roles + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * @type int $user_type + * Optional. Type of this user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the resource in the form of + * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Input only. Password for the user. + * + * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatabaseRoles() + { + return $this->database_roles; + } + + /** + * Optional. List of database roles this user has. + * The database role strings are subject to the PostgreSQL naming conventions. + * + * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatabaseRoles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->database_roles = $arr; + + return $this; + } + + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getUserType() + { + return $this->user_type; + } + + /** + * Optional. Type of this user. + * + * Generated from protobuf field .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setUserType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\User\UserType::class); + $this->user_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php new file mode 100644 index 000000000000..de0c45e53dec --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php @@ -0,0 +1,65 @@ +google.cloud.alloydb.v1beta.User.UserType + */ +class UserType +{ + /** + * Unspecified user type. + * + * Generated from protobuf enum USER_TYPE_UNSPECIFIED = 0; + */ + const USER_TYPE_UNSPECIFIED = 0; + /** + * The default user type that authenticates via password-based + * authentication. + * + * Generated from protobuf enum ALLOYDB_BUILT_IN = 1; + */ + const ALLOYDB_BUILT_IN = 1; + /** + * Database user that can authenticate via IAM-Based authentication. + * + * Generated from protobuf enum ALLOYDB_IAM_USER = 2; + */ + const ALLOYDB_IAM_USER = 2; + + private static $valueToName = [ + self::USER_TYPE_UNSPECIFIED => 'USER_TYPE_UNSPECIFIED', + self::ALLOYDB_BUILT_IN => 'ALLOYDB_BUILT_IN', + self::ALLOYDB_IAM_USER => 'ALLOYDB_IAM_USER', + ]; + + 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(UserType::class, \Google\Cloud\AlloyDb\V1beta\User_UserType::class); + diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php new file mode 100644 index 000000000000..e06daa34e50a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php @@ -0,0 +1,102 @@ +google.cloud.alloydb.v1beta.UserPassword + */ +class UserPassword extends \Google\Protobuf\Internal\Message +{ + /** + * The database username. + * + * Generated from protobuf field string user = 1; + */ + protected $user = ''; + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + */ + protected $password = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $user + * The database username. + * @type string $password + * The initial password for the user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The database username. + * + * Generated from protobuf field string user = 1; + * @return string + */ + public function getUser() + { + return $this->user; + } + + /** + * The database username. + * + * Generated from protobuf field string user = 1; + * @param string $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkString($var, True); + $this->user = $var; + + return $this; + } + + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * The initial password for the user. + * + * Generated from protobuf field string password = 2; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php new file mode 100644 index 000000000000..52e84d7f74f0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php @@ -0,0 +1,123 @@ +setInstanceType($requestsCreateInstanceRequestsInstanceInstanceType); + $createInstanceRequest = (new CreateInstanceRequest()) + ->setParent($formattedRequestsCreateInstanceRequestsParent) + ->setInstanceId($requestsCreateInstanceRequestsInstanceId) + ->setInstance($requestsCreateInstanceRequestsInstance); + $requestsCreateInstanceRequests = [$createInstanceRequest,]; + $requests = (new CreateInstanceRequests()) + ->setCreateInstanceRequests($requestsCreateInstanceRequests); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchCreateInstancesResponse $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $formattedRequestsCreateInstanceRequestsParent = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + $requestsCreateInstanceRequestsInstanceId = '[INSTANCE_ID]'; + $requestsCreateInstanceRequestsInstanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + batch_create_instances_sample( + $formattedParent, + $formattedRequestsCreateInstanceRequestsParent, + $requestsCreateInstanceRequestsInstanceId, + $requestsCreateInstanceRequestsInstanceInstanceType + ); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php new file mode 100644 index 000000000000..368a89937ba4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php @@ -0,0 +1,95 @@ +setClusterName($formattedBackupClusterName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $backupId = '[BACKUP_ID]'; + $formattedBackupClusterName = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + create_backup_sample($formattedParent, $backupId, $formattedBackupClusterName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php new file mode 100644 index 000000000000..9ed8d7d7f10a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php @@ -0,0 +1,95 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + create_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php new file mode 100644 index 000000000000..32186e925387 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php @@ -0,0 +1,91 @@ +setInstanceType($instanceInstanceType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = '[INSTANCE_ID]'; + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + create_instance_sample($formattedParent, $instanceId, $instanceInstanceType); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php new file mode 100644 index 000000000000..170313b20f28 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php @@ -0,0 +1,96 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + create_secondary_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php new file mode 100644 index 000000000000..2bf313b63d53 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php @@ -0,0 +1,91 @@ +setInstanceType($instanceInstanceType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = '[INSTANCE_ID]'; + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + create_secondary_instance_sample($formattedParent, $instanceId, $instanceInstanceType); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php new file mode 100644 index 000000000000..cae83d717ad4 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php @@ -0,0 +1,71 @@ +createUser($formattedParent, $userId, $user); + 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 +{ + $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = '[USER_ID]'; + + create_user_sample($formattedParent, $userId); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php new file mode 100644 index 000000000000..3f1febc8e724 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php @@ -0,0 +1,76 @@ +deleteBackup($formattedName); + $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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + delete_backup_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php new file mode 100644 index 000000000000..bb041576705e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php @@ -0,0 +1,76 @@ +deleteCluster($formattedName); + $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php new file mode 100644 index 000000000000..27305f897086 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php @@ -0,0 +1,81 @@ +deleteInstance($formattedName); + $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 = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + delete_instance_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php new file mode 100644 index 000000000000..1b1b1b6bb1a3 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php @@ -0,0 +1,65 @@ +deleteUser($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + + delete_user_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php new file mode 100644 index 000000000000..9ecde842d163 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php @@ -0,0 +1,86 @@ +failoverInstance($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + failover_instance_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php new file mode 100644 index 000000000000..533076d0b8fe --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php @@ -0,0 +1,71 @@ +generateClientCertificate($formattedParent); + 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 +{ + $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + generate_client_certificate_sample($formattedParent); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php new file mode 100644 index 000000000000..0901823b09ca --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php @@ -0,0 +1,66 @@ +getBackup($formattedName); + 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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + get_backup_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php new file mode 100644 index 000000000000..460b58f41f1a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php @@ -0,0 +1,67 @@ +getCluster($formattedName); + 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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php new file mode 100644 index 000000000000..c07d04eb773a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php @@ -0,0 +1,72 @@ +getConnectionInfo($formattedParent); + 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 +{ + $formattedParent = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + get_connection_info_sample($formattedParent); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php new file mode 100644 index 000000000000..80f5f2b589dc --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php @@ -0,0 +1,72 @@ +getInstance($formattedName); + 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 = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + get_instance_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php new file mode 100644 index 000000000000..0fa245f61006 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php new file mode 100644 index 000000000000..4748e0484750 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php @@ -0,0 +1,67 @@ +getUser($formattedName); + 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + + get_user_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php new file mode 100644 index 000000000000..9f11b9f6469f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php @@ -0,0 +1,88 @@ +injectFault($faultType, $formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + inject_fault_sample($faultType, $formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php new file mode 100644 index 000000000000..da790b81697b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php @@ -0,0 +1,71 @@ +listBackups($formattedParent); + + /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backups_sample($formattedParent); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php new file mode 100644 index 000000000000..36a8dd849a7d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php @@ -0,0 +1,74 @@ +listClusters($formattedParent); + + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_clusters_sample($formattedParent); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php new file mode 100644 index 000000000000..5cb79b0b9bea --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php @@ -0,0 +1,76 @@ +listInstances($formattedParent); + + /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_instances_sample($formattedParent); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php new file mode 100644 index 000000000000..5b2c4bcc436a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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 alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php new file mode 100644 index 000000000000..ae7059a23efa --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php @@ -0,0 +1,77 @@ +listSupportedDatabaseFlags($formattedParent); + + /** @var SupportedDatabaseFlag $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + + list_supported_database_flags_sample($formattedParent); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php new file mode 100644 index 000000000000..327f9b2a0edb --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php @@ -0,0 +1,71 @@ +listUsers($formattedParent); + + /** @var User $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_users_sample($formattedParent); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php new file mode 100644 index 000000000000..95e6eef0384e --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php @@ -0,0 +1,82 @@ +promoteCluster($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 +{ + $formattedName = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + promote_cluster_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php new file mode 100644 index 000000000000..768aacdd964f --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php @@ -0,0 +1,85 @@ +restartInstance($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $formattedName = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + + restart_instance_sample($formattedName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php new file mode 100644 index 000000000000..b585b6a06f32 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php @@ -0,0 +1,97 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + restore_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php new file mode 100644 index 000000000000..143b91fcd98d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php @@ -0,0 +1,87 @@ +setClusterName($formattedBackupClusterName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateBackup($backup); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $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 +{ + $formattedBackupClusterName = AlloyDBAdminClient::clusterName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]' + ); + + update_backup_sample($formattedBackupClusterName); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php new file mode 100644 index 000000000000..e0e80ee1986d --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php @@ -0,0 +1,86 @@ +setNetwork($formattedClusterNetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateCluster($cluster); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $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 +{ + $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); + + update_cluster_sample($formattedClusterNetwork); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php new file mode 100644 index 000000000000..e78454363359 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php @@ -0,0 +1,82 @@ +setInstanceType($instanceInstanceType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->updateInstance($instance); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $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 +{ + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + + update_instance_sample($instanceInstanceType); +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php new file mode 100644 index 000000000000..dc411c16fe35 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php @@ -0,0 +1,56 @@ +updateUser($user); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php new file mode 100644 index 000000000000..00f0245964d6 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php @@ -0,0 +1,36 @@ +clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $requests = new CreateInstanceRequests(); + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class AlloyDBAdminGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.alloydb.v1beta.AlloyDBAdmin'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'alloydb.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $backupNameTemplate; + + private static $clusterNameTemplate; + + private static $cryptoKeyVersionNameTemplate; + + private static $instanceNameTemplate; + + private static $locationNameTemplate; + + private static $networkNameTemplate; + + private static $userNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_rest_client_config.php', + ], + ], + ]; + } + + private static function getBackupNameTemplate() + { + if (self::$backupNameTemplate == null) { + self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); + } + + return self::$backupNameTemplate; + } + + private static function getClusterNameTemplate() + { + if (self::$clusterNameTemplate == null) { + self::$clusterNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}'); + } + + return self::$clusterNameTemplate; + } + + private static function getCryptoKeyVersionNameTemplate() + { + if (self::$cryptoKeyVersionNameTemplate == null) { + self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); + } + + return self::$cryptoKeyVersionNameTemplate; + } + + private static function getInstanceNameTemplate() + { + if (self::$instanceNameTemplate == null) { + self::$instanceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}'); + } + + return self::$instanceNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getNetworkNameTemplate() + { + if (self::$networkNameTemplate == null) { + self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); + } + + return self::$networkNameTemplate; + } + + private static function getUserNameTemplate() + { + if (self::$userNameTemplate == null) { + self::$userNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/users/{user}'); + } + + return self::$userNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'backup' => self::getBackupNameTemplate(), + 'cluster' => self::getClusterNameTemplate(), + 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), + 'instance' => self::getInstanceNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'network' => self::getNetworkNameTemplate(), + 'user' => self::getUserNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backup + * + * @return string The formatted backup resource. + * + * @experimental + */ + public static function backupName($project, $location, $backup) + { + return self::getBackupNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + * + * @experimental + */ + public static function clusterName($project, $location, $cluster) + { + return self::getClusterNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + * + * @experimental + */ + public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) + { + return self::getCryptoKeyVersionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $instance + * + * @return string The formatted instance resource. + * + * @experimental + */ + public static function instanceName($project, $location, $cluster, $instance) + { + return self::getInstanceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'instance' => $instance, + ]); + } + + /** + * 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. + * + * @experimental + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + * + * @experimental + */ + public static function networkName($project, $network) + { + return self::getNetworkNameTemplate()->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a user + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * @param string $user + * + * @return string The formatted user resource. + * + * @experimental + */ + public static function userName($project, $location, $cluster, $user) + { + return self::getUserNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + 'user' => $user, + ]); + } + + /** + * 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}/backups/{backup} + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} + * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} + * + * 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. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + 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 + * + * @experimental + */ + 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; + } + + /** + * 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 'alloydb.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 + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates new instances under the given project, location and cluster. + * There can be only one primary instance in a cluster. If the primary + * instance exists in the cluster as well as this request, then API will + * throw an error. + * The primary instance should exist before any read pool instance is + * created. If the primary instance is a part of the request payload, then + * the API will take care of creating instances in the correct order. + * This method is here to support Google-internal use cases, and is not meant + * for external customers to consume. Please do not start relying on it; its + * behavior is subject to change without notice. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $requests = new CreateInstanceRequests(); + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. + * @param CreateInstanceRequests $requests Required. Resources being created. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function batchCreateInstances($parent, $requests, array $optionalArgs = []) + { + $request = new BatchCreateInstancesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setRequests($requests); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchCreateInstances', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Backup in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $backupId = 'backup_id'; + * $backup = new Backup(); + * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Value for parent. + * @param string $backupId Required. ID of the requesting object. + * @param Backup $backup Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) + { + $request = new CreateBackupRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setBackupId($backupId); + $request->setBackup($backup); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Cluster in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object. + * @param Cluster $cluster Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new CreateClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Instance in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $instanceId = 'instance_id'; + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param string $instanceId Required. ID of the requesting object. + * @param Instance $instance Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createInstance($parent, $instanceId, $instance, array $optionalArgs = []) + { + $request = new CreateInstanceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInstanceId($instanceId); + $request->setInstance($instance); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object (the secondary cluster). + * @param Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createSecondaryCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new CreateSecondaryClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateSecondaryCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new SECONDARY Instance in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $instanceId = 'instance_id'; + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param string $instanceId Required. ID of the requesting object. + * @param Instance $instance Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createSecondaryInstance($parent, $instanceId, $instance, array $optionalArgs = []) + { + $request = new CreateSecondaryInstanceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInstanceId($instanceId); + $request->setInstance($instance); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateSecondaryInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new User in a given project, location, and cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $userId = 'user_id'; + * $user = new User(); + * $response = $alloyDBAdminClient->createUser($formattedParent, $userId, $user); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Value for parent. + * @param string $userId Required. ID of the requesting object. + * @param User $user Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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 \Google\Cloud\AlloyDb\V1beta\User + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createUser($parent, $userId, $user, array $optionalArgs = []) + { + $request = new CreateUserRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setUserId($userId); + $request->setUser($user); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type string $etag + * Optional. The current etag of the Backup. + * If an etag is provided and does not match the current etag of the Backup, + * deletion will be blocked and an ABORTED error will be returned. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteBackup($name, array $optionalArgs = []) + { + $request = new DeleteBackupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @type bool $force + * Optional. Whether to cascade delete child instances for given cluster. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteCluster($name, array $optionalArgs = []) + { + $request = new DeleteClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteInstance($name, array $optionalArgs = []) + { + $request = new DeleteInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + * $alloyDBAdminClient->deleteUser($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @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. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteUser($name, array $optionalArgs = []) + { + $request = new DeleteUserRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteUser', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'failoverInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function failoverInstance($name, array $optionalArgs = []) + { + $request = new FailoverInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('FailoverInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Generate a client certificate signed by a Cluster CA. + * The sole purpose of this endpoint is to support AlloyDB connectors and the + * Auth Proxy client. The endpoint's behavior is subject to change without + * notice, so do not rely on its behavior remaining constant. Future changes + * will not break AlloyDB connectors or the Auth Proxy client. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $response = $alloyDBAdminClient->generateClientCertificate($formattedParent); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $pemCsr + * Optional. A pem-encoded X.509 certificate signing request (CSR). + * @type Duration $certDuration + * Optional. An optional hint to the endpoint to generate the client + * certificate with the requested duration. The duration can be from 1 hour to + * 24 hours. The endpoint may or may not honor the hint. If the hint is left + * unspecified or is not honored, then the endpoint will pick an appropriate + * default duration. + * @type string $publicKey + * Optional. The public key from the client. + * @type bool $useMetadataExchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * @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 \Google\Cloud\AlloyDb\V1beta\GenerateClientCertificateResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function generateClientCertificate($parent, array $optionalArgs = []) + { + $request = new GenerateClientCertificateRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['pemCsr'])) { + $request->setPemCsr($optionalArgs['pemCsr']); + } + + if (isset($optionalArgs['certDuration'])) { + $request->setCertDuration($optionalArgs['certDuration']); + } + + if (isset($optionalArgs['publicKey'])) { + $request->setPublicKey($optionalArgs['publicKey']); + } + + if (isset($optionalArgs['useMetadataExchange'])) { + $request->setUseMetadataExchange($optionalArgs['useMetadataExchange']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GenerateClientCertificate', GenerateClientCertificateResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $response = $alloyDBAdminClient->getBackup($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the resource + * @param array $optionalArgs { + * 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 \Google\Cloud\AlloyDb\V1beta\Backup + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getBackup($name, array $optionalArgs = []) + { + $request = new GetBackupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $response = $alloyDBAdminClient->getCluster($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1beta\ClusterView} + * @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 \Google\Cloud\AlloyDb\V1beta\Cluster + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getCluster($name, array $optionalArgs = []) + { + $request = new GetClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetCluster', Cluster::class, $optionalArgs, $request)->wait(); + } + + /** + * Get instance metadata used for a connection. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $response = $alloyDBAdminClient->getConnectionInfo($formattedParent); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @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 \Google\Cloud\AlloyDb\V1beta\ConnectionInfo + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getConnectionInfo($parent, array $optionalArgs = []) + { + $request = new GetConnectionInfoRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConnectionInfo', ConnectionInfo::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $response = $alloyDBAdminClient->getInstance($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * The view of the instance to return. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1beta\InstanceView} + * @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 \Google\Cloud\AlloyDb\V1beta\Instance + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getInstance($name, array $optionalArgs = []) + { + $request = new GetInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets details of a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + * $response = $alloyDBAdminClient->getUser($formattedName); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param array $optionalArgs { + * 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 \Google\Cloud\AlloyDb\V1beta\User + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getUser($name, array $optionalArgs = []) + { + $request = new GetUserRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Injects fault in an instance. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'injectFault'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param int $faultType Required. The type of fault to be injected in an instance. + * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1beta\InjectFaultRequest\FaultType} + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function injectFault($faultType, $name, array $optionalArgs = []) + { + $request = new InjectFaultRequest(); + $requestParamHeaders = []; + $request->setFaultType($faultType); + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('InjectFault', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Lists Backups in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent value for ListBackupsRequest + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Filtering results + * @type string $orderBy + * Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listBackups($parent, array $optionalArgs = []) + { + $request = new ListBackupsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); + } + + /** + * Lists Clusters in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with the following format: + * * projects/{project}/locations/- + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listClusters($parent, array $optionalArgs = []) + { + $request = new ListClustersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListClusters', $optionalArgs, ListClustersResponse::class, $request); + } + + /** + * Lists Instances in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. Additionally, you can perform an + * aggregated list operation by specifying a value with one of the following + * formats: + * * projects/{project}/locations/-/clusters/- + * * projects/{project}/locations/{region}/clusters/- + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listInstances($parent, array $optionalArgs = []) + { + $request = new ListInstancesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListInstances', $optionalArgs, ListInstancesResponse::class, $request); + } + + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location} + * + * Regardless of the parent specified here, as long it is contains a valid + * project and location, the service will return a static list of supported + * flags resources. Note that we do not yet support region-specific + * flags. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listSupportedDatabaseFlags($parent, array $optionalArgs = []) + { + $request = new ListSupportedDatabaseFlagsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListSupportedDatabaseFlags', $optionalArgs, ListSupportedDatabaseFlagsResponse::class, $request); + } + + /** + * Lists Users in a given project and location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent value for ListUsersRequest + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering results + * @type string $orderBy + * Optional. Hint for how to order the results + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listUsers($parent, array $optionalArgs = []) + { + $request = new ListUsersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListUsers', $optionalArgs, ListUsersResponse::class, $request); + } + + /** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'promoteCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type string $etag + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function promoteCluster($name, array $optionalArgs = []) + { + $request = new PromoteClusterRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('PromoteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Restart an Instance in a cluster. + * Imperative only. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restartInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function restartInstance($name, array $optionalArgs = []) + { + $request = new RestartInstanceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestartInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a new Cluster in a given project and location, with a volume + * restored from the provided source, either a backup ID or a point-in-time + * and a source cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $clusterId = 'cluster_id'; + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restoreCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param string $clusterId Required. ID of the requesting object. + * @param Cluster $cluster Required. The resource being created + * @param array $optionalArgs { + * Optional. + * + * @type BackupSource $backupSource + * Backup source. + * @type ContinuousBackupSource $continuousBackupSource + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function restoreCluster($parent, $clusterId, $cluster, array $optionalArgs = []) + { + $request = new RestoreClusterRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setClusterId($clusterId); + $request->setCluster($cluster); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['backupSource'])) { + $request->setBackupSource($optionalArgs['backupSource']); + } + + if (isset($optionalArgs['continuousBackupSource'])) { + $request->setContinuousBackupSource($optionalArgs['continuousBackupSource']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestoreCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Backup. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $backup = new Backup(); + * $operationResponse = $alloyDBAdminClient->updateBackup($backup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateBackup($backup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateBackup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Backup $backup Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new backup is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateBackup($backup, array $optionalArgs = []) + { + $request = new UpdateBackupRequest(); + $requestParamHeaders = []; + $request->setBackup($backup); + $requestParamHeaders['backup.name'] = $backup->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Cluster. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $cluster = new Cluster(); + * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateCluster'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Cluster $cluster Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateCluster($cluster, array $optionalArgs = []) + { + $request = new UpdateClusterRequest(); + $requestParamHeaders = []; + $request->setCluster($cluster); + $requestParamHeaders['cluster.name'] = $cluster->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single Instance. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $instance = new Instance(); + * $operationResponse = $alloyDBAdminClient->updateInstance($instance); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $alloyDBAdminClient->updateInstance($instance); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateInstance'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param Instance $instance Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * Instance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @type bool $allowMissing + * Optional. If set to true, update succeeds even if instance is not found. In + * that case, a new instance is created and `update_mask` is ignored. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateInstance($instance, array $optionalArgs = []) + { + $request = new UpdateInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $requestParamHeaders['instance.name'] = $instance->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the parameters of a single User. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $user = new User(); + * $response = $alloyDBAdminClient->updateUser($user); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param User $user Required. The resource being updated + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type string $requestId + * 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). + * @type bool $validateOnly + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @type bool $allowMissing + * Optional. Allow missing fields in the update mask. + * @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 \Google\Cloud\AlloyDb\V1beta\User + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateUser($user, array $optionalArgs = []) + { + $request = new UpdateUserRequest(); + $requestParamHeaders = []; + $request->setUser($user); + $requestParamHeaders['user.name'] = $user->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateUser', User::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * $response = $alloyDBAdminClient->getLocation(); + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $alloyDBAdminClient = new AlloyDBAdminClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $alloyDBAdminClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alloyDBAdminClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alloyDBAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..9adddc862f2a --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json @@ -0,0 +1,183 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.alloydb.v1beta", + "libraryPackage": "Google\\Cloud\\AlloyDb\\V1beta", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminGapicClient", + "rpcs": { + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags" + ] + }, + "ListUsers": { + "methods": [ + "listUsers" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json new file mode 100644 index 000000000000..3e97d3cf7d1c --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json @@ -0,0 +1,209 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1beta.AlloyDBAdmin": { + "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": 60000, + "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": { + "BatchCreateInstances": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSecondaryCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSecondaryInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateUser": { + "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_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "FailoverInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GenerateClientCertificate": { + "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" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConnectionInfo": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSupportedDatabaseFlags": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PromoteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RestoreCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateUser": { + "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_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php new file mode 100644 index 000000000000..fa9ffeb8a1f0 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php @@ -0,0 +1,242 @@ + [ + 'google.cloud.alloydb.v1beta.AlloyDBAdmin' => [ + 'BatchCreateInstances' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesResponse', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Backup', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateSecondaryCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateSecondaryInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'FailoverInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'InjectFault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'PromoteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'RestartInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'RestoreCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Backup', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListBackups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackups', + ], + ], + 'ListClusters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClusters', + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + ], + 'ListSupportedDatabaseFlags' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSupportedDatabaseFlags', + ], + ], + 'ListUsers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUsers', + ], + ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + ], + ], +]; diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php new file mode 100644 index 000000000000..5a1cc032048b --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php @@ -0,0 +1,453 @@ + [ + 'google.cloud.alloydb.v1beta.AlloyDBAdmin' => [ + 'BatchCreateInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate', + 'body' => 'requests', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/backups', + 'body' => 'backup', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_id', + ], + ], + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'instance_id', + ], + ], + 'CreateSecondaryCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSecondaryInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateUser' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/users', + 'body' => 'user', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'user_id', + ], + ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteUser' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FailoverInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GenerateClientCertificate' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConnectionInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetUser' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InjectFault' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSupportedDatabaseFlags' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListUsers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/users', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PromoteCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*}:promote', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestartInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestoreCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters:restore', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{backup.name=projects/*/locations/*/backups/*}', + 'body' => 'backup', + 'placeholders' => [ + 'backup.name' => [ + 'getters' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{cluster.name=projects/*/locations/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'UpdateUser' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}', + 'body' => 'user', + 'placeholders' => [ + 'user.name' => [ + 'getters' => [ + 'getUser', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php new file mode 100644 index 000000000000..427b930b6e28 --- /dev/null +++ b/owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php @@ -0,0 +1,3403 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AlloyDBAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AlloyDBAdminClient($options); + } + + /** @test */ + public function batchCreateInstancesTest() + { + $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/batchCreateInstancesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchCreateInstancesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchCreateInstancesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $response = $gapicClient->batchCreateInstances($formattedParent, $requests); + $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.alloydb.v1beta.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + $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 batchCreateInstancesExceptionTest() + { + $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/batchCreateInstancesTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $requests = new CreateInstanceRequests(); + $requestsCreateInstanceRequests = []; + $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); + $response = $gapicClient->batchCreateInstances($formattedParent, $requests); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); + 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 createBackupTest() + { + $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/createBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); + $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.alloydb.v1beta.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupId(); + $this->assertProtobufEquals($backupId, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + $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 createBackupExceptionTest() + { + $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/createBackupTest'); + $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]'); + $backupId = 'backupId1355353272'; + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupTest'); + 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 createClusterTest() + { + $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/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1beta.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $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 createClusterExceptionTest() + { + $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/createClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + 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 createInstanceTest() + { + $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/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); + $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.alloydb.v1beta.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $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 createInstanceExceptionTest() + { + $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/createInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + 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 createSecondaryClusterTest() + { + $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/createSecondaryClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + $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 createSecondaryClusterExceptionTest() + { + $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/createSecondaryClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); + 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 createSecondaryInstanceTest() + { + $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/createSecondaryInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecondaryInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $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.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + $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 createSecondaryInstanceExceptionTest() + { + $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/createSecondaryInstanceTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); + 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 createUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + $response = $gapicClient->createUser($formattedParent, $userId, $user); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserId(); + $this->assertProtobufEquals($userId, $actualValue); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createUserExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $userId = 'userId-147132913'; + $user = new User(); + try { + $gapicClient->createUser($formattedParent, $userId, $user); + // 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 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); + $expectedResponse = new GPBEmpty(); + $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]', '[BACKUP]'); + $response = $gapicClient->deleteBackup($formattedName); + $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.alloydb.v1beta.AlloyDBAdmin/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]', '[BACKUP]'); + $response = $gapicClient->deleteBackup($formattedName); + $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 deleteClusterTest() + { + $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/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->deleteCluster($formattedName); + $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.alloydb.v1beta.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $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 deleteClusterExceptionTest() + { + $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/deleteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->deleteCluster($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + 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 deleteInstanceTest() + { + $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/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->deleteInstance($formattedName); + $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.alloydb.v1beta.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $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 deleteInstanceExceptionTest() + { + $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/deleteInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->deleteInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + 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 deleteUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $gapicClient->deleteUser($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + try { + $gapicClient->deleteUser($formattedName); + // 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 failoverInstanceTest() + { + $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/failoverInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/failoverInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->failoverInstance($formattedName); + $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.alloydb.v1beta.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + $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 failoverInstanceExceptionTest() + { + $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/failoverInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->failoverInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); + 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 generateClientCertificateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $pemCertificate = 'pemCertificate1234463984'; + $caCert = 'caCert536363365'; + $expectedResponse = new GenerateClientCertificateResponse(); + $expectedResponse->setPemCertificate($pemCertificate); + $expectedResponse->setCaCert($caCert); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->generateClientCertificate($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateClientCertificateExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->generateClientCertificate($formattedParent); + // 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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $response = $gapicClient->getBackup($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/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]', '[BACKUP]'); + try { + $gapicClient->getBackup($formattedName); + // 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 getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->getCluster($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->getCluster($formattedName); + // 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 getConnectionInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $ipAddress = 'ipAddress1480014044'; + $instanceUid = 'instanceUid-737331802'; + $expectedResponse = new ConnectionInfo(); + $expectedResponse->setName($name); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setInstanceUid($instanceUid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->getConnectionInfo($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionInfoExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + try { + $gapicClient->getConnectionInfo($formattedParent); + // 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 getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->getInstance($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + try { + $gapicClient->getInstance($formattedName); + // 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 getUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name2); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + $response = $gapicClient->getUser($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getUserExceptionTest() + { + $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); + try { + $gapicClient->getUser($formattedName); + // 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 injectFaultTest() + { + $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/injectFaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/injectFaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->injectFault($faultType, $formattedName); + $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.alloydb.v1beta.AlloyDBAdmin/InjectFault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFaultType(); + $this->assertProtobufEquals($faultType, $actualValue); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + $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 injectFaultExceptionTest() + { + $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/injectFaultTest'); + $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 + $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->injectFault($faultType, $formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/injectFaultTest'); + 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 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->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listBackups($formattedParent); + $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.alloydb.v1beta.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listBackups($formattedParent); + // 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 listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [ + $clustersElement, + ]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listClusters($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $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]'); + try { + $gapicClient->listClusters($formattedParent); + // 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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [ + $instancesElement, + ]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->listInstances($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->listInstances($formattedParent); + // 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 listSupportedDatabaseFlagsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); + $supportedDatabaseFlags = [ + $supportedDatabaseFlagsElement, + ]; + $expectedResponse = new ListSupportedDatabaseFlagsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listSupportedDatabaseFlags($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSupportedDatabaseFlagsExceptionTest() + { + $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]'); + try { + $gapicClient->listSupportedDatabaseFlags($formattedParent); + // 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 listUsersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $usersElement = new User(); + $users = [ + $usersElement, + ]; + $expectedResponse = new ListUsersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUsers($users); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->listUsers($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListUsers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsersExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + try { + $gapicClient->listUsers($formattedParent); + // 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 promoteClusterTest() + { + $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/promoteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag2 = 'etag2-1293302904'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag2); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/promoteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->promoteCluster($formattedName); + $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.alloydb.v1beta.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + $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 promoteClusterExceptionTest() + { + $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/promoteClusterTest'); + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $response = $gapicClient->promoteCluster($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); + 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 restartInstanceTest() + { + $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/restartInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restartInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->restartInstance($formattedName); + $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.alloydb.v1beta.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + $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 restartInstanceExceptionTest() + { + $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/restartInstanceTest'); + $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $response = $gapicClient->restartInstance($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); + 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 restoreClusterTest() + { + $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/restoreClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); + $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.alloydb.v1beta.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + $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 restoreClusterExceptionTest() + { + $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/restoreClusterTest'); + $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]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); + 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'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $clusterUid = 'clusterUid-1141213045'; + $clusterName = 'clusterName-1018081872'; + $reconciling = false; + $etag = 'etag3123477'; + $sizeBytes = 1796325715; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setClusterUid($clusterUid); + $expectedResponse->setClusterName($clusterName); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setSizeBytes($sizeBytes); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->updateBackup($backup); + $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.alloydb.v1beta.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); + $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 + $backup = new Backup(); + $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $backup->setClusterName($backupClusterName); + $response = $gapicClient->updateBackup($backup); + $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 updateClusterTest() + { + $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/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->updateCluster($cluster); + $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.alloydb.v1beta.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $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 updateClusterExceptionTest() + { + $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/updateClusterTest'); + $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 + $cluster = new Cluster(); + $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); + $cluster->setNetwork($clusterNetwork); + $response = $gapicClient->updateCluster($cluster); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + 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 updateInstanceTest() + { + $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/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $gceZone = 'gceZone-227587294'; + $ipAddress = 'ipAddress1480014044'; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setGceZone($gceZone); + $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->updateInstance($instance); + $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.alloydb.v1beta.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $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 updateInstanceExceptionTest() + { + $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/updateInstanceTest'); + $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 + $instance = new Instance(); + $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; + $instance->setInstanceType($instanceInstanceType); + $response = $gapicClient->updateInstance($instance); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + 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 updateUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $password = 'password1216985755'; + $expectedResponse = new User(); + $expectedResponse->setName($name); + $expectedResponse->setPassword($password); + $transport->addResponse($expectedResponse); + // Mock request + $user = new User(); + $response = $gapicClient->updateUser($user); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateUser', $actualFuncCall); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateUserExceptionTest() + { + $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 + $user = new User(); + try { + $gapicClient->updateUser($user); + // 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 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} From 30695d5aceb668f51929c60dd7558079b5fb3b41 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Nov 2023 21:59:52 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= 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 --- AlloyDb/metadata/V1/Service.php | Bin 15601 -> 15637 bytes AlloyDb/src/V1/Cluster/NetworkConfig.php | 16 +- .../src/V1/Gapic/AlloyDBAdminGapicClient.php | 10 + .../V1/GenerateClientCertificateRequest.php | 42 + AlloyDb/src/V1/Instance.php | 12 +- .../Google/Cloud/Alloydb/V1/Resources.php | Bin 11817 -> 0 bytes .../Google/Cloud/Alloydb/V1/Service.php | Bin 15637 -> 0 bytes .../AlloyDb/V1/AutomatedBackupPolicy.php | 392 -- .../QuantityBasedRetention.php | 71 - .../TimeBasedRetention.php | 81 - .../AutomatedBackupPolicy/WeeklySchedule.php | 129 - .../src/Google/Cloud/AlloyDb/V1/Backup.php | 917 ----- .../AlloyDb/V1/Backup/QuantityBasedExpiry.php | 125 - .../Google/Cloud/AlloyDb/V1/Backup/State.php | 78 - .../Google/Cloud/AlloyDb/V1/Backup/Type.php | 74 - .../Google/Cloud/AlloyDb/V1/BackupSource.php | 113 - .../AlloyDb/V1/BatchCreateInstanceStatus.php | 221 - .../V1/BatchCreateInstanceStatus/State.php | 97 - .../V1/BatchCreateInstancesMetadata.php | 134 - .../V1/BatchCreateInstancesRequest.php | 185 - .../V1/BatchCreateInstancesResponse.php | 67 - .../src/Google/Cloud/AlloyDb/V1/Cluster.php | 1189 ------ .../Cloud/AlloyDb/V1/Cluster/ClusterType.php | 65 - .../AlloyDb/V1/Cluster/NetworkConfig.php | 148 - .../AlloyDb/V1/Cluster/PrimaryConfig.php | 76 - .../AlloyDb/V1/Cluster/SecondaryConfig.php | 75 - .../Google/Cloud/AlloyDb/V1/Cluster/State.php | 125 - .../Google/Cloud/AlloyDb/V1/ClusterView.php | 66 - .../Cloud/AlloyDb/V1/ConnectionInfo.php | 152 - .../AlloyDb/V1/ContinuousBackupConfig.php | 176 - .../Cloud/AlloyDb/V1/ContinuousBackupInfo.php | 216 - .../AlloyDb/V1/ContinuousBackupSource.php | 119 - .../Cloud/AlloyDb/V1/CreateBackupRequest.php | 275 -- .../Cloud/AlloyDb/V1/CreateClusterRequest.php | 284 -- .../AlloyDb/V1/CreateInstanceRequest.php | 284 -- .../AlloyDb/V1/CreateInstanceRequests.php | 71 - .../V1/CreateSecondaryClusterRequest.php | 282 -- .../V1/CreateSecondaryInstanceRequest.php | 284 -- .../Cloud/AlloyDb/V1/CreateUserRequest.php | 275 -- .../Cloud/AlloyDb/V1/DatabaseVersion.php | 61 - .../Cloud/AlloyDb/V1/DeleteBackupRequest.php | 240 -- .../Cloud/AlloyDb/V1/DeleteClusterRequest.php | 274 -- .../AlloyDb/V1/DeleteInstanceRequest.php | 240 -- .../Cloud/AlloyDb/V1/DeleteUserRequest.php | 198 - .../Cloud/AlloyDb/V1/EncryptionConfig.php | 76 - .../Cloud/AlloyDb/V1/EncryptionInfo.php | 105 - .../Cloud/AlloyDb/V1/EncryptionInfo/Type.php | 66 - .../AlloyDb/V1/FailoverInstanceRequest.php | 198 - .../V1/GenerateClientCertificateRequest.php | 297 -- .../V1/GenerateClientCertificateResponse.php | 105 - .../Cloud/AlloyDb/V1/GetBackupRequest.php | 81 - .../Cloud/AlloyDb/V1/GetClusterRequest.php | 124 - .../AlloyDb/V1/GetConnectionInfoRequest.php | 160 - .../Cloud/AlloyDb/V1/GetInstanceRequest.php | 120 - .../Cloud/AlloyDb/V1/GetUserRequest.php | 86 - .../Cloud/AlloyDb/V1/InjectFaultRequest.php | 239 -- .../V1/InjectFaultRequest/FaultType.php | 58 - .../src/Google/Cloud/AlloyDb/V1/Instance.php | 1026 ----- .../AlloyDb/V1/Instance/AvailabilityType.php | 68 - .../V1/Instance/ClientConnectionConfig.php | 118 - .../AlloyDb/V1/Instance/InstanceType.php | 76 - .../AlloyDb/V1/Instance/MachineConfig.php | 70 - .../Google/Cloud/AlloyDb/V1/Instance/Node.php | 186 - .../Instance/QueryInsightsInstanceConfig.php | 222 - .../AlloyDb/V1/Instance/ReadPoolConfig.php | 70 - .../Cloud/AlloyDb/V1/Instance/State.php | 112 - .../Google/Cloud/AlloyDb/V1/InstanceView.php | 65 - .../Cloud/AlloyDb/V1/ListBackupsRequest.php | 221 - .../Cloud/AlloyDb/V1/ListBackupsResponse.php | 135 - .../Cloud/AlloyDb/V1/ListClustersRequest.php | 236 -- .../Cloud/AlloyDb/V1/ListClustersResponse.php | 135 - .../Cloud/AlloyDb/V1/ListInstancesRequest.php | 246 -- .../AlloyDb/V1/ListInstancesResponse.php | 135 - .../V1/ListSupportedDatabaseFlagsRequest.php | 179 - .../V1/ListSupportedDatabaseFlagsResponse.php | 101 - .../Cloud/AlloyDb/V1/ListUsersRequest.php | 221 - .../Cloud/AlloyDb/V1/ListUsersResponse.php | 135 - .../Cloud/AlloyDb/V1/MigrationSource.php | 144 - .../MigrationSource/MigrationSourceType.php | 57 - .../Cloud/AlloyDb/V1/OperationMetadata.php | 349 -- .../AlloyDb/V1/PromoteClusterRequest.php | 240 -- .../AlloyDb/V1/RestartInstanceRequest.php | 196 - .../AlloyDb/V1/RestoreClusterRequest.php | 344 -- .../src/Google/Cloud/AlloyDb/V1/SslConfig.php | 105 - .../Cloud/AlloyDb/V1/SslConfig/CaSource.php | 58 - .../Cloud/AlloyDb/V1/SslConfig/SslMode.php | 89 - .../AlloyDb/V1/SupportedDatabaseFlag.php | 337 -- .../IntegerRestrictions.php | 178 - .../StringRestrictions.php | 74 - .../V1/SupportedDatabaseFlag/ValueType.php | 80 - .../Cloud/AlloyDb/V1/UpdateBackupRequest.php | 306 -- .../Cloud/AlloyDb/V1/UpdateClusterRequest.php | 310 -- .../AlloyDb/V1/UpdateInstanceRequest.php | 310 -- .../Cloud/AlloyDb/V1/UpdateUserRequest.php | 302 -- .../src/Google/Cloud/AlloyDb/V1/User.php | 177 - .../Google/Cloud/AlloyDb/V1/User/UserType.php | 65 - .../Google/Cloud/AlloyDb/V1/UserPassword.php | 102 - .../batch_create_instances.php | 127 - .../V1/AlloyDBAdminClient/create_backup.php | 100 - .../V1/AlloyDBAdminClient/create_cluster.php | 100 - .../V1/AlloyDBAdminClient/create_instance.php | 96 - .../create_secondary_cluster.php | 101 - .../create_secondary_instance.php | 96 - .../V1/AlloyDBAdminClient/create_user.php | 76 - .../V1/AlloyDBAdminClient/delete_backup.php | 81 - .../V1/AlloyDBAdminClient/delete_cluster.php | 81 - .../V1/AlloyDBAdminClient/delete_instance.php | 86 - .../V1/AlloyDBAdminClient/delete_user.php | 70 - .../AlloyDBAdminClient/failover_instance.php | 91 - .../generate_client_certificate.php | 76 - .../V1/AlloyDBAdminClient/get_backup.php | 71 - .../V1/AlloyDBAdminClient/get_cluster.php | 72 - .../get_connection_info.php | 77 - .../V1/AlloyDBAdminClient/get_instance.php | 77 - .../V1/AlloyDBAdminClient/get_location.php | 57 - .../V1/AlloyDBAdminClient/get_user.php | 72 - .../V1/AlloyDBAdminClient/inject_fault.php | 94 - .../V1/AlloyDBAdminClient/list_backups.php | 76 - .../V1/AlloyDBAdminClient/list_clusters.php | 79 - .../V1/AlloyDBAdminClient/list_instances.php | 81 - .../V1/AlloyDBAdminClient/list_locations.php | 62 - .../list_supported_database_flags.php | 82 - .../V1/AlloyDBAdminClient/list_users.php | 76 - .../V1/AlloyDBAdminClient/promote_cluster.php | 87 - .../AlloyDBAdminClient/restart_instance.php | 90 - .../V1/AlloyDBAdminClient/restore_cluster.php | 102 - .../V1/AlloyDBAdminClient/update_backup.php | 90 - .../V1/AlloyDBAdminClient/update_cluster.php | 89 - .../V1/AlloyDBAdminClient/update_instance.php | 85 - .../V1/AlloyDBAdminClient/update_user.php | 59 - .../AlloyDb/v1/src/V1/AlloyDBAdminClient.php | 34 - .../v1/src/V1/Client/AlloyDBAdminClient.php | 1322 ------ .../src/V1/Gapic/AlloyDBAdminGapicClient.php | 3291 --------------- .../AlloyDb/v1/src/V1/gapic_metadata.json | 183 - .../alloy_db_admin_client_config.json | 209 - .../alloy_db_admin_descriptor_config.php | 586 --- .../alloy_db_admin_rest_client_config.php | 454 -- .../tests/Unit/V1/AlloyDBAdminClientTest.php | 3401 --------------- .../Unit/V1/Client/AlloyDBAdminClientTest.php | 3664 ----------------- .../Cloud/Alloydb/V1Alpha/Resources.php | Bin 12477 -> 0 bytes .../Google/Cloud/Alloydb/V1Alpha/Service.php | Bin 16263 -> 0 bytes .../AlloyDb/V1alpha/AutomatedBackupPolicy.php | 392 -- .../QuantityBasedRetention.php | 71 - .../TimeBasedRetention.php | 81 - .../AutomatedBackupPolicy/WeeklySchedule.php | 129 - .../Google/Cloud/AlloyDb/V1alpha/Backup.php | 951 ----- .../V1alpha/Backup/QuantityBasedExpiry.php | 125 - .../Cloud/AlloyDb/V1alpha/Backup/State.php | 78 - .../Cloud/AlloyDb/V1alpha/Backup/Type.php | 74 - .../Cloud/AlloyDb/V1alpha/BackupSource.php | 113 - .../V1alpha/BatchCreateInstanceStatus.php | 221 - .../BatchCreateInstanceStatus/State.php | 97 - .../V1alpha/BatchCreateInstancesMetadata.php | 134 - .../V1alpha/BatchCreateInstancesRequest.php | 185 - .../V1alpha/BatchCreateInstancesResponse.php | 67 - .../Google/Cloud/AlloyDb/V1alpha/Cluster.php | 1223 ------ .../AlloyDb/V1alpha/Cluster/ClusterType.php | 65 - .../AlloyDb/V1alpha/Cluster/NetworkConfig.php | 148 - .../AlloyDb/V1alpha/Cluster/PrimaryConfig.php | 76 - .../V1alpha/Cluster/SecondaryConfig.php | 75 - .../Cloud/AlloyDb/V1alpha/Cluster/State.php | 125 - .../Cloud/AlloyDb/V1alpha/ClusterView.php | 66 - .../Cloud/AlloyDb/V1alpha/ConnectionInfo.php | 195 - .../V1alpha/ContinuousBackupConfig.php | 176 - .../AlloyDb/V1alpha/ContinuousBackupInfo.php | 216 - .../V1alpha/ContinuousBackupSource.php | 119 - .../AlloyDb/V1alpha/CreateBackupRequest.php | 257 -- .../AlloyDb/V1alpha/CreateClusterRequest.php | 265 -- .../AlloyDb/V1alpha/CreateInstanceRequest.php | 265 -- .../V1alpha/CreateInstanceRequests.php | 71 - .../V1alpha/CreateSecondaryClusterRequest.php | 263 -- .../CreateSecondaryInstanceRequest.php | 265 -- .../AlloyDb/V1alpha/CreateUserRequest.php | 257 -- .../Cloud/AlloyDb/V1alpha/DatabaseVersion.php | 68 - .../AlloyDb/V1alpha/DeleteBackupRequest.php | 225 - .../AlloyDb/V1alpha/DeleteClusterRequest.php | 259 -- .../AlloyDb/V1alpha/DeleteInstanceRequest.php | 225 - .../AlloyDb/V1alpha/DeleteUserRequest.php | 183 - .../AlloyDb/V1alpha/EncryptionConfig.php | 76 - .../Cloud/AlloyDb/V1alpha/EncryptionInfo.php | 105 - .../AlloyDb/V1alpha/EncryptionInfo/Type.php | 66 - .../V1alpha/FailoverInstanceRequest.php | 183 - .../GenerateClientCertificateRequest.php | 321 -- .../GenerateClientCertificateResponse.php | 139 - .../AlloyDb/V1alpha/GetBackupRequest.php | 67 - .../AlloyDb/V1alpha/GetClusterRequest.php | 109 - .../V1alpha/GetConnectionInfoRequest.php | 145 - .../AlloyDb/V1alpha/GetInstanceRequest.php | 105 - .../Cloud/AlloyDb/V1alpha/GetUserRequest.php | 71 - .../AlloyDb/V1alpha/InjectFaultRequest.php | 221 - .../V1alpha/InjectFaultRequest/FaultType.php | 58 - .../Google/Cloud/AlloyDb/V1alpha/Instance.php | 1112 ----- .../V1alpha/Instance/AvailabilityType.php | 68 - .../Instance/ClientConnectionConfig.php | 118 - .../AlloyDb/V1alpha/Instance/InstanceType.php | 76 - .../V1alpha/Instance/MachineConfig.php | 70 - .../Cloud/AlloyDb/V1alpha/Instance/Node.php | 186 - .../Instance/QueryInsightsInstanceConfig.php | 222 - .../V1alpha/Instance/ReadPoolConfig.php | 70 - .../Cloud/AlloyDb/V1alpha/Instance/State.php | 112 - .../AlloyDb/V1alpha/Instance/UpdatePolicy.php | 70 - .../V1alpha/Instance/UpdatePolicy/Mode.php | 69 - .../Cloud/AlloyDb/V1alpha/InstanceView.php | 65 - .../AlloyDb/V1alpha/ListBackupsRequest.php | 207 - .../AlloyDb/V1alpha/ListBackupsResponse.php | 135 - .../AlloyDb/V1alpha/ListClustersRequest.php | 219 - .../AlloyDb/V1alpha/ListClustersResponse.php | 135 - .../AlloyDb/V1alpha/ListInstancesRequest.php | 227 - .../AlloyDb/V1alpha/ListInstancesResponse.php | 135 - .../ListSupportedDatabaseFlagsRequest.php | 159 - .../ListSupportedDatabaseFlagsResponse.php | 101 - .../AlloyDb/V1alpha/ListUsersRequest.php | 207 - .../AlloyDb/V1alpha/ListUsersResponse.php | 135 - .../Cloud/AlloyDb/V1alpha/MigrationSource.php | 144 - .../MigrationSource/MigrationSourceType.php | 57 - .../AlloyDb/V1alpha/OperationMetadata.php | 349 -- .../AlloyDb/V1alpha/PromoteClusterRequest.php | 225 - .../V1alpha/RestartInstanceRequest.php | 181 - .../AlloyDb/V1alpha/RestoreClusterRequest.php | 344 -- .../Cloud/AlloyDb/V1alpha/SslConfig.php | 105 - .../AlloyDb/V1alpha/SslConfig/CaSource.php | 58 - .../AlloyDb/V1alpha/SslConfig/SslMode.php | 89 - .../AlloyDb/V1alpha/SupportedDatabaseFlag.php | 337 -- .../IntegerRestrictions.php | 178 - .../StringRestrictions.php | 74 - .../SupportedDatabaseFlag/ValueType.php | 80 - .../AlloyDb/V1alpha/UpdateBackupRequest.php | 287 -- .../AlloyDb/V1alpha/UpdateClusterRequest.php | 291 -- .../AlloyDb/V1alpha/UpdateInstanceRequest.php | 291 -- .../AlloyDb/V1alpha/UpdateUserRequest.php | 283 -- .../src/Google/Cloud/AlloyDb/V1alpha/User.php | 177 - .../Cloud/AlloyDb/V1alpha/User/UserType.php | 65 - .../Cloud/AlloyDb/V1alpha/UserPassword.php | 102 - .../batch_create_instances.php | 123 - .../AlloyDBAdminClient/create_backup.php | 95 - .../AlloyDBAdminClient/create_cluster.php | 95 - .../AlloyDBAdminClient/create_instance.php | 91 - .../create_secondary_cluster.php | 96 - .../create_secondary_instance.php | 91 - .../AlloyDBAdminClient/create_user.php | 71 - .../AlloyDBAdminClient/delete_backup.php | 76 - .../AlloyDBAdminClient/delete_cluster.php | 76 - .../AlloyDBAdminClient/delete_instance.php | 81 - .../AlloyDBAdminClient/delete_user.php | 65 - .../AlloyDBAdminClient/failover_instance.php | 86 - .../generate_client_certificate.php | 71 - .../V1alpha/AlloyDBAdminClient/get_backup.php | 66 - .../AlloyDBAdminClient/get_cluster.php | 67 - .../get_connection_info.php | 72 - .../AlloyDBAdminClient/get_instance.php | 72 - .../AlloyDBAdminClient/get_location.php | 53 - .../V1alpha/AlloyDBAdminClient/get_user.php | 67 - .../AlloyDBAdminClient/inject_fault.php | 88 - .../AlloyDBAdminClient/list_backups.php | 71 - .../AlloyDBAdminClient/list_clusters.php | 74 - .../AlloyDBAdminClient/list_instances.php | 76 - .../AlloyDBAdminClient/list_locations.php | 58 - .../list_supported_database_flags.php | 77 - .../V1alpha/AlloyDBAdminClient/list_users.php | 71 - .../AlloyDBAdminClient/promote_cluster.php | 82 - .../AlloyDBAdminClient/restart_instance.php | 85 - .../AlloyDBAdminClient/restore_cluster.php | 97 - .../AlloyDBAdminClient/update_backup.php | 87 - .../AlloyDBAdminClient/update_cluster.php | 86 - .../AlloyDBAdminClient/update_instance.php | 82 - .../AlloyDBAdminClient/update_user.php | 56 - .../src/V1alpha/AlloyDBAdminClient.php | 36 - .../V1alpha/Gapic/AlloyDBAdminGapicClient.php | 3386 --------------- .../v1alpha/src/V1alpha/gapic_metadata.json | 183 - .../alloy_db_admin_client_config.json | 209 - .../alloy_db_admin_descriptor_config.php | 242 -- .../alloy_db_admin_rest_client_config.php | 454 -- .../Unit/V1alpha/AlloyDBAdminClientTest.php | 3435 ---------------- .../Google/Cloud/Alloydb/V1Beta/Resources.php | Bin 12342 -> 0 bytes .../Google/Cloud/Alloydb/V1Beta/Service.php | Bin 16148 -> 0 bytes .../AlloyDb/V1beta/AutomatedBackupPolicy.php | 392 -- .../QuantityBasedRetention.php | 71 - .../TimeBasedRetention.php | 81 - .../AutomatedBackupPolicy/WeeklySchedule.php | 129 - .../Google/Cloud/AlloyDb/V1beta/Backup.php | 917 ----- .../V1beta/Backup/QuantityBasedExpiry.php | 125 - .../Cloud/AlloyDb/V1beta/Backup/State.php | 78 - .../Cloud/AlloyDb/V1beta/Backup/Type.php | 74 - .../Cloud/AlloyDb/V1beta/BackupSource.php | 113 - .../V1beta/BatchCreateInstanceStatus.php | 221 - .../BatchCreateInstanceStatus/State.php | 97 - .../V1beta/BatchCreateInstancesMetadata.php | 134 - .../V1beta/BatchCreateInstancesRequest.php | 185 - .../V1beta/BatchCreateInstancesResponse.php | 67 - .../Google/Cloud/AlloyDb/V1beta/Cluster.php | 1189 ------ .../AlloyDb/V1beta/Cluster/ClusterType.php | 65 - .../AlloyDb/V1beta/Cluster/NetworkConfig.php | 148 - .../AlloyDb/V1beta/Cluster/PrimaryConfig.php | 76 - .../V1beta/Cluster/SecondaryConfig.php | 75 - .../Cloud/AlloyDb/V1beta/Cluster/State.php | 125 - .../Cloud/AlloyDb/V1beta/ClusterView.php | 66 - .../Cloud/AlloyDb/V1beta/ConnectionInfo.php | 195 - .../AlloyDb/V1beta/ContinuousBackupConfig.php | 176 - .../AlloyDb/V1beta/ContinuousBackupInfo.php | 216 - .../AlloyDb/V1beta/ContinuousBackupSource.php | 119 - .../AlloyDb/V1beta/CreateBackupRequest.php | 257 -- .../AlloyDb/V1beta/CreateClusterRequest.php | 265 -- .../AlloyDb/V1beta/CreateInstanceRequest.php | 265 -- .../AlloyDb/V1beta/CreateInstanceRequests.php | 71 - .../V1beta/CreateSecondaryClusterRequest.php | 263 -- .../V1beta/CreateSecondaryInstanceRequest.php | 265 -- .../AlloyDb/V1beta/CreateUserRequest.php | 257 -- .../Cloud/AlloyDb/V1beta/DatabaseVersion.php | 68 - .../AlloyDb/V1beta/DeleteBackupRequest.php | 225 - .../AlloyDb/V1beta/DeleteClusterRequest.php | 259 -- .../AlloyDb/V1beta/DeleteInstanceRequest.php | 225 - .../AlloyDb/V1beta/DeleteUserRequest.php | 183 - .../Cloud/AlloyDb/V1beta/EncryptionConfig.php | 76 - .../Cloud/AlloyDb/V1beta/EncryptionInfo.php | 105 - .../AlloyDb/V1beta/EncryptionInfo/Type.php | 66 - .../V1beta/FailoverInstanceRequest.php | 183 - .../GenerateClientCertificateRequest.php | 321 -- .../GenerateClientCertificateResponse.php | 139 - .../Cloud/AlloyDb/V1beta/GetBackupRequest.php | 67 - .../AlloyDb/V1beta/GetClusterRequest.php | 109 - .../V1beta/GetConnectionInfoRequest.php | 145 - .../AlloyDb/V1beta/GetInstanceRequest.php | 105 - .../Cloud/AlloyDb/V1beta/GetUserRequest.php | 71 - .../AlloyDb/V1beta/InjectFaultRequest.php | 221 - .../V1beta/InjectFaultRequest/FaultType.php | 58 - .../Google/Cloud/AlloyDb/V1beta/Instance.php | 1078 ----- .../V1beta/Instance/AvailabilityType.php | 68 - .../Instance/ClientConnectionConfig.php | 118 - .../AlloyDb/V1beta/Instance/InstanceType.php | 76 - .../AlloyDb/V1beta/Instance/MachineConfig.php | 70 - .../Cloud/AlloyDb/V1beta/Instance/Node.php | 186 - .../Instance/QueryInsightsInstanceConfig.php | 222 - .../V1beta/Instance/ReadPoolConfig.php | 70 - .../Cloud/AlloyDb/V1beta/Instance/State.php | 112 - .../AlloyDb/V1beta/Instance/UpdatePolicy.php | 70 - .../V1beta/Instance/UpdatePolicy/Mode.php | 69 - .../Cloud/AlloyDb/V1beta/InstanceView.php | 65 - .../AlloyDb/V1beta/ListBackupsRequest.php | 207 - .../AlloyDb/V1beta/ListBackupsResponse.php | 135 - .../AlloyDb/V1beta/ListClustersRequest.php | 219 - .../AlloyDb/V1beta/ListClustersResponse.php | 135 - .../AlloyDb/V1beta/ListInstancesRequest.php | 227 - .../AlloyDb/V1beta/ListInstancesResponse.php | 135 - .../ListSupportedDatabaseFlagsRequest.php | 159 - .../ListSupportedDatabaseFlagsResponse.php | 101 - .../Cloud/AlloyDb/V1beta/ListUsersRequest.php | 207 - .../AlloyDb/V1beta/ListUsersResponse.php | 135 - .../Cloud/AlloyDb/V1beta/MigrationSource.php | 144 - .../MigrationSource/MigrationSourceType.php | 57 - .../AlloyDb/V1beta/OperationMetadata.php | 349 -- .../AlloyDb/V1beta/PromoteClusterRequest.php | 225 - .../AlloyDb/V1beta/RestartInstanceRequest.php | 181 - .../AlloyDb/V1beta/RestoreClusterRequest.php | 344 -- .../Google/Cloud/AlloyDb/V1beta/SslConfig.php | 105 - .../AlloyDb/V1beta/SslConfig/CaSource.php | 58 - .../AlloyDb/V1beta/SslConfig/SslMode.php | 89 - .../AlloyDb/V1beta/SupportedDatabaseFlag.php | 337 -- .../IntegerRestrictions.php | 178 - .../StringRestrictions.php | 74 - .../SupportedDatabaseFlag/ValueType.php | 80 - .../AlloyDb/V1beta/UpdateBackupRequest.php | 287 -- .../AlloyDb/V1beta/UpdateClusterRequest.php | 291 -- .../AlloyDb/V1beta/UpdateInstanceRequest.php | 291 -- .../AlloyDb/V1beta/UpdateUserRequest.php | 283 -- .../src/Google/Cloud/AlloyDb/V1beta/User.php | 177 - .../Cloud/AlloyDb/V1beta/User/UserType.php | 65 - .../Cloud/AlloyDb/V1beta/UserPassword.php | 102 - .../batch_create_instances.php | 123 - .../AlloyDBAdminClient/create_backup.php | 95 - .../AlloyDBAdminClient/create_cluster.php | 95 - .../AlloyDBAdminClient/create_instance.php | 91 - .../create_secondary_cluster.php | 96 - .../create_secondary_instance.php | 91 - .../V1beta/AlloyDBAdminClient/create_user.php | 71 - .../AlloyDBAdminClient/delete_backup.php | 76 - .../AlloyDBAdminClient/delete_cluster.php | 76 - .../AlloyDBAdminClient/delete_instance.php | 81 - .../V1beta/AlloyDBAdminClient/delete_user.php | 65 - .../AlloyDBAdminClient/failover_instance.php | 86 - .../generate_client_certificate.php | 71 - .../V1beta/AlloyDBAdminClient/get_backup.php | 66 - .../V1beta/AlloyDBAdminClient/get_cluster.php | 67 - .../get_connection_info.php | 72 - .../AlloyDBAdminClient/get_instance.php | 72 - .../AlloyDBAdminClient/get_location.php | 53 - .../V1beta/AlloyDBAdminClient/get_user.php | 67 - .../AlloyDBAdminClient/inject_fault.php | 88 - .../AlloyDBAdminClient/list_backups.php | 71 - .../AlloyDBAdminClient/list_clusters.php | 74 - .../AlloyDBAdminClient/list_instances.php | 76 - .../AlloyDBAdminClient/list_locations.php | 58 - .../list_supported_database_flags.php | 77 - .../V1beta/AlloyDBAdminClient/list_users.php | 71 - .../AlloyDBAdminClient/promote_cluster.php | 82 - .../AlloyDBAdminClient/restart_instance.php | 85 - .../AlloyDBAdminClient/restore_cluster.php | 97 - .../AlloyDBAdminClient/update_backup.php | 87 - .../AlloyDBAdminClient/update_cluster.php | 86 - .../AlloyDBAdminClient/update_instance.php | 82 - .../V1beta/AlloyDBAdminClient/update_user.php | 56 - .../v1beta/src/V1beta/AlloyDBAdminClient.php | 36 - .../V1beta/Gapic/AlloyDBAdminGapicClient.php | 3386 --------------- .../v1beta/src/V1beta/gapic_metadata.json | 183 - .../alloy_db_admin_client_config.json | 209 - .../alloy_db_admin_descriptor_config.php | 242 -- .../alloy_db_admin_rest_client_config.php | 453 -- .../Unit/V1beta/AlloyDBAdminClientTest.php | 3403 --------------- 407 files changed, 68 insertions(+), 88204 deletions(-) delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Resources.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Service.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php delete mode 100644 owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_location.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_locations.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php delete mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/Client/AlloyDBAdminClient.php delete mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php delete mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json delete mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php delete mode 100644 owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php delete mode 100644 owl-bot-staging/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php delete mode 100644 owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Resources.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Service.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/Gapic/AlloyDBAdminGapicClient.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php delete mode 100644 owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Resources.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Service.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/Gapic/AlloyDBAdminGapicClient.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json delete mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php delete mode 100644 owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php diff --git a/AlloyDb/metadata/V1/Service.php b/AlloyDb/metadata/V1/Service.php index 25fefab0cca3d3d2f107605993e2a42f2df66a9e..238c970fac6287546279ac5709830e3c5cbf2bce 100644 GIT binary patch delta 64 zcmexZIkjp-Gz;US%`q(85-iUdxfCWF$VyLclUXJ&q{Jm!TAUi6n_7~Xl30=$pIVWe Uk(igBD#50}sKK#WUG|hb0M0oS-T(jq delta 32 ocmbPQ^|5k8Gz;Ut%`q(85-f)qxfCY9H&dA0EwgZQfb3Cu0MJ4VCjbBd diff --git a/AlloyDb/src/V1/Cluster/NetworkConfig.php b/AlloyDb/src/V1/Cluster/NetworkConfig.php index 579ed767a6b8..38e319e5da18 100644 --- a/AlloyDb/src/V1/Cluster/NetworkConfig.php +++ b/AlloyDb/src/V1/Cluster/NetworkConfig.php @@ -32,8 +32,8 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * instance IPs for this cluster will be created in the allocated range. The * range name must comply with RFC 1035. Specifically, the name must be 1-63 * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. * * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -58,8 +58,8 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * instance IPs for this cluster will be created in the allocated range. The * range name must comply with RFC 1035. Specifically, the name must be 1-63 * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. * } */ public function __construct($data = NULL) { @@ -109,8 +109,8 @@ public function setNetwork($var) * instance IPs for this cluster will be created in the allocated range. The * range name must comply with RFC 1035. Specifically, the name must be 1-63 * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. * * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -126,8 +126,8 @@ public function getAllocatedIpRange() * instance IPs for this cluster will be created in the allocated range. The * range name must comply with RFC 1035. Specifically, the name must be 1-63 * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. + * `[a-z]([-a-z0-9]*[a-z0-9])?`. + * Field name is intended to be consistent with Cloud SQL. * * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/AlloyDb/src/V1/Gapic/AlloyDBAdminGapicClient.php b/AlloyDb/src/V1/Gapic/AlloyDBAdminGapicClient.php index abb9bad6dcbb..ebe3d7f72464 100644 --- a/AlloyDb/src/V1/Gapic/AlloyDBAdminGapicClient.php +++ b/AlloyDb/src/V1/Gapic/AlloyDBAdminGapicClient.php @@ -1869,6 +1869,10 @@ public function failoverInstance($name, array $optionalArgs = []) * default duration. * @type string $publicKey * Optional. The public key from the client. + * @type bool $useMetadataExchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. * @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 @@ -1897,6 +1901,12 @@ public function generateClientCertificate($parent, array $optionalArgs = []) $request->setPublicKey($optionalArgs['publicKey']); } + if (isset($optionalArgs['useMetadataExchange'])) { + $request->setUseMetadataExchange( + $optionalArgs['useMetadataExchange'] + ); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); diff --git a/AlloyDb/src/V1/GenerateClientCertificateRequest.php b/AlloyDb/src/V1/GenerateClientCertificateRequest.php index 96e33e2dc263..a66f9ccd2a1a 100644 --- a/AlloyDb/src/V1/GenerateClientCertificateRequest.php +++ b/AlloyDb/src/V1/GenerateClientCertificateRequest.php @@ -55,6 +55,14 @@ class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; */ protected $public_key = ''; + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_metadata_exchange = false; /** * @param string $parent Required. The name of the parent resource. The required format is: @@ -100,6 +108,10 @@ public static function build(string $parent): self * default duration. * @type string $public_key * Optional. The public key from the client. + * @type bool $use_metadata_exchange + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. * } */ public function __construct($data = NULL) { @@ -251,5 +263,35 @@ public function setPublicKey($var) return $this; } + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseMetadataExchange() + { + return $this->use_metadata_exchange; + } + + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + * + * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseMetadataExchange($var) + { + GPBUtil::checkBool($var); + $this->use_metadata_exchange = $var; + + return $this; + } + } diff --git a/AlloyDb/src/V1/Instance.php b/AlloyDb/src/V1/Instance.php index c0ce05d48fb0..8a5e4930c841 100644 --- a/AlloyDb/src/V1/Instance.php +++ b/AlloyDb/src/V1/Instance.php @@ -146,7 +146,8 @@ class Instance extends \Google\Protobuf\Internal\Message */ protected $query_insights_config = null; /** - * Read pool specific config. + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. * * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; */ @@ -261,7 +262,8 @@ class Instance extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig $query_insights_config * Configuration for query insights. * @type \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig $read_pool_config - * Read pool specific config. + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. * @type string $ip_address * Output only. The IP address for the Instance. * This is the connection endpoint for an end-user application. @@ -829,7 +831,8 @@ public function setQueryInsightsConfig($var) } /** - * Read pool specific config. + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. * * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; * @return \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig|null @@ -850,7 +853,8 @@ public function clearReadPoolConfig() } /** - * Read pool specific config. + * Read pool instance configuration. + * This is required if the value of instanceType is READ_POOL. * * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; * @param \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig $var diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Resources.php b/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Resources.php deleted file mode 100644 index 1ab8a44321b87ccb5ca10a506988fe5fef98191c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11817 zcmds7&2t;aayP(FG)M?qQ4|E(77WWzw4V%Gu>9f&Nlq5P5`ql^5CBq-uUK!h0G7~3 z%UyVPA(?jZnxrbZzao`G{svd2QkBx5;6p0iGqZ~iV)>!UCDB0yFw;FV zJ^k_Po__M@!roP=X?NNVQGfn%X-`#%waNE)O3^&Jk0$AFy?hdt{ zo~bm8ySk_KHBURNF!I9^ksr#O{BZx_V}PEixo)QAvw@!=ga3x3u4(i#uBUnU=bquJ zhGlq$W*R@@DV}DIG}G0Q`t01Jk=64I+sY6@!|Lf0jhTdz`a-=tRUnS?2=xV}_zt8U z0~Ns2j)(6+`@+$NL)~#NPue*d>W5|R#6EhX>#wdzM_aXz`r65SI;Je2e`5&Mko)~W z6L!#Awt~B(o4gPI)q%tNm$Vb<7N3}729*;Am3#d#eOqwQhDKmq+_usmiXmocsI=RC zaZ6(S?(DedUqu*$H$vWG{ElGYp-{I`EL^Db28lD193RZ)U~SLUohI7y8{6qiYp^)N z@2N;8vK5n(usReYsVM!D{f`J-+cgGU$=b}vNShFQX}g{}v>lHV78ib&7o^*;=IH39 zbTnqw=yMKyXdmL-{iw9%)B^HO<#nnYlD3eF7itRx2&J zQ*G4Mc4MzqQq;~tQ&IQo?WR(y?o^d>@;zw<7RtNrWF)%N8kTyP%bmGl>Vjpl{B zaZ!v5Te0F7DB)k^&tQuwB2E&_QT^N;hK21C?ZEy{KiTJm*~3FvWYXAx<+@x^%99hK+5e70tnHdYS~9G< zuBjf|eJ-g){|+89MXmR0G;G=!j8CNB!8LNS=85X|Uh4gksWW-T^G`$NIhRrH1>@2d zOrE_bX|O>aMeS;?-d8b5>K2(yY7rGao|mu4p4@toIJJC6&mximsqaS`vh_~REVIOx zQLebmbHVP+QX8smpGE&R5|O@u^)8d9`o^&O_8aD{;`!VDs=imx`LS23 z!u1Ic&}051waWJTsZTW6X-m}qzp9mdNNp8$amZb7LZJ~%5&tE}XCO3#dX=8SSEHo)op~=8# z#Y7R$AKv$`_#C|?7A(w4U%{FX2GbMaP0~J(z#{0r8KmT7pO2-BMznw-aaywiUE$MZ zNa>nm8pr}&i;KvfY?H6Z9n3{5W_z&4??*tDTL8kAN7I0$0C6!e4(`QIewL%Z$amob zALem<5`5SFM97PB#(V8=Lgy(Up+LaNaaQ&d64Bf&-bKvaF*#OT7;B99u+Ur6<2 z#^r_sIdMI?NuN`IB}z4Q76B6ZUxkX+CvMYhE}IIh2?gRnGKCvH4@mkf#NRQHtU!|T zd5Y7jK$58#V-|kZWkDbSB<(07eFq6k_b^v@rS^DW`+x~Ccj2+>oQ!))&g{3aBABHB zxx|WFsR*;V417qXjghAdwt>wFE|jQXjbf0B6P>gJam})9syYxvUSnbF;e}h0$22S; zBH)XYr?z^AX;_2QIx=77H}My+CMp>!OOO)m)Zz9vnN<;oMX3R|G#{QJk|BJCDH8#- z)OE%zT!eEYxl{lkj4iG~Vmz{;XAV$yF`A0ZhbT7~iz@^jrV(?3$_8U}#h|heDLjgZ zs=k24;qEYo+o6Xm1%%ws;djj0xRSMC^DJK$``%|__us*e8=^osgkm3Y^%YY}3 z4_Ab6={zLQnDqs)FZ+)XSYlpR!rZFekvp>qVhomAid;UxL^zHKWv9_>Vip&b@ONdm z**QoqphH?M;havjUcvMZzm=7m!oDp@0LwdawT2|i(sfubHX5CFrzJO=GO0RsfM{YX5w@5c-&vJRo#_av{_`-R!WU} znZ8B~-M6v|ABLbAv4m7W`1V(N&vUnb5}!`D{Tu{;^FN+qO_@O({7rm1ZABu*RaoYb zB>VRgtX3_IeOUj&WB)$}2v27KLbyxu^$nnS%r#*TdaM zz{LOH!-S|*fyA-adudp@@6{+S$MfNy*XNPj<#fWS?ZS2KwPs+ZijfpEcgh@DtWMG5-rx|Zhk+a{LrvmWAM^*efi&H@((Z6 z1RHry8eOv&67r5yst z&tNA?Bm{Qyu^Pdg80y#*R+E^tE~6B)U`<89fY~7?Qa#(U&|@L?^TozP=+_r3Ly2*~ zvk3N4uV_N)UAQ{l5JyM`WQC(Am(e9ONAKq80#CjP0Fm+StYEPh7=~^b2n2= z!KObpy@ld!xTVhLoxTT&8SO$*kr7Ra_%-I&b8iWY(vqWpKQbKVuIL7Bhp>atyoiKP zeiIOx1QyR<1|k!%y(;i{1kxPOasl*sC%Ezt?+RBYF$zO00Y+Jz1tAxJmNOXTcd+Jr z4Cb-%IiXrdD20ILGAM=6mD+4HY6z;PK+8h5j(~199()8J$oq(>yIzlp#nAqSdS?+^dW$J*`%o|Dd#{bL-K zc?$M_6!Gyo+Jz;d#{uG7X7MZhWr|B<3h({a4*@IakP`XuB7&fu0DE~@WKfD;6B7A* zq47;nGE=-kMK9hQL2okz4`Wp65U8Cg6jcvI9Dg#dIWg7bm6;%I4AV2749r$gs5~Q3 zz}#060&`cYbBC22s8n<1I<^l?2n)p|Wg3_y*~NwfBq8E6$tD`Hi`_12_ryamNSJ4V z8!;9i^&f@?f;@U$5fJl2O?!?tdrsv)gCW4AvwnHe=@Rt`=G4gi*1>w=JFoCr(>~!DhUYy%+oR9-)ro(lM4m)t&B;*`7aOB*O&F? zT~=;Pa+rTFX4v3i1h5@7z|m{dn2h`_@nMzX1O*)o7mD6 zFv6FIE^JVD&H!QN)DrxWv>2+{^Ov9=Fl05e#&l>!=uT-OuSc=SiYX+p_dlMT@*b4% zjA8!L`}BawyzE^p@Ai875L36~k?9#jOeGn6{?50GdCyJP7q{B)`ek?*5jH)AUE1^r z$P3i#5+4#EzSy$o;nnm5Y)m*Kact2^kl%iTr981GdfAPoM{r|~@T45X5dHJ13{J=M zcl#0U zlol_%?bI4_2Mcejn1MCwN^-FL=te@=@D>TDV-boSq) zut){}d6?(sY!4NAxJA6gas9%vO^g(abR#qvk-mW#Ju+~`qy+4|XCqoTNB@x;GWzUu zSoMFPMv}eu{8Aw{0#T#NLAj_F_o~?OQ>9LyiC?Sou1ds+n$5Se0e3=VON&XB%Zl=B z-Eez^4A48#AM#C~{b8I<>>K(UX)>GGuPQHQ8n3DWey&Rz|3 zfX@a&MU}CisHo22j!gV|>lE`Wd^q*{*ng`nd76W_$|;$o(TeeZnwR<2+87WrV#_6DZi)y!@2yotQUr_=5-&i3pt?+0C| b4|u=vM0+w7h>YHx)?_x5HxQq~DZu{#6_IIS diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Service.php b/owl-bot-staging/AlloyDb/v1/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1/Service.php deleted file mode 100644 index 238c970fac6287546279ac5709830e3c5cbf2bce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15637 zcmds8+ix6K8Sktwv5ynSK8Y`Jnr1UeiR(JM_10<9Nz$_R+OEmXik*m73!~Zf*dDT; z8D?gkxKSji03iedQEq<#*S;Zy5Kp{tkpdD`0RfSastO6I;(-SqP$5@;ftmS9f-d zs-B}eB4ldYx@&7yJ-f6rcUAYabacb%?MB_KdWL0Y$%5-;ZWx>p68j`1EYn(Y?B3UZA+i2KW8n$}z$!+D5r(nii3QWx9&e;Hj}i(!%+gp_^WN zYZeW?wmzqCX*-7Hw72wz&dnq>$fzll#TIQadc`s~ow{in=4Sc2O$@v}LHYVG)!Ewg zO#4egaSPkFx7)!|D(|bBd%J_RYX-QPr)}Hm*WR$J+?0PosBi^kk}-fX5hFj)smL4;{IknF)R)uh|B~6=JX~icB2m8gV}-Jc{~lZBtiW2(sfDSlTn!^>$Ih z7$JJyvu^9=co*3dA40twMh%`i-c6rD2}e+$<*e(DTG<`%@h{7F(cv&m*M?}O;{xid za_E4xYjU8F%`s?u3?(Npj-i95e%Dh2fCy3oXrOL7x>nuNDm5KYc1`xnuSsZlNf!bV z@|i{5Bu9m%gIY=F9O~XN^gC2AgN0MAklq4XDn9uy5;`^y$UJ>juUh81=InBA1fWh8 zHb#;s)xB!0Q(*n%kr}Xnef$PhR|>(hb+DnsjEHR5P$8Z`2X-L&LMGQ$%dG8=_kz&- z7=OQ)&|${k2ZODE!R}#;u*})|1F&_|CLBlDngvUv*Hz-h)QScQ6T%*Z8|VDkPNfu7 z2{G6XRYIMQZMX+J;frA>>LR{=N8L7D7jh$2CFkq=z*kAH=`nnD;uc|(p}xrQ4Wn+T z{We*=Xbl;oo(&7i%plaSOK4=pv9_)MEv)iCGiU^g6{r!Tw($ZwP|>Ql>$b|OAsQVA z3Qr2_h$g_?9Hm~R74}Py;Z-yaA;L4vx>a}8@K$})Z1Ra)&HD=@n|`3f%UmDoWwMmN z2bN0`$+8J)5Gs2=;hl>lyz*(9@lN352^ml9@V=$IduSwrl;^xz)Ncs*Jn5ZC)Tj@$ zy{z{s31P^3VztOJXG3XE$OyHR(X*k%mu$-7c_j16e+JiONkLo|FgjP(I2tgx>>~N@ zJn9p7c*1KfR1%UhI2^uGriOPU^h6}1{~vN`q0v|ky7(qUDO%9Lshqi@%F70q+jK6` zren9Hx{!Y&p`&w}SKSKJJOVdgM14L$mVKLqQOa3FpKhGBG?KBrh8~Yc{@=L0{H09% zwxX$m$I+0l0Z((FSHTp}k2lb;e}^3!bQdZ_QeUIAwMHVBviG z56O|8bUcjub;q$Bb=%!!RW&|=dgvvd&#~AW&SZ2^-NhGCx3_DPlZP}pSV(pNAueB_ zYp_b*K|So@BWQSat+=+J-n_QDvM|5AxV%srdJN8BgDVTyO3T-l)cG3=aDPa`{ip|i zExkOH!TV7ky$tth{DfZh7PWfK6RN+4&<6Qir3Ou!2!n;Q!sPdquzNSi(cOq$ zv#=@T%_Nq-@(9a2ok_@0Vfl{-+ZkOf-n_D=uD!exb*TZgZ*}eZihAqnkR*RbLZhUl z*PKUIH-*s$tfiSoz6P}$sT^4e@29@AkqY-oTHqeX#}W!$wwy$=NJl5OnKKw}=HQ`d zA4jgUPLq#{r?qF$z6w3Sh`fJ1(MmX?_A1#WGz5h#TPlnb%F#ggh6@5U7liyT0*+YV4s+C5*lqx4LAw*+>HM>4Z{n-K z6bsp5raIAiq_j`xf8a5!Ythhx{1pkEATGIDw{6RT30eu}SryII7i-$4@1doLht5(D z&Ee?;4~^X|rNhc!mXO>G5_iuPH0}z}Dw)C&)anL--Lg)P$Cu>3^4}!nj~LnHX;&2kN3^rg?Nr@V0bINF> z4iehtLrYb^3+-fcQxCQ~KZZ_-sYnc?T=KAyt#7LY9G8I#I~gV|!D*AW3m=9itwu=# zJux*Wb zb)%B2f|xqp75ft{bV0WZVikV?nR(E&LR=@+pLEf6cn0<9=DJFkuxPcn`5IXQ(+YMx zYDl_^xH{BdmBs+03m-*;dYgJt?4AD!iS z0h#$t`;Z?&j=zV7S&9#G)4qB;O7DgDX3+j3dHJL?S6tsVO#Fs~_7mIYGaeUDC)#n4 zjGN`enUvJbXXHz-{qC=?XP_t`ug%z60%*(0s(c}Yjg;64$b4V`@?nt{3BQfJ>H4h)&@1 zO))Tv&-sZ-zDvQKliL!UB8H$3i$|EOr@2hUPjKi5#mCV;0XilXLL>VC^FBe8%vp#o zC1(WT^Vi<#6E(^^WNxJf-I zPN5P0Hh^Eo(f4d{jFx^WL4PbXDa6SgxG-T#UUbUK^D@&@N?sH|PNtWNH086^+}wT! zjD$yvO&AFirex&fAx2WhAjM(hPGF>!QN0J96z1a5*B$V4i2*BqK}wE3FHx43@DD9See+67toc{T~(^O^0fe7KRV+Uk$RNBL%x*!j$ZKEFeuW zC+|EUwO6XZ#BC@#{K3y8T5pszC2ua}ZBb^L?0`3AgAb^JwMz??!JCc)foV{a3=*J9 z$DB@De!jwHON|ocbqV!D z@xeC5PbE5yPa{CKnrFyL2v;+)b5MbL zIHxpa>gT`|OB5}c3X-K{YLi*e6w^~%7Svt>fw#{lh#$sIXk4r$dPVXg!QzFE*7Bps zWu{fEq;YM3E)^Q4H9Y+v5;~GNX2H)V;!Ip4SWFgAlck))a+$JtwcWZHJ|bfu-|ZO~ z(I73_d%xyiD}-i0c%})j@pGby^6A7i;lYyp3T5arUT&?k!0|Cu>E+>t<-n|}p~4?P zuqGx)`n+zFVC~Zg6(#pI1EgFf3zUK9Fl);+?PdfRxSuDDd$)lV-WA#hNrOPeO{B+3 z1W-S6$Id+D`4F~d5rOyaNDG((3nZ5xLeH0F4GJz}m2Jl77Nc)dnM0nnm1zPDu53$#EoVthOZ3}i~B85 zH;4r4QQ>dlPNlGbsdk!%Q45&($b;f&{OIqkVs6XxY*)$W@7%e=G5DW#X?1T4Y#zS1 zJ!8Y5627k3p8GMpVhf*q3Aj zvnv<;-`>cKEz!??bMxf!IW}>rP_OJMdXaH&#;Z-L*google.cloud.alloydb.v1.AutomatedBackupPolicy - */ -class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - */ - protected $enabled = null; - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - */ - protected $backup_window = null; - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - */ - protected $location = ''; - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - protected $schedule; - protected $retention; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule $weekly_schedule - * Weekly schedule for the Backup. - * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention $time_based_retention - * Time-based Backup retention policy. - * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention $quantity_based_retention - * Quantity-based Backup retention policy to retain recent backups. - * @type bool $enabled - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * @type \Google\Protobuf\Duration $backup_window - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * @type string $location - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels to apply to backups created using this configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Weekly schedule for the Backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; - * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule|null - */ - public function getWeeklySchedule() - { - return $this->readOneof(2); - } - - public function hasWeeklySchedule() - { - return $this->hasOneof(2); - } - - /** - * Weekly schedule for the Backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; - * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule $var - * @return $this - */ - public function setWeeklySchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\WeeklySchedule::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Time-based Backup retention policy. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; - * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention|null - */ - public function getTimeBasedRetention() - { - return $this->readOneof(4); - } - - public function hasTimeBasedRetention() - { - return $this->hasOneof(4); - } - - /** - * Time-based Backup retention policy. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; - * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention $var - * @return $this - */ - public function setTimeBasedRetention($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\TimeBasedRetention::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Quantity-based Backup retention policy to retain recent backups. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; - * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention|null - */ - public function getQuantityBasedRetention() - { - return $this->readOneof(5); - } - - public function hasQuantityBasedRetention() - { - return $this->hasOneof(5); - } - - /** - * Quantity-based Backup retention policy to retain recent backups. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; - * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention $var - * @return $this - */ - public function setQuantityBasedRetention($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy\QuantityBasedRetention::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - * @return bool - */ - public function getEnabled() - { - return isset($this->enabled) ? $this->enabled : false; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getBackupWindow() - { - return $this->backup_window; - } - - public function hasBackupWindow() - { - return isset($this->backup_window); - } - - public function clearBackupWindow() - { - unset($this->backup_window); - } - - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setBackupWindow($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->backup_window = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - * @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; - } - - /** - * @return string - */ - public function getSchedule() - { - return $this->whichOneof("schedule"); - } - - /** - * @return string - */ - public function getRetention() - { - return $this->whichOneof("retention"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php deleted file mode 100644 index 5feb7913bbd5..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/QuantityBasedRetention.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - */ -class QuantityBasedRetention extends \Google\Protobuf\Internal\Message -{ - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - */ - protected $count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $count - * The number of backups to retain. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - * @param int $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkInt32($var); - $this->count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QuantityBasedRetention::class, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy_QuantityBasedRetention::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php deleted file mode 100644 index efb83eac7a9c..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/TimeBasedRetention.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - */ -class TimeBasedRetention extends \Google\Protobuf\Internal\Message -{ - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - */ - protected $retention_period = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $retention_period - * The retention period. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - * @return \Google\Protobuf\Duration|null - */ - public function getRetentionPeriod() - { - return $this->retention_period; - } - - public function hasRetentionPeriod() - { - return isset($this->retention_period); - } - - public function clearRetentionPeriod() - { - unset($this->retention_period); - } - - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRetentionPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->retention_period = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TimeBasedRetention::class, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy_TimeBasedRetention::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php deleted file mode 100644 index 3b42ae953258..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/AutomatedBackupPolicy/WeeklySchedule.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - */ -class WeeklySchedule extends \Google\Protobuf\Internal\Message -{ - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - */ - private $start_times; - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - */ - private $days_of_week; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $start_times - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStartTimes() - { - return $this->start_times; - } - - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - * @param array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStartTimes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\TimeOfDay::class); - $this->start_times = $arr; - - return $this; - } - - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDaysOfWeek() - { - return $this->days_of_week; - } - - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDaysOfWeek($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); - $this->days_of_week = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(WeeklySchedule::class, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy_WeeklySchedule::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php deleted file mode 100644 index eb9d0691371e..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup.php +++ /dev/null @@ -1,917 +0,0 @@ -google.cloud.alloydb.v1.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - */ - private $labels; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.Type type = 8; - */ - protected $type = 0; - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - */ - protected $description = ''; - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cluster_uid = ''; - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $cluster_name = ''; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - */ - private $annotations; - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $size_bytes = 0; - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expiry_time = null; - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expiry_quantity = null; - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $database_version = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * @type string $display_name - * User-settable and human-readable display name for the Backup. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current state of the backup. - * @type int $type - * The backup type, which suggests the trigger for the backup. - * @type string $description - * User-provided description of the backup. - * @type string $cluster_uid - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * @type string $cluster_name - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * @type \Google\Cloud\AlloyDb\V1\EncryptionInfo $encryption_info - * Output only. The encryption information for the backup. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type int|string $size_bytes - * Output only. The size of the backup in bytes. - * @type \Google\Protobuf\Timestamp $expiry_time - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * @type \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry $expiry_quantity - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * @type int $database_version - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - * @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 current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Backup\State::class); - $this->state = $var; - - return $this; - } - - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.Type type = 8; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.Type type = 8; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Backup\Type::class); - $this->type = $var; - - return $this; - } - - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getClusterUid() - { - return $this->cluster_uid; - } - - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setClusterUid($var) - { - GPBUtil::checkString($var, True); - $this->cluster_uid = $var; - - return $this; - } - - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getClusterName() - { - return $this->cluster_name; - } - - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setClusterName($var) - { - GPBUtil::checkString($var, True); - $this->cluster_name = $var; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getSizeBytes() - { - return $this->size_bytes; - } - - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setSizeBytes($var) - { - GPBUtil::checkInt64($var); - $this->size_bytes = $var; - - return $this; - } - - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpiryTime() - { - return $this->expiry_time; - } - - public function hasExpiryTime() - { - return isset($this->expiry_time); - } - - public function clearExpiryTime() - { - unset($this->expiry_time); - } - - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpiryTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expiry_time = $var; - - return $this; - } - - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry|null - */ - public function getExpiryQuantity() - { - return $this->expiry_quantity; - } - - public function hasExpiryQuantity() - { - return isset($this->expiry_quantity); - } - - public function clearExpiryQuantity() - { - unset($this->expiry_quantity); - } - - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry $var - * @return $this - */ - public function setExpiryQuantity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Backup\QuantityBasedExpiry::class); - $this->expiry_quantity = $var; - - return $this; - } - - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDatabaseVersion() - { - return $this->database_version; - } - - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDatabaseVersion($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\DatabaseVersion::class); - $this->database_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php deleted file mode 100644 index d75512a4855a..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/QuantityBasedExpiry.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - */ -class QuantityBasedExpiry extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $retention_count = 0; - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $total_retention_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $retention_count - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * @type int $total_retention_count - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRetentionCount() - { - return $this->retention_count; - } - - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRetentionCount($var) - { - GPBUtil::checkInt32($var); - $this->retention_count = $var; - - return $this; - } - - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getTotalRetentionCount() - { - return $this->total_retention_count; - } - - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setTotalRetentionCount($var) - { - GPBUtil::checkInt32($var); - $this->total_retention_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QuantityBasedExpiry::class, \Google\Cloud\AlloyDb\V1\Backup_QuantityBasedExpiry::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php deleted file mode 100644 index 8dfa88a8797a..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.alloydb.v1.Backup.State - */ -class State -{ - /** - * The state of the backup is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The backup is ready. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The backup is creating. - * - * Generated from protobuf enum CREATING = 2; - */ - const CREATING = 2; - /** - * The backup failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The backup is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::CREATING => 'CREATING', - self::FAILED => 'FAILED', - self::DELETING => 'DELETING', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1\Backup_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php deleted file mode 100644 index 7d60230e8641..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Backup/Type.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.alloydb.v1.Backup.Type - */ -class Type -{ - /** - * Backup Type is unknown. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * ON_DEMAND backups that were triggered by the customer (e.g., not - * AUTOMATED). - * - * Generated from protobuf enum ON_DEMAND = 1; - */ - const ON_DEMAND = 1; - /** - * AUTOMATED backups triggered by the automated backups scheduler pursuant - * to an automated backup policy. - * - * Generated from protobuf enum AUTOMATED = 2; - */ - const AUTOMATED = 2; - /** - * CONTINUOUS backups triggered by the automated backups scheduler - * due to a continuous backup policy. - * - * Generated from protobuf enum CONTINUOUS = 3; - */ - const CONTINUOUS = 3; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::ON_DEMAND => 'ON_DEMAND', - self::AUTOMATED => 'AUTOMATED', - self::CONTINUOUS => 'CONTINUOUS', - ]; - - 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(Type::class, \Google\Cloud\AlloyDb\V1\Backup_Type::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php deleted file mode 100644 index 1f06b4e463de..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BackupSource.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.alloydb.v1.BackupSource - */ -class BackupSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $backup_uid = ''; - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $backup_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $backup_uid - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * @type string $backup_name - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBackupUid() - { - return $this->backup_uid; - } - - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBackupUid($var) - { - GPBUtil::checkString($var, True); - $this->backup_uid = $var; - - return $this; - } - - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackupName() - { - return $this->backup_name; - } - - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackupName($var) - { - GPBUtil::checkString($var, True); - $this->backup_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php deleted file mode 100644 index efd28ffbc66b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.alloydb.v1.BatchCreateInstanceStatus - */ -class BatchCreateInstanceStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; - */ - protected $state = 0; - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - */ - protected $error_msg = ''; - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - */ - protected $error = null; - /** - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType type = 3; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * @type string $error_msg - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * @type \Google\Rpc\Status $error - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * @type int $type - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstanceStatus.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\BatchCreateInstanceStatus\State::class); - $this->state = $var; - - return $this; - } - - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - * @return string - */ - public function getErrorMsg() - { - return $this->error_msg; - } - - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - * @param string $var - * @return $this - */ - public function setErrorMsg($var) - { - GPBUtil::checkString($var, True); - $this->error_msg = $var; - - return $this; - } - - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType type = 3; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType type = 3; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\InstanceType::class); - $this->type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php deleted file mode 100644 index aed7d15776ee..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstanceStatus/State.php +++ /dev/null @@ -1,97 +0,0 @@ -google.cloud.alloydb.v1.BatchCreateInstanceStatus.State - */ -class State -{ - /** - * The state of the instance is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Instance is pending creation and has not yet been picked up for - * processsing in the backend. - * - * Generated from protobuf enum PENDING_CREATE = 1; - */ - const PENDING_CREATE = 1; - /** - * The instance is active and running. - * - * Generated from protobuf enum READY = 2; - */ - const READY = 2; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 3; - */ - const CREATING = 3; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The creation of the instance failed or a fatal error occurred during - * an operation on the instance or a batch of instances. - * - * Generated from protobuf enum FAILED = 5; - */ - const FAILED = 5; - /** - * The instance was created successfully, but was rolled back and deleted - * due to some other failure during BatchCreateInstances operation. - * - * Generated from protobuf enum ROLLED_BACK = 6; - */ - const ROLLED_BACK = 6; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING_CREATE => 'PENDING_CREATE', - self::READY => 'READY', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::ROLLED_BACK => 'ROLLED_BACK', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1\BatchCreateInstanceStatus_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php deleted file mode 100644 index 683281041710..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesMetadata.php +++ /dev/null @@ -1,134 +0,0 @@ -google.cloud.alloydb.v1.BatchCreateInstancesMetadata - */ -class BatchCreateInstancesMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - */ - private $instance_targets; - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - */ - private $instance_statuses; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $instance_targets - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * @type array|\Google\Protobuf\Internal\MapField $instance_statuses - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstanceTargets() - { - return $this->instance_targets; - } - - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstanceTargets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->instance_targets = $arr; - - return $this; - } - - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getInstanceStatuses() - { - return $this->instance_statuses; - } - - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setInstanceStatuses($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\BatchCreateInstanceStatus::class); - $this->instance_statuses = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php deleted file mode 100644 index 5be73ca95737..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.alloydb.v1.BatchCreateInstancesRequest - */ -class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $requests = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. - * @type \Google\Cloud\AlloyDb\V1\CreateInstanceRequests $requests - * Required. Resources being created. - * @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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. - * - * 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 name of the parent resource. - * - * 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. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\CreateInstanceRequests|null - */ - public function getRequests() - { - return $this->requests; - } - - public function hasRequests() - { - return isset($this->requests); - } - - public function clearRequests() - { - unset($this->requests); - } - - /** - * Required. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\CreateInstanceRequests $var - * @return $this - */ - public function setRequests($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\CreateInstanceRequests::class); - $this->requests = $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 = 3 [(.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 = 3 [(.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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php deleted file mode 100644 index 92bd1e0d95be..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/BatchCreateInstancesResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.alloydb.v1.BatchCreateInstancesResponse - */ -class BatchCreateInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; - */ - private $instances; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * Created instances. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; - * @param array<\Google\Cloud\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Instance::class); - $this->instances = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php deleted file mode 100644 index 7a3c30dcc531..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster.php +++ /dev/null @@ -1,1189 +0,0 @@ -google.cloud.alloydb.v1.Cluster - */ -class Cluster extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - /** - * Output only. The current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cluster_type = 0; - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $database_version = 0; - /** - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $network_config = null; - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @deprecated - */ - protected $network = ''; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - */ - private $annotations; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $initial_user = null; - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; - */ - protected $automated_backup_policy = null; - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; - * @deprecated - */ - protected $ssl_config = null; - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $continuous_backup_config = null; - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $continuous_backup_info = null; - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; - */ - protected $secondary_config = null; - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $primary_config = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1\BackupSource $backup_source - * Output only. Cluster created from backup. - * @type \Google\Cloud\AlloyDb\V1\MigrationSource $migration_source - * Output only. Cluster created via DMS migration. - * @type string $name - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * @type string $display_name - * User-settable and human-readable display name for the Cluster. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current serving state of the cluster. - * @type int $cluster_type - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * @type int $database_version - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * @type \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig $network_config - * @type string $network - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * @type \Google\Cloud\AlloyDb\V1\UserPassword $initial_user - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * @type \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy $automated_backup_policy - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * @type \Google\Cloud\AlloyDb\V1\SslConfig $ssl_config - * SSL configuration for this AlloyDB cluster. - * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * @type \Google\Cloud\AlloyDb\V1\EncryptionInfo $encryption_info - * Output only. The encryption information for the cluster. - * @type \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig $continuous_backup_config - * Optional. Continuous backup configuration for this cluster. - * @type \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo $continuous_backup_info - * Output only. Continuous backup properties for this cluster. - * @type \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig $secondary_config - * Cross Region replication config specific to SECONDARY cluster. - * @type \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig $primary_config - * Output only. Cross Region replication config specific to PRIMARY cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Cluster created from backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\BackupSource|null - */ - public function getBackupSource() - { - return $this->readOneof(15); - } - - public function hasBackupSource() - { - return $this->hasOneof(15); - } - - /** - * Output only. Cluster created from backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\BackupSource $var - * @return $this - */ - public function setBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\BackupSource::class); - $this->writeOneof(15, $var); - - return $this; - } - - /** - * Output only. Cluster created via DMS migration. - * - * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\MigrationSource|null - */ - public function getMigrationSource() - { - return $this->readOneof(16); - } - - public function hasMigrationSource() - { - return $this->hasOneof(16); - } - - /** - * Output only. Cluster created via DMS migration. - * - * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\MigrationSource $var - * @return $this - */ - public function setMigrationSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\MigrationSource::class); - $this->writeOneof(16, $var); - - return $this; - } - - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @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 current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Cluster\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getClusterType() - { - return $this->cluster_type; - } - - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setClusterType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Cluster\ClusterType::class); - $this->cluster_type = $var; - - return $this; - } - - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDatabaseVersion() - { - return $this->database_version; - } - - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDatabaseVersion($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\DatabaseVersion::class); - $this->database_version = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - * @deprecated - */ - public function getNetwork() - { - @trigger_error('network is deprecated.', E_USER_DEPRECATED); - return $this->network; - } - - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - * @deprecated - */ - public function setNetwork($var) - { - @trigger_error('network is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\UserPassword|null - */ - public function getInitialUser() - { - return $this->initial_user; - } - - public function hasInitialUser() - { - return isset($this->initial_user); - } - - public function clearInitialUser() - { - unset($this->initial_user); - } - - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\UserPassword $var - * @return $this - */ - public function setInitialUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\UserPassword::class); - $this->initial_user = $var; - - return $this; - } - - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; - * @return \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy|null - */ - public function getAutomatedBackupPolicy() - { - return $this->automated_backup_policy; - } - - public function hasAutomatedBackupPolicy() - { - return isset($this->automated_backup_policy); - } - - public function clearAutomatedBackupPolicy() - { - unset($this->automated_backup_policy); - } - - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1.AutomatedBackupPolicy automated_backup_policy = 17; - * @param \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy $var - * @return $this - */ - public function setAutomatedBackupPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\AutomatedBackupPolicy::class); - $this->automated_backup_policy = $var; - - return $this; - } - - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; - * @return \Google\Cloud\AlloyDb\V1\SslConfig|null - * @deprecated - */ - public function getSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - return $this->ssl_config; - } - - public function hasSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - return isset($this->ssl_config); - } - - public function clearSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - unset($this->ssl_config); - } - - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; - * @param \Google\Cloud\AlloyDb\V1\SslConfig $var - * @return $this - * @deprecated - */ - public function setSslConfig($var) - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SslConfig::class); - $this->ssl_config = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig|null - */ - public function getContinuousBackupConfig() - { - return $this->continuous_backup_config; - } - - public function hasContinuousBackupConfig() - { - return isset($this->continuous_backup_config); - } - - public function clearContinuousBackupConfig() - { - unset($this->continuous_backup_config); - } - - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig $var - * @return $this - */ - public function setContinuousBackupConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\ContinuousBackupConfig::class); - $this->continuous_backup_config = $var; - - return $this; - } - - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo|null - */ - public function getContinuousBackupInfo() - { - return $this->continuous_backup_info; - } - - public function hasContinuousBackupInfo() - { - return isset($this->continuous_backup_info); - } - - public function clearContinuousBackupInfo() - { - unset($this->continuous_backup_info); - } - - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo $var - * @return $this - */ - public function setContinuousBackupInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\ContinuousBackupInfo::class); - $this->continuous_backup_info = $var; - - return $this; - } - - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; - * @return \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig|null - */ - public function getSecondaryConfig() - { - return $this->secondary_config; - } - - public function hasSecondaryConfig() - { - return isset($this->secondary_config); - } - - public function clearSecondaryConfig() - { - unset($this->secondary_config); - } - - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; - * @param \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig $var - * @return $this - */ - public function setSecondaryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\SecondaryConfig::class); - $this->secondary_config = $var; - - return $this; - } - - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig|null - */ - public function getPrimaryConfig() - { - return $this->primary_config; - } - - public function hasPrimaryConfig() - { - return isset($this->primary_config); - } - - public function clearPrimaryConfig() - { - unset($this->primary_config); - } - - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig $var - * @return $this - */ - public function setPrimaryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig::class); - $this->primary_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php deleted file mode 100644 index 59a819d045b1..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/ClusterType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1.Cluster.ClusterType - */ -class ClusterType -{ - /** - * The type of the cluster is unknown. - * - * Generated from protobuf enum CLUSTER_TYPE_UNSPECIFIED = 0; - */ - const CLUSTER_TYPE_UNSPECIFIED = 0; - /** - * Primary cluster that support read and write operations. - * - * Generated from protobuf enum PRIMARY = 1; - */ - const PRIMARY = 1; - /** - * Secondary cluster that is replicating from another region. - * This only supports read. - * - * Generated from protobuf enum SECONDARY = 2; - */ - const SECONDARY = 2; - - private static $valueToName = [ - self::CLUSTER_TYPE_UNSPECIFIED => 'CLUSTER_TYPE_UNSPECIFIED', - self::PRIMARY => 'PRIMARY', - self::SECONDARY => 'SECONDARY', - ]; - - 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(ClusterType::class, \Google\Cloud\AlloyDb\V1\Cluster_ClusterType::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php deleted file mode 100644 index 0719e408cdb8..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/NetworkConfig.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.alloydb.v1.Cluster.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $network = ''; - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * `[a-z]([-a-z0-9]*[a-z0-9])?`. - * Field name is intended to be consistent with Cloud SQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allocated_ip_range = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * @type string $allocated_ip_range - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * `[a-z]([-a-z0-9]*[a-z0-9])?`. - * Field name is intended to be consistent with Cloud SQL. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * `[a-z]([-a-z0-9]*[a-z0-9])?`. - * Field name is intended to be consistent with Cloud SQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAllocatedIpRange() - { - return $this->allocated_ip_range; - } - - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * `[a-z]([-a-z0-9]*[a-z0-9])?`. - * Field name is intended to be consistent with Cloud SQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAllocatedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->allocated_ip_range = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NetworkConfig::class, \Google\Cloud\AlloyDb\V1\Cluster_NetworkConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php deleted file mode 100644 index 229e0bf82669..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/PrimaryConfig.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1.Cluster.PrimaryConfig - */ -class PrimaryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $secondary_cluster_names; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_cluster_names - * Output only. Names of the clusters that are replicating from this - * cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecondaryClusterNames() - { - return $this->secondary_cluster_names; - } - - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecondaryClusterNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->secondary_cluster_names = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PrimaryConfig::class, \Google\Cloud\AlloyDb\V1\Cluster_PrimaryConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php deleted file mode 100644 index b3ddfb245158..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/SecondaryConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.alloydb.v1.Cluster.SecondaryConfig - */ -class SecondaryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - */ - protected $primary_cluster_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $primary_cluster_name - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - * @return string - */ - public function getPrimaryClusterName() - { - return $this->primary_cluster_name; - } - - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - * @param string $var - * @return $this - */ - public function setPrimaryClusterName($var) - { - GPBUtil::checkString($var, True); - $this->primary_cluster_name = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SecondaryConfig::class, \Google\Cloud\AlloyDb\V1\Cluster_SecondaryConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php deleted file mode 100644 index 362f2a921449..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Cluster/State.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.alloydb.v1.Cluster.State - */ -class State -{ - /** - * The state of the cluster is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The cluster is active and running. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The cluster is stopped. All instances in the cluster are stopped. - * Customers can start a stopped cluster at any point and all their - * instances will come back to life with same names and IP resources. In - * this state, customer pays for storage. - * Associated backups could also be present in a stopped cluster. - * - * Generated from protobuf enum STOPPED = 2; - */ - const STOPPED = 2; - /** - * The cluster is empty and has no associated resources. - * All instances, associated storage and backups have been deleted. - * - * Generated from protobuf enum EMPTY = 3; - */ - const PBEMPTY = 3; - /** - * The cluster is being created. - * - * Generated from protobuf enum CREATING = 4; - */ - const CREATING = 4; - /** - * The cluster is being deleted. - * - * Generated from protobuf enum DELETING = 5; - */ - const DELETING = 5; - /** - * The creation of the cluster failed. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * The cluster is bootstrapping with data from some other source. - * Direct mutations to the cluster (e.g. adding read pool) are not allowed. - * - * Generated from protobuf enum BOOTSTRAPPING = 7; - */ - const BOOTSTRAPPING = 7; - /** - * The cluster is under maintenance. AlloyDB regularly performs maintenance - * and upgrades on customer clusters. Updates on the cluster are - * not allowed while the cluster is in this state. - * - * Generated from protobuf enum MAINTENANCE = 8; - */ - const MAINTENANCE = 8; - /** - * The cluster is being promoted. - * - * Generated from protobuf enum PROMOTING = 9; - */ - const PROMOTING = 9; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::STOPPED => 'STOPPED', - self::PBEMPTY => 'EMPTY', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::BOOTSTRAPPING => 'BOOTSTRAPPING', - self::MAINTENANCE => 'MAINTENANCE', - self::PROMOTING => 'PROMOTING', - ]; - - 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)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\AlloyDb\V1\Cluster_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php deleted file mode 100644 index 684db46d2c34..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ClusterView.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.alloydb.v1.ClusterView - */ -class ClusterView -{ - /** - * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - * - * Generated from protobuf enum CLUSTER_VIEW_UNSPECIFIED = 0; - */ - const CLUSTER_VIEW_UNSPECIFIED = 0; - /** - * BASIC server responses include all the relevant cluster details, excluding - * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific - * fields. The default value. - * - * Generated from protobuf enum CLUSTER_VIEW_BASIC = 1; - */ - const CLUSTER_VIEW_BASIC = 1; - /** - * CONTINUOUS_BACKUP response returns all the fields from BASIC plus - * the earliest restorable time if continuous backups are enabled. - * May increase latency. - * - * Generated from protobuf enum CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; - */ - const CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; - - private static $valueToName = [ - self::CLUSTER_VIEW_UNSPECIFIED => 'CLUSTER_VIEW_UNSPECIFIED', - self::CLUSTER_VIEW_BASIC => 'CLUSTER_VIEW_BASIC', - self::CLUSTER_VIEW_CONTINUOUS_BACKUP => 'CLUSTER_VIEW_CONTINUOUS_BACKUP', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php deleted file mode 100644 index 6232de3da334..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ConnectionInfo.php +++ /dev/null @@ -1,152 +0,0 @@ -google.cloud.alloydb.v1.ConnectionInfo - */ -class ConnectionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $ip_address = ''; - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $instance_uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * @type string $ip_address - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * @type string $instance_uid - * Output only. The unique ID of the Instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getInstanceUid() - { - return $this->instance_uid; - } - - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setInstanceUid($var) - { - GPBUtil::checkString($var, True); - $this->instance_uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php deleted file mode 100644 index 6225028820f1..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupConfig.php +++ /dev/null @@ -1,176 +0,0 @@ -google.cloud.alloydb.v1.ContinuousBackupConfig - */ -class ContinuousBackupConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - */ - protected $enabled = null; - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - */ - protected $recovery_window_days = 0; - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; - */ - protected $encryption_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enabled - * Whether ContinuousBackup is enabled. - * @type int $recovery_window_days - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * @type \Google\Cloud\AlloyDb\V1\EncryptionConfig $encryption_config - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - * @return bool - */ - public function getEnabled() - { - return isset($this->enabled) ? $this->enabled : false; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - * @return int - */ - public function getRecoveryWindowDays() - { - return $this->recovery_window_days; - } - - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - * @param int $var - * @return $this - */ - public function setRecoveryWindowDays($var) - { - GPBUtil::checkInt32($var); - $this->recovery_window_days = $var; - - return $this; - } - - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; - * @return \Google\Cloud\AlloyDb\V1\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; - * @param \Google\Cloud\AlloyDb\V1\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php deleted file mode 100644 index e6d7f95fb61e..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupInfo.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.alloydb.v1.ContinuousBackupInfo - */ -class ContinuousBackupInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $enabled_time = null; - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $schedule; - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $earliest_restorable_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1\EncryptionInfo $encryption_info - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * @type \Google\Protobuf\Timestamp $enabled_time - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * @type array|\Google\Protobuf\Internal\RepeatedField $schedule - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * @type \Google\Protobuf\Timestamp $earliest_restorable_time - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEnabledTime() - { - return $this->enabled_time; - } - - public function hasEnabledTime() - { - return isset($this->enabled_time); - } - - public function clearEnabledTime() - { - unset($this->enabled_time); - } - - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEnabledTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->enabled_time = $var; - - return $this; - } - - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSchedule() - { - return $this->schedule; - } - - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSchedule($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); - $this->schedule = $arr; - - return $this; - } - - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEarliestRestorableTime() - { - return $this->earliest_restorable_time; - } - - public function hasEarliestRestorableTime() - { - return isset($this->earliest_restorable_time); - } - - public function clearEarliestRestorableTime() - { - unset($this->earliest_restorable_time); - } - - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEarliestRestorableTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->earliest_restorable_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php deleted file mode 100644 index 7764ab3e5697..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ContinuousBackupSource.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.alloydb.v1.ContinuousBackupSource - */ -class ContinuousBackupSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = ''; - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $point_in_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cluster - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * @type \Google\Protobuf\Timestamp $point_in_time - * Required. The point in time to restore to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCluster() - { - return $this->cluster; - } - - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkString($var, True); - $this->cluster = $var; - - return $this; - } - - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPointInTime() - { - return $this->point_in_time; - } - - public function hasPointInTime() - { - return isset($this->point_in_time); - } - - public function clearPointInTime() - { - unset($this->point_in_time); - } - - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPointInTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->point_in_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php deleted file mode 100644 index 8311f1385500..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateBackupRequest.php +++ /dev/null @@ -1,275 +0,0 @@ -google.cloud.alloydb.v1.CreateBackupRequest - */ -class CreateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Value for parent. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup = 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. Value for parent. Please see - * {@see AlloyDBAdminClient::locationName()} for help formatting this field. - * @param \Google\Cloud\AlloyDb\V1\Backup $backup Required. The resource being created - * @param string $backupId Required. ID of the requesting object. - * - * @return \Google\Cloud\AlloyDb\V1\CreateBackupRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Backup $backup, string $backupId): self - { - return (new self()) - ->setParent($parent) - ->setBackup($backup) - ->setBackupId($backupId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Value for parent. - * @type string $backup_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1\Backup $backup - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Value for parent. - * - * 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. Value for parent. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBackupId() - { - return $this->backup_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBackupId($var) - { - GPBUtil::checkString($var, True); - $this->backup_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Backup::class); - $this->backup = $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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php deleted file mode 100644 index 7904fcc3a9a4..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateClusterRequest.php +++ /dev/null @@ -1,284 +0,0 @@ -google.cloud.alloydb.v1.CreateClusterRequest - */ -class CreateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. Please see - * {@see AlloyDBAdminClient::locationName()} for help formatting this field. - * @param \Google\Cloud\AlloyDb\V1\Cluster $cluster Required. The resource being created - * @param string $clusterId Required. ID of the requesting object. - * - * @return \Google\Cloud\AlloyDb\V1\CreateClusterRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Cluster $cluster, string $clusterId): self - { - return (new self()) - ->setParent($parent) - ->setCluster($cluster) - ->setClusterId($clusterId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * 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 location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); - $this->cluster = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php deleted file mode 100644 index 8da4cc57bd3d..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequest.php +++ /dev/null @@ -1,284 +0,0 @@ -google.cloud.alloydb.v1.CreateInstanceRequest - */ -class CreateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Please see - * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * @param \Google\Cloud\AlloyDb\V1\Instance $instance Required. The resource being created - * @param string $instanceId Required. ID of the requesting object. - * - * @return \Google\Cloud\AlloyDb\V1\CreateInstanceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Instance $instance, string $instanceId): self - { - return (new self()) - ->setParent($parent) - ->setInstance($instance) - ->setInstanceId($instanceId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @type string $instance_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1\Instance $instance - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance::class); - $this->instance = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php deleted file mode 100644 index e98a40af9368..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateInstanceRequests.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1.CreateInstanceRequests - */ -class CreateInstanceRequests extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $create_instance_requests; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $create_instance_requests - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCreateInstanceRequests() - { - return $this->create_instance_requests; - } - - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\AlloyDb\V1\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCreateInstanceRequests($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\CreateInstanceRequest::class); - $this->create_instance_requests = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php deleted file mode 100644 index 11b2c6c2e1ec..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryClusterRequest.php +++ /dev/null @@ -1,282 +0,0 @@ -google.cloud.alloydb.v1.CreateSecondaryClusterRequest - */ -class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. Please see - * {@see AlloyDBAdminClient::locationName()} for help formatting this field. - * @param \Google\Cloud\AlloyDb\V1\Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). - * @param string $clusterId Required. ID of the requesting object (the secondary cluster). - * - * @return \Google\Cloud\AlloyDb\V1\CreateSecondaryClusterRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Cluster $cluster, string $clusterId): self - { - return (new self()) - ->setParent($parent) - ->setCluster($cluster) - ->setClusterId($clusterId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object (the secondary cluster). - * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster - * Required. Configuration of the requesting object (the secondary cluster). - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * 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 location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * 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. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); - $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php deleted file mode 100644 index a7f3586d36a0..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateSecondaryInstanceRequest.php +++ /dev/null @@ -1,284 +0,0 @@ -google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - */ -class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Please see - * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * @param \Google\Cloud\AlloyDb\V1\Instance $instance Required. The resource being created - * @param string $instanceId Required. ID of the requesting object. - * - * @return \Google\Cloud\AlloyDb\V1\CreateSecondaryInstanceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Instance $instance, string $instanceId): self - { - return (new self()) - ->setParent($parent) - ->setInstance($instance) - ->setInstanceId($instanceId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @type string $instance_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1\Instance $instance - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance::class); - $this->instance = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php deleted file mode 100644 index 3fe9ac1ec46b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/CreateUserRequest.php +++ /dev/null @@ -1,275 +0,0 @@ -google.cloud.alloydb.v1.CreateUserRequest - */ -class CreateUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Value for parent. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user = 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $parent Required. Value for parent. Please see - * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * @param \Google\Cloud\AlloyDb\V1\User $user Required. The resource being created - * @param string $userId Required. ID of the requesting object. - * - * @return \Google\Cloud\AlloyDb\V1\CreateUserRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\AlloyDb\V1\User $user, string $userId): self - { - return (new self()) - ->setParent($parent) - ->setUser($user) - ->setUserId($userId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Value for parent. - * @type string $user_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1\User $user - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Value for parent. - * - * 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. Value for parent. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUserId() - { - return $this->user_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUserId($var) - { - GPBUtil::checkString($var, True); - $this->user_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\User|null - */ - public function getUser() - { - return $this->user; - } - - public function hasUser() - { - return isset($this->user); - } - - public function clearUser() - { - unset($this->user); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\User $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\User::class); - $this->user = $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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php deleted file mode 100644 index 43b351f9d5d9..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DatabaseVersion.php +++ /dev/null @@ -1,61 +0,0 @@ -google.cloud.alloydb.v1.DatabaseVersion - */ -class DatabaseVersion -{ - /** - * This is an unknown database version. - * - * Generated from protobuf enum DATABASE_VERSION_UNSPECIFIED = 0; - */ - const DATABASE_VERSION_UNSPECIFIED = 0; - /** - * DEPRECATED - The database version is Postgres 13. - * - * Generated from protobuf enum POSTGRES_13 = 1 [deprecated = true]; - */ - const POSTGRES_13 = 1; - /** - * The database version is Postgres 14. - * - * Generated from protobuf enum POSTGRES_14 = 2; - */ - const POSTGRES_14 = 2; - - private static $valueToName = [ - self::DATABASE_VERSION_UNSPECIFIED => 'DATABASE_VERSION_UNSPECIFIED', - self::POSTGRES_13 => 'POSTGRES_13', - self::POSTGRES_14 => 'POSTGRES_14', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php deleted file mode 100644 index 8b9db4c24a07..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteBackupRequest.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.alloydb.v1.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * - * 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * @param string $name Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. Please see - * {@see AlloyDBAdminClient::backupName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\DeleteBackupRequest - * - * @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. For the required format, see the comment on - * the Backup.name field. - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type string $etag - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * - * 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. For the required format, see the comment on - * the Backup.name field. - * - * 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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php deleted file mode 100644 index 89e72f18c978..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteClusterRequest.php +++ /dev/null @@ -1,274 +0,0 @@ -google.cloud.alloydb.v1.DeleteClusterRequest - */ -class DeleteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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 = ''; - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $force = false; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. Please see - * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\DeleteClusterRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @type bool $force - * Optional. Whether to cascade delete child instances for given cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php deleted file mode 100644 index 8e177fbb3777..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteInstanceRequest.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.alloydb.v1.DeleteInstanceRequest - */ -class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. Please see - * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\DeleteInstanceRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type string $etag - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php deleted file mode 100644 index 05a7ca8e1900..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/DeleteUserRequest.php +++ /dev/null @@ -1,198 +0,0 @@ -google.cloud.alloydb.v1.DeleteUserRequest - */ -class DeleteUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. Please see - * {@see AlloyDBAdminClient::userName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\DeleteUserRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the User.name field. - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php deleted file mode 100644 index 20ebb1d0926b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionConfig.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1.EncryptionConfig - */ -class EncryptionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - */ - protected $kms_key_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key_name - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php deleted file mode 100644 index c37bade4f198..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1.EncryptionInfo - */ -class EncryptionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_type = 0; - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $kms_key_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $encryption_type - * Output only. Type of encryption. - * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_versions - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getEncryptionType() - { - return $this->encryption_type; - } - - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setEncryptionType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\EncryptionInfo\Type::class); - $this->encryption_type = $var; - - return $this; - } - - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKmsKeyVersions() - { - return $this->kms_key_versions; - } - - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKmsKeyVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->kms_key_versions = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php deleted file mode 100644 index 2c074173d915..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/EncryptionInfo/Type.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.alloydb.v1.EncryptionInfo.Type - */ -class Type -{ - /** - * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * The data is encrypted at rest with a key that is fully managed by Google. - * No key version will be populated. This is the default state. - * - * Generated from protobuf enum GOOGLE_DEFAULT_ENCRYPTION = 1; - */ - const GOOGLE_DEFAULT_ENCRYPTION = 1; - /** - * The data is encrypted at rest with a key that is managed by the customer. - * KMS key versions will be populated. - * - * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 2; - */ - const CUSTOMER_MANAGED_ENCRYPTION = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::GOOGLE_DEFAULT_ENCRYPTION => 'GOOGLE_DEFAULT_ENCRYPTION', - self::CUSTOMER_MANAGED_ENCRYPTION => 'CUSTOMER_MANAGED_ENCRYPTION', - ]; - - 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(Type::class, \Google\Cloud\AlloyDb\V1\EncryptionInfo_Type::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php deleted file mode 100644 index 385f6cee2600..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/FailoverInstanceRequest.php +++ /dev/null @@ -1,198 +0,0 @@ -google.cloud.alloydb.v1.FailoverInstanceRequest - */ -class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. Please see - * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\FailoverInstanceRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php deleted file mode 100644 index a66f9ccd2a1a..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateRequest.php +++ /dev/null @@ -1,297 +0,0 @@ -google.cloud.alloydb.v1.GenerateClientCertificateRequest - */ -class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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 = ''; - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $cert_duration = null; - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $public_key = ''; - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $use_metadata_exchange = false; - - /** - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\GenerateClientCertificateRequest - * - * @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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @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). - * @type \Google\Protobuf\Duration $cert_duration - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * @type string $public_key - * Optional. The public key from the client. - * @type bool $use_metadata_exchange - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * 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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * 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. 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; - } - - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getCertDuration() - { - return $this->cert_duration; - } - - public function hasCertDuration() - { - return isset($this->cert_duration); - } - - public function clearCertDuration() - { - unset($this->cert_duration); - } - - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setCertDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->cert_duration = $var; - - return $this; - } - - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPublicKey() - { - return $this->public_key; - } - - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPublicKey($var) - { - GPBUtil::checkString($var, True); - $this->public_key = $var; - - return $this; - } - - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUseMetadataExchange() - { - return $this->use_metadata_exchange; - } - - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUseMetadataExchange($var) - { - GPBUtil::checkBool($var); - $this->use_metadata_exchange = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php deleted file mode 100644 index b2917171c894..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GenerateClientCertificateResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1.GenerateClientCertificateResponse - */ -class GenerateClientCertificateResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $pem_certificate_chain; - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ca_cert = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * @type string $ca_cert - * Optional. The pem-encoded cluster ca X.509 certificate. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPemCertificateChain() - { - return $this->pem_certificate_chain; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPemCertificateChain($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->pem_certificate_chain = $arr; - - return $this; - } - - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCaCert() - { - return $this->ca_cert; - } - - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCaCert($var) - { - GPBUtil::checkString($var, True); - $this->ca_cert = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php deleted file mode 100644 index 7a24badd0c55..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetBackupRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.alloydb.v1.GetBackupRequest - */ -class GetBackupRequest 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 = ''; - - /** - * @param string $name Required. Name of the resource - * Please see {@see AlloyDBAdminClient::backupName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\GetBackupRequest - * - * @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 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::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; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php deleted file mode 100644 index 5f78a0d47d32..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetClusterRequest.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.alloydb.v1.GetClusterRequest - */ -class GetClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. Please see - * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\GetClusterRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @type int $view - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\ClusterView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php deleted file mode 100644 index e62b821f8334..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetConnectionInfoRequest.php +++ /dev/null @@ -1,160 +0,0 @@ -google.cloud.alloydb.v1.GetConnectionInfoRequest - */ -class GetConnectionInfoRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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 $parent Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * Please see {@see AlloyDBAdminClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\GetConnectionInfoRequest - * - * @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 name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * 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 name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * 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. 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php deleted file mode 100644 index 3bcba9f5011c..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetInstanceRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.alloydb.v1.GetInstanceRequest - */ -class GetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1.InstanceView view = 2; - */ - protected $view = 0; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. Please see - * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\GetInstanceRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @type int $view - * The view of the instance to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1.InstanceView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1.InstanceView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\InstanceView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php deleted file mode 100644 index 64a3c00cc2c8..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/GetUserRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.alloydb.v1.GetUserRequest - */ -class GetUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. Please see - * {@see AlloyDBAdminClient::userName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\GetUserRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the User.name field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php deleted file mode 100644 index 223a6851d23d..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest.php +++ /dev/null @@ -1,239 +0,0 @@ -google.cloud.alloydb.v1.InjectFaultRequest - */ -class InjectFaultRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $fault_type = 0; - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param int $faultType Required. The type of fault to be injected in an instance. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\InjectFaultRequest\FaultType} - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. Please see - * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\InjectFaultRequest - * - * @experimental - */ - public static function build(int $faultType, string $name): self - { - return (new self()) - ->setFaultType($faultType) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $fault_type - * Required. The type of fault to be injected in an instance. - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getFaultType() - { - return $this->fault_type; - } - - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setFaultType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\InjectFaultRequest\FaultType::class); - $this->fault_type = $var; - - return $this; - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php deleted file mode 100644 index ecb8d20a8d57..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InjectFaultRequest/FaultType.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.alloydb.v1.InjectFaultRequest.FaultType - */ -class FaultType -{ - /** - * The fault type is unknown. - * - * Generated from protobuf enum FAULT_TYPE_UNSPECIFIED = 0; - */ - const FAULT_TYPE_UNSPECIFIED = 0; - /** - * Stop the VM - * - * Generated from protobuf enum STOP_VM = 1; - */ - const STOP_VM = 1; - - private static $valueToName = [ - self::FAULT_TYPE_UNSPECIFIED => 'FAULT_TYPE_UNSPECIFIED', - self::STOP_VM => 'STOP_VM', - ]; - - 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(FaultType::class, \Google\Cloud\AlloyDb\V1\InjectFaultRequest_FaultType::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php deleted file mode 100644 index 8a5e4930c841..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance.php +++ /dev/null @@ -1,1026 +0,0 @@ -google.cloud.alloydb.v1.Instance - */ -class Instance extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - /** - * Output only. The current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_type = 0; - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; - */ - protected $machine_config = null; - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; - */ - protected $availability_type = 0; - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - */ - protected $gce_zone = ''; - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - */ - private $database_flags; - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $writable_node = null; - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $nodes; - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - */ - protected $query_insights_config = null; - /** - * Read pool instance configuration. - * This is required if the value of instanceType is READ_POOL. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; - */ - protected $read_pool_config = null; - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $ip_address = ''; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - */ - private $annotations; - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $client_connection_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * @type string $display_name - * User-settable and human-readable display name for the Instance. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current serving state of the instance. - * @type int $instance_type - * Required. The type of the instance. Specified at creation time. - * @type \Google\Cloud\AlloyDb\V1\Instance\MachineConfig $machine_config - * Configurations for the machines that host the underlying - * database engine. - * @type int $availability_type - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * @type string $gce_zone - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * @type array|\Google\Protobuf\Internal\MapField $database_flags - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * @type \Google\Cloud\AlloyDb\V1\Instance\Node $writable_node - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * @type array<\Google\Cloud\AlloyDb\V1\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $nodes - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * @type \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig $query_insights_config - * Configuration for query insights. - * @type \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig $read_pool_config - * Read pool instance configuration. - * This is required if the value of instanceType is READ_POOL. - * @type string $ip_address - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig $client_connection_config - * Optional. Client connection specific configurations - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @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 current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\State::class); - $this->state = $var; - - return $this; - } - - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getInstanceType() - { - return $this->instance_type; - } - - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setInstanceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\InstanceType::class); - $this->instance_type = $var; - - return $this; - } - - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; - * @return \Google\Cloud\AlloyDb\V1\Instance\MachineConfig|null - */ - public function getMachineConfig() - { - return $this->machine_config; - } - - public function hasMachineConfig() - { - return isset($this->machine_config); - } - - public function clearMachineConfig() - { - unset($this->machine_config); - } - - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.MachineConfig machine_config = 10; - * @param \Google\Cloud\AlloyDb\V1\Instance\MachineConfig $var - * @return $this - */ - public function setMachineConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\MachineConfig::class); - $this->machine_config = $var; - - return $this; - } - - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; - * @return int - */ - public function getAvailabilityType() - { - return $this->availability_type; - } - - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; - * @param int $var - * @return $this - */ - public function setAvailabilityType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\Instance\AvailabilityType::class); - $this->availability_type = $var; - - return $this; - } - - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - * @return string - */ - public function getGceZone() - { - return $this->gce_zone; - } - - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - * @param string $var - * @return $this - */ - public function setGceZone($var) - { - GPBUtil::checkString($var, True); - $this->gce_zone = $var; - - return $this; - } - - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDatabaseFlags() - { - return $this->database_flags; - } - - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDatabaseFlags($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->database_flags = $arr; - - return $this; - } - - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\Instance\Node|null - */ - public function getWritableNode() - { - return $this->writable_node; - } - - public function hasWritableNode() - { - return isset($this->writable_node); - } - - public function clearWritableNode() - { - unset($this->writable_node); - } - - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\Instance\Node $var - * @return $this - */ - public function setWritableNode($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\Node::class); - $this->writable_node = $var; - - return $this; - } - - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNodes() - { - return $this->nodes; - } - - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\AlloyDb\V1\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Instance\Node::class); - $this->nodes = $arr; - - return $this; - } - - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - * @return \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig|null - */ - public function getQueryInsightsConfig() - { - return $this->query_insights_config; - } - - public function hasQueryInsightsConfig() - { - return isset($this->query_insights_config); - } - - public function clearQueryInsightsConfig() - { - unset($this->query_insights_config); - } - - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - * @param \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig $var - * @return $this - */ - public function setQueryInsightsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\QueryInsightsInstanceConfig::class); - $this->query_insights_config = $var; - - return $this; - } - - /** - * Read pool instance configuration. - * This is required if the value of instanceType is READ_POOL. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; - * @return \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig|null - */ - public function getReadPoolConfig() - { - return $this->read_pool_config; - } - - public function hasReadPoolConfig() - { - return isset($this->read_pool_config); - } - - public function clearReadPoolConfig() - { - unset($this->read_pool_config); - } - - /** - * Read pool instance configuration. - * This is required if the value of instanceType is READ_POOL. - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ReadPoolConfig read_pool_config = 14; - * @param \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig $var - * @return $this - */ - public function setReadPoolConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\ReadPoolConfig::class); - $this->read_pool_config = $var; - - return $this; - } - - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig|null - */ - public function getClientConnectionConfig() - { - return $this->client_connection_config; - } - - public function hasClientConnectionConfig() - { - return isset($this->client_connection_config); - } - - public function clearClientConnectionConfig() - { - unset($this->client_connection_config); - } - - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig $var - * @return $this - */ - public function setClientConnectionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig::class); - $this->client_connection_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php deleted file mode 100644 index 22736beb9ab1..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/AvailabilityType.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.alloydb.v1.Instance.AvailabilityType - */ -class AvailabilityType -{ - /** - * This is an unknown Availability type. - * - * Generated from protobuf enum AVAILABILITY_TYPE_UNSPECIFIED = 0; - */ - const AVAILABILITY_TYPE_UNSPECIFIED = 0; - /** - * Zonal available instance. - * - * Generated from protobuf enum ZONAL = 1; - */ - const ZONAL = 1; - /** - * Regional (or Highly) available instance. - * - * Generated from protobuf enum REGIONAL = 2; - */ - const REGIONAL = 2; - - private static $valueToName = [ - self::AVAILABILITY_TYPE_UNSPECIFIED => 'AVAILABILITY_TYPE_UNSPECIFIED', - self::ZONAL => 'ZONAL', - self::REGIONAL => 'REGIONAL', - ]; - - 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(AvailabilityType::class, \Google\Cloud\AlloyDb\V1\Instance_AvailabilityType::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php deleted file mode 100644 index 026a528e0756..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ClientConnectionConfig.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.alloydb.v1.Instance.ClientConnectionConfig - */ -class ClientConnectionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $require_connectors = false; - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ssl_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $require_connectors - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * @type \Google\Cloud\AlloyDb\V1\SslConfig $ssl_config - * Optional. SSL config option for this instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getRequireConnectors() - { - return $this->require_connectors; - } - - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setRequireConnectors($var) - { - GPBUtil::checkBool($var); - $this->require_connectors = $var; - - return $this; - } - - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1\SslConfig|null - */ - public function getSslConfig() - { - return $this->ssl_config; - } - - public function hasSslConfig() - { - return isset($this->ssl_config); - } - - public function clearSslConfig() - { - unset($this->ssl_config); - } - - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1\SslConfig $var - * @return $this - */ - public function setSslConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SslConfig::class); - $this->ssl_config = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ClientConnectionConfig::class, \Google\Cloud\AlloyDb\V1\Instance_ClientConnectionConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php deleted file mode 100644 index 7472c57582ab..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/InstanceType.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1.Instance.InstanceType - */ -class InstanceType -{ - /** - * The type of the instance is unknown. - * - * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; - */ - const INSTANCE_TYPE_UNSPECIFIED = 0; - /** - * PRIMARY instances support read and write operations. - * - * Generated from protobuf enum PRIMARY = 1; - */ - const PRIMARY = 1; - /** - * READ POOL instances support read operations only. Each read pool instance - * consists of one or more homogeneous nodes. - * * Read pool of size 1 can only have zonal availability. - * * Read pools with node count of 2 or more can have regional - * availability (nodes are present in 2 or more zones in a region). - * - * Generated from protobuf enum READ_POOL = 2; - */ - const READ_POOL = 2; - /** - * SECONDARY instances support read operations only. SECONDARY instance - * is a cross-region read replica - * - * Generated from protobuf enum SECONDARY = 3; - */ - const SECONDARY = 3; - - private static $valueToName = [ - self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', - self::PRIMARY => 'PRIMARY', - self::READ_POOL => 'READ_POOL', - self::SECONDARY => 'SECONDARY', - ]; - - 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\AlloyDb\V1\Instance_InstanceType::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php deleted file mode 100644 index e3be82345b58..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/MachineConfig.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1.Instance.MachineConfig - */ -class MachineConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - */ - protected $cpu_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $cpu_count - * The number of CPU's in the VM instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - * @return int - */ - public function getCpuCount() - { - return $this->cpu_count; - } - - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - * @param int $var - * @return $this - */ - public function setCpuCount($var) - { - GPBUtil::checkInt32($var); - $this->cpu_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MachineConfig::class, \Google\Cloud\AlloyDb\V1\Instance_MachineConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php deleted file mode 100644 index d7adf74942a2..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/Node.php +++ /dev/null @@ -1,186 +0,0 @@ -google.cloud.alloydb.v1.Instance.Node - */ -class Node extends \Google\Protobuf\Internal\Message -{ - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - */ - protected $zone_id = ''; - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - */ - protected $id = ''; - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - */ - protected $ip = ''; - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - */ - protected $state = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $zone_id - * The Compute Engine zone of the VM e.g. "us-central1-b". - * @type string $id - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * @type string $ip - * The private IP address of the VM e.g. "10.57.0.34". - * @type string $state - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - * @return string - */ - public function getZoneId() - { - return $this->zone_id; - } - - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - * @param string $var - * @return $this - */ - public function setZoneId($var) - { - GPBUtil::checkString($var, True); - $this->zone_id = $var; - - return $this; - } - - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - * @return string - */ - public function getIp() - { - return $this->ip; - } - - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - * @param string $var - * @return $this - */ - public function setIp($var) - { - GPBUtil::checkString($var, True); - $this->ip = $var; - - return $this; - } - - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - * @param string $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkString($var, True); - $this->state = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Node::class, \Google\Cloud\AlloyDb\V1\Instance_Node::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php deleted file mode 100644 index 7433b3806a61..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/QueryInsightsInstanceConfig.php +++ /dev/null @@ -1,222 +0,0 @@ -google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - */ -class QueryInsightsInstanceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - */ - protected $record_application_tags = null; - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - */ - protected $record_client_address = null; - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - */ - protected $query_string_length = 0; - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - */ - protected $query_plans_per_minute = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $record_application_tags - * Record application tags for an instance. - * This flag is turned "on" by default. - * @type bool $record_client_address - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * @type int $query_string_length - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * @type int $query_plans_per_minute - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - * @return bool - */ - public function getRecordApplicationTags() - { - return isset($this->record_application_tags) ? $this->record_application_tags : false; - } - - public function hasRecordApplicationTags() - { - return isset($this->record_application_tags); - } - - public function clearRecordApplicationTags() - { - unset($this->record_application_tags); - } - - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - * @param bool $var - * @return $this - */ - public function setRecordApplicationTags($var) - { - GPBUtil::checkBool($var); - $this->record_application_tags = $var; - - return $this; - } - - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - * @return bool - */ - public function getRecordClientAddress() - { - return isset($this->record_client_address) ? $this->record_client_address : false; - } - - public function hasRecordClientAddress() - { - return isset($this->record_client_address); - } - - public function clearRecordClientAddress() - { - unset($this->record_client_address); - } - - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - * @param bool $var - * @return $this - */ - public function setRecordClientAddress($var) - { - GPBUtil::checkBool($var); - $this->record_client_address = $var; - - return $this; - } - - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - * @return int - */ - public function getQueryStringLength() - { - return $this->query_string_length; - } - - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - * @param int $var - * @return $this - */ - public function setQueryStringLength($var) - { - GPBUtil::checkUint32($var); - $this->query_string_length = $var; - - return $this; - } - - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - * @return int - */ - public function getQueryPlansPerMinute() - { - return isset($this->query_plans_per_minute) ? $this->query_plans_per_minute : 0; - } - - public function hasQueryPlansPerMinute() - { - return isset($this->query_plans_per_minute); - } - - public function clearQueryPlansPerMinute() - { - unset($this->query_plans_per_minute); - } - - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - * @param int $var - * @return $this - */ - public function setQueryPlansPerMinute($var) - { - GPBUtil::checkUint32($var); - $this->query_plans_per_minute = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryInsightsInstanceConfig::class, \Google\Cloud\AlloyDb\V1\Instance_QueryInsightsInstanceConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php deleted file mode 100644 index 87145209ae94..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/ReadPoolConfig.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1.Instance.ReadPoolConfig - */ -class ReadPoolConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - */ - protected $node_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $node_count - * Read capacity, i.e. number of nodes in a read pool instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - * @return int - */ - public function getNodeCount() - { - return $this->node_count; - } - - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - * @param int $var - * @return $this - */ - public function setNodeCount($var) - { - GPBUtil::checkInt32($var); - $this->node_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReadPoolConfig::class, \Google\Cloud\AlloyDb\V1\Instance_ReadPoolConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php deleted file mode 100644 index 5caa9e194e76..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/Instance/State.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.alloydb.v1.Instance.State - */ -class State -{ - /** - * The state of the instance is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The instance is active and running. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The instance is stopped. Instance name and IP resources are preserved. - * - * Generated from protobuf enum STOPPED = 2; - */ - const STOPPED = 2; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 3; - */ - const CREATING = 3; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The instance is down for maintenance. - * - * Generated from protobuf enum MAINTENANCE = 5; - */ - const MAINTENANCE = 5; - /** - * The creation of the instance failed or a fatal error occurred during - * an operation on the instance. - * Note: Instances in this state would tried to be auto-repaired. And - * Customers should be able to restart, update or delete these instances. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that - * index unused in case that state also needs to exposed via consumer apis - * in future. - * The instance has been configured to sync data from some other source. - * - * Generated from protobuf enum BOOTSTRAPPING = 8; - */ - const BOOTSTRAPPING = 8; - /** - * The instance is being promoted. - * - * Generated from protobuf enum PROMOTING = 9; - */ - const PROMOTING = 9; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::STOPPED => 'STOPPED', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::MAINTENANCE => 'MAINTENANCE', - self::FAILED => 'FAILED', - self::BOOTSTRAPPING => 'BOOTSTRAPPING', - self::PROMOTING => 'PROMOTING', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1\Instance_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php deleted file mode 100644 index fca8fc5f03aa..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/InstanceView.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1.InstanceView - */ -class InstanceView -{ - /** - * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - * - * Generated from protobuf enum INSTANCE_VIEW_UNSPECIFIED = 0; - */ - const INSTANCE_VIEW_UNSPECIFIED = 0; - /** - * BASIC server responses for a primary or read instance include all the - * relevant instance details, excluding the details of each node in the - * instance. The default value. - * - * Generated from protobuf enum INSTANCE_VIEW_BASIC = 1; - */ - const INSTANCE_VIEW_BASIC = 1; - /** - * FULL response is equivalent to BASIC for primary instance (for now). - * For read pool instance, this includes details of each node in the pool. - * - * Generated from protobuf enum INSTANCE_VIEW_FULL = 2; - */ - const INSTANCE_VIEW_FULL = 2; - - private static $valueToName = [ - self::INSTANCE_VIEW_UNSPECIFIED => 'INSTANCE_VIEW_UNSPECIFIED', - self::INSTANCE_VIEW_BASIC => 'INSTANCE_VIEW_BASIC', - self::INSTANCE_VIEW_FULL => 'INSTANCE_VIEW_FULL', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php deleted file mode 100644 index b1de4aa3797f..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.alloydb.v1.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value for ListBackupsRequest - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. Parent value for ListBackupsRequest - * Please see {@see AlloyDBAdminClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\ListBackupsRequest - * - * @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. Parent value for ListBackupsRequest - * @type int $page_size - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. - * @type string $filter - * Filtering results - * @type string $order_by - * Hint for how to order the results - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value for ListBackupsRequest - * - * 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. Parent value for ListBackupsRequest - * - * 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; - } - - /** - * 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; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * 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; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - * @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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php deleted file mode 100644 index 0b0021d014b6..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListBackupsResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Backup backups = 1; - */ - private $backups; - /** - * 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\AlloyDb\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * The list of Backup - * @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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Backup backups = 1; - * @param array<\Google\Cloud\AlloyDb\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Backup::class); - $this->backups = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php deleted file mode 100644 index d44fb3bfbc6f..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersRequest.php +++ /dev/null @@ -1,236 +0,0 @@ -google.cloud.alloydb.v1.ListClustersRequest - */ -class ListClustersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. Filtering results - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * Please see {@see AlloyDBAdminClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\ListClustersRequest - * - * @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 name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * @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 - * 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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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 name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php deleted file mode 100644 index 8c9c3ba6454c..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListClustersResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1.ListClustersResponse - */ -class ListClustersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Cluster clusters = 1; - */ - private $clusters; - /** - * 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\AlloyDb\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters - * The list of Cluster - * @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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Cluster clusters = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getClusters() - { - return $this->clusters; - } - - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Cluster clusters = 1; - * @param array<\Google\Cloud\AlloyDb\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setClusters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Cluster::class); - $this->clusters = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php deleted file mode 100644 index 4d82e38e6398..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesRequest.php +++ /dev/null @@ -1,246 +0,0 @@ -google.cloud.alloydb.v1.ListInstancesRequest - */ -class ListInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. Filtering results - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\ListInstancesRequest - * - * @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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * @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 - * 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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php deleted file mode 100644 index 2b869c67528b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListInstancesResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1.ListInstancesResponse - */ -class ListInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; - */ - private $instances; - /** - * 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\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * The list of Instance - * @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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance instances = 1; - * @param array<\Google\Cloud\AlloyDb\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Instance::class); - $this->instances = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php deleted file mode 100644 index ad53e79fae82..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsRequest.php +++ /dev/null @@ -1,179 +0,0 @@ -google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - */ -class ListSupportedDatabaseFlagsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. Please see - * {@see AlloyDBAdminClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\ListSupportedDatabaseFlagsRequest - * - * @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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * @type int $page_size - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * 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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * 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; - } - - /** - * 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; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * 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; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php deleted file mode 100644 index 8a74ded00784..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListSupportedDatabaseFlagsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - */ -class ListSupportedDatabaseFlagsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; - */ - private $supported_database_flags; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $supported_database_flags - * The list of SupportedDatabaseFlags. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedDatabaseFlags() - { - return $this->supported_database_flags; - } - - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.SupportedDatabaseFlag supported_database_flags = 1; - * @param array<\Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedDatabaseFlags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag::class); - $this->supported_database_flags = $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; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php deleted file mode 100644 index 209f6034b237..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.alloydb.v1.ListUsersRequest - */ -class ListUsersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value for ListUsersRequest - * - * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. Parent value for ListUsersRequest - * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\ListUsersRequest - * - * @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. Parent value for ListUsersRequest - * @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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value for ListUsersRequest - * - * 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. Parent value for ListUsersRequest - * - * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php deleted file mode 100644 index 54dd827d69ab..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/ListUsersResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1.ListUsersResponse - */ -class ListUsersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.User users = 1; - */ - private $users; - /** - * 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\AlloyDb\V1\User>|\Google\Protobuf\Internal\RepeatedField $users - * The list of User - * @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\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.User users = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUsers() - { - return $this->users; - } - - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.User users = 1; - * @param array<\Google\Cloud\AlloyDb\V1\User>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUsers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\User::class); - $this->users = $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/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php deleted file mode 100644 index d0af051a9d3b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource.php +++ /dev/null @@ -1,144 +0,0 @@ -google.cloud.alloydb.v1.MigrationSource - */ -class MigrationSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $host_port = ''; - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reference_id = ''; - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $source_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $host_port - * Output only. The host and port of the on-premises instance in host:port - * format - * @type string $reference_id - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * @type int $source_type - * Output only. Type of migration source. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getHostPort() - { - return $this->host_port; - } - - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setHostPort($var) - { - GPBUtil::checkString($var, True); - $this->host_port = $var; - - return $this; - } - - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReferenceId() - { - return $this->reference_id; - } - - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReferenceId($var) - { - GPBUtil::checkString($var, True); - $this->reference_id = $var; - - return $this; - } - - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getSourceType() - { - return $this->source_type; - } - - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setSourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\MigrationSource\MigrationSourceType::class); - $this->source_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php deleted file mode 100644 index 6cdf7fc32846..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/MigrationSource/MigrationSourceType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.alloydb.v1.MigrationSource.MigrationSourceType - */ -class MigrationSourceType -{ - /** - * Migration source is unknown. - * - * Generated from protobuf enum MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - */ - const MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - /** - * DMS source means the cluster was created via DMS migration job. - * - * Generated from protobuf enum DMS = 1; - */ - const DMS = 1; - - private static $valueToName = [ - self::MIGRATION_SOURCE_TYPE_UNSPECIFIED => 'MIGRATION_SOURCE_TYPE_UNSPECIFIED', - self::DMS => 'DMS', - ]; - - 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(MigrationSourceType::class, \Google\Cloud\AlloyDb\V1\MigrationSource_MigrationSourceType::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php deleted file mode 100644 index ab26ecdaeac8..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/OperationMetadata.php +++ /dev/null @@ -1,349 +0,0 @@ -google.cloud.alloydb.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 = ''; - protected $request_specific; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata $batch_create_instances_metadata - * Output only. BatchCreateInstances related metadata. - * @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. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Output only. BatchCreateInstances related metadata. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata|null - */ - public function getBatchCreateInstancesMetadata() - { - return $this->readOneof(8); - } - - public function hasBatchCreateInstancesMetadata() - { - return $this->hasOneof(8); - } - - /** - * Output only. BatchCreateInstances related metadata. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata $var - * @return $this - */ - public function setBatchCreateInstancesMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\BatchCreateInstancesMetadata::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * 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; - } - - /** - * @return string - */ - public function getRequestSpecific() - { - return $this->whichOneof("request_specific"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php deleted file mode 100644 index 94a00b7fb9d8..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/PromoteClusterRequest.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.alloydb.v1.PromoteClusterRequest - */ -class PromoteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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 = ''; - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\PromoteClusterRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php deleted file mode 100644 index d1c80af90179..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestartInstanceRequest.php +++ /dev/null @@ -1,196 +0,0 @@ -google.cloud.alloydb.v1.RestartInstanceRequest - */ -class RestartInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. Please see - * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. - * - * @return \Google\Cloud\AlloyDb\V1\RestartInstanceRequest - * - * @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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php deleted file mode 100644 index ce7a85bdb5ed..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/RestoreClusterRequest.php +++ /dev/null @@ -1,344 +0,0 @@ -google.cloud.alloydb.v1.RestoreClusterRequest - */ -class RestoreClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1\BackupSource $backup_source - * Backup source. - * @type \Google\Cloud\AlloyDb\V1\ContinuousBackupSource $continuous_backup_source - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Backup source. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 4; - * @return \Google\Cloud\AlloyDb\V1\BackupSource|null - */ - public function getBackupSource() - { - return $this->readOneof(4); - } - - public function hasBackupSource() - { - return $this->hasOneof(4); - } - - /** - * Backup source. - * - * Generated from protobuf field .google.cloud.alloydb.v1.BackupSource backup_source = 4; - * @param \Google\Cloud\AlloyDb\V1\BackupSource $var - * @return $this - */ - public function setBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\BackupSource::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; - * @return \Google\Cloud\AlloyDb\V1\ContinuousBackupSource|null - */ - public function getContinuousBackupSource() - { - return $this->readOneof(8); - } - - public function hasContinuousBackupSource() - { - return $this->hasOneof(8); - } - - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * - * Generated from protobuf field .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; - * @param \Google\Cloud\AlloyDb\V1\ContinuousBackupSource $var - * @return $this - */ - public function setContinuousBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\ContinuousBackupSource::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); - $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php deleted file mode 100644 index 4239158510f8..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1.SslConfig - */ -class SslConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ssl_mode = 0; - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ca_source = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $ssl_mode - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * @type int $ca_source - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSslMode() - { - return $this->ssl_mode; - } - - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSslMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\SslConfig\SslMode::class); - $this->ssl_mode = $var; - - return $this; - } - - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getCaSource() - { - return $this->ca_source; - } - - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setCaSource($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\SslConfig\CaSource::class); - $this->ca_source = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php deleted file mode 100644 index 63623e55baed..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/CaSource.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.alloydb.v1.SslConfig.CaSource - */ -class CaSource -{ - /** - * Certificate Authority (CA) source not specified. Defaults to - * CA_SOURCE_MANAGED. - * - * Generated from protobuf enum CA_SOURCE_UNSPECIFIED = 0; - */ - const CA_SOURCE_UNSPECIFIED = 0; - /** - * Certificate Authority (CA) managed by the AlloyDB Cluster. - * - * Generated from protobuf enum CA_SOURCE_MANAGED = 1; - */ - const CA_SOURCE_MANAGED = 1; - - private static $valueToName = [ - self::CA_SOURCE_UNSPECIFIED => 'CA_SOURCE_UNSPECIFIED', - self::CA_SOURCE_MANAGED => 'CA_SOURCE_MANAGED', - ]; - - 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(CaSource::class, \Google\Cloud\AlloyDb\V1\SslConfig_CaSource::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php deleted file mode 100644 index 9d823b215f44..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SslConfig/SslMode.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.alloydb.v1.SslConfig.SslMode - */ -class SslMode -{ - /** - * SSL mode not specified. Defaults to ENCRYPTED_ONLY. - * - * Generated from protobuf enum SSL_MODE_UNSPECIFIED = 0; - */ - const SSL_MODE_UNSPECIFIED = 0; - /** - * SSL connections are optional. CA verification not enforced. - * - * Generated from protobuf enum SSL_MODE_ALLOW = 1 [deprecated = true]; - */ - const SSL_MODE_ALLOW = 1; - /** - * SSL connections are required. CA verification not enforced. - * Clients may use locally self-signed certificates (default psql client - * behavior). - * - * Generated from protobuf enum SSL_MODE_REQUIRE = 2 [deprecated = true]; - */ - const SSL_MODE_REQUIRE = 2; - /** - * SSL connections are required. CA verification enforced. - * Clients must have certificates signed by a Cluster CA, e.g. via - * GenerateClientCertificate. - * - * Generated from protobuf enum SSL_MODE_VERIFY_CA = 3 [deprecated = true]; - */ - const SSL_MODE_VERIFY_CA = 3; - /** - * SSL connections are optional. CA verification not enforced. - * - * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - */ - const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - /** - * SSL connections are required. CA verification not enforced. - * - * Generated from protobuf enum ENCRYPTED_ONLY = 5; - */ - const ENCRYPTED_ONLY = 5; - - private static $valueToName = [ - self::SSL_MODE_UNSPECIFIED => 'SSL_MODE_UNSPECIFIED', - self::SSL_MODE_ALLOW => 'SSL_MODE_ALLOW', - self::SSL_MODE_REQUIRE => 'SSL_MODE_REQUIRE', - self::SSL_MODE_VERIFY_CA => 'SSL_MODE_VERIFY_CA', - self::ALLOW_UNENCRYPTED_AND_ENCRYPTED => 'ALLOW_UNENCRYPTED_AND_ENCRYPTED', - self::ENCRYPTED_ONLY => 'ENCRYPTED_ONLY', - ]; - - 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(SslMode::class, \Google\Cloud\AlloyDb\V1\SslConfig_SslMode::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php deleted file mode 100644 index 09d7ae652977..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag.php +++ /dev/null @@ -1,337 +0,0 @@ -google.cloud.alloydb.v1.SupportedDatabaseFlag - */ -class SupportedDatabaseFlag extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - */ - protected $flag_name = ''; - /** - * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; - */ - protected $value_type = 0; - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - */ - protected $accepts_multiple_values = false; - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; - */ - private $supported_db_versions; - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - */ - protected $requires_db_restart = false; - protected $restrictions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions $string_restrictions - * Restriction on STRING type value. - * @type \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions $integer_restrictions - * Restriction on INTEGER type value. - * @type string $name - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * @type string $flag_name - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * @type int $value_type - * @type bool $accepts_multiple_values - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * @type array|\Google\Protobuf\Internal\RepeatedField $supported_db_versions - * Major database engine versions for which this flag is supported. - * @type bool $requires_db_restart - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Restriction on STRING type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; - * @return \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions|null - */ - public function getStringRestrictions() - { - return $this->readOneof(7); - } - - public function hasStringRestrictions() - { - return $this->hasOneof(7); - } - - /** - * Restriction on STRING type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; - * @param \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions $var - * @return $this - */ - public function setStringRestrictions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\StringRestrictions::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Restriction on INTEGER type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; - * @return \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions|null - */ - public function getIntegerRestrictions() - { - return $this->readOneof(8); - } - - public function hasIntegerRestrictions() - { - return $this->hasOneof(8); - } - - /** - * Restriction on INTEGER type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; - * @param \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions $var - * @return $this - */ - public function setIntegerRestrictions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\IntegerRestrictions::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - * @return string - */ - public function getFlagName() - { - return $this->flag_name; - } - - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - * @param string $var - * @return $this - */ - public function setFlagName($var) - { - GPBUtil::checkString($var, True); - $this->flag_name = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; - * @return int - */ - public function getValueType() - { - return $this->value_type; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType value_type = 3; - * @param int $var - * @return $this - */ - public function setValueType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag\ValueType::class); - $this->value_type = $var; - - return $this; - } - - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - * @return bool - */ - public function getAcceptsMultipleValues() - { - return $this->accepts_multiple_values; - } - - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - * @param bool $var - * @return $this - */ - public function setAcceptsMultipleValues($var) - { - GPBUtil::checkBool($var); - $this->accepts_multiple_values = $var; - - return $this; - } - - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedDbVersions() - { - return $this->supported_db_versions; - } - - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1.DatabaseVersion supported_db_versions = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedDbVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AlloyDb\V1\DatabaseVersion::class); - $this->supported_db_versions = $arr; - - return $this; - } - - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - * @return bool - */ - public function getRequiresDbRestart() - { - return $this->requires_db_restart; - } - - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - * @param bool $var - * @return $this - */ - public function setRequiresDbRestart($var) - { - GPBUtil::checkBool($var); - $this->requires_db_restart = $var; - - return $this; - } - - /** - * @return string - */ - public function getRestrictions() - { - return $this->whichOneof("restrictions"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php deleted file mode 100644 index ef0b863c1db2..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/IntegerRestrictions.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - */ -class IntegerRestrictions extends \Google\Protobuf\Internal\Message -{ - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - */ - protected $min_value = null; - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - */ - protected $max_value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int64Value $min_value - * The minimum value that can be specified, if applicable. - * @type \Google\Protobuf\Int64Value $max_value - * The maximum value that can be specified, if applicable. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMinValue() - { - return $this->min_value; - } - - public function hasMinValue() - { - return isset($this->min_value); - } - - public function clearMinValue() - { - unset($this->min_value); - } - - /** - * Returns the unboxed value from getMinValue() - - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @return int|string|null - */ - public function getMinValueUnwrapped() - { - return $this->readWrapperValue("min_value"); - } - - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMinValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->min_value = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @param int|string|null $var - * @return $this - */ - public function setMinValueUnwrapped($var) - { - $this->writeWrapperValue("min_value", $var); - return $this;} - - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMaxValue() - { - return $this->max_value; - } - - public function hasMaxValue() - { - return isset($this->max_value); - } - - public function clearMaxValue() - { - unset($this->max_value); - } - - /** - * Returns the unboxed value from getMaxValue() - - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @return int|string|null - */ - public function getMaxValueUnwrapped() - { - return $this->readWrapperValue("max_value"); - } - - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMaxValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->max_value = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @param int|string|null $var - * @return $this - */ - public function setMaxValueUnwrapped($var) - { - $this->writeWrapperValue("max_value", $var); - return $this;} - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IntegerRestrictions::class, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag_IntegerRestrictions::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php deleted file mode 100644 index 9dbd0cda5621..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/StringRestrictions.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - */ -class StringRestrictions extends \Google\Protobuf\Internal\Message -{ - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - */ - private $allowed_values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedValues() - { - return $this->allowed_values; - } - - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_values = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StringRestrictions::class, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag_StringRestrictions::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php deleted file mode 100644 index 1e2a2f071183..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/SupportedDatabaseFlag/ValueType.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType - */ -class ValueType -{ - /** - * This is an unknown flag type. - * - * Generated from protobuf enum VALUE_TYPE_UNSPECIFIED = 0; - */ - const VALUE_TYPE_UNSPECIFIED = 0; - /** - * String type flag. - * - * Generated from protobuf enum STRING = 1; - */ - const STRING = 1; - /** - * Integer type flag. - * - * Generated from protobuf enum INTEGER = 2; - */ - const INTEGER = 2; - /** - * Float type flag. - * - * Generated from protobuf enum FLOAT = 3; - */ - const FLOAT = 3; - /** - * Denotes that the flag does not accept any values. - * - * Generated from protobuf enum NONE = 4; - */ - const NONE = 4; - - private static $valueToName = [ - self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', - self::STRING => 'STRING', - self::INTEGER => 'INTEGER', - self::FLOAT => 'FLOAT', - self::NONE => 'NONE', - ]; - - 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(ValueType::class, \Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag_ValueType::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php deleted file mode 100644 index 4925904e8fd7..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateBackupRequest.php +++ /dev/null @@ -1,306 +0,0 @@ -google.cloud.alloydb.v1.UpdateBackupRequest - */ -class UpdateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\AlloyDb\V1\Backup $backup Required. The resource being updated - * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * @return \Google\Cloud\AlloyDb\V1\UpdateBackupRequest - * - * @experimental - */ - public static function build(\Google\Cloud\AlloyDb\V1\Backup $backup, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setBackup($backup) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1\Backup $backup - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Backup::class); - $this->backup = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php deleted file mode 100644 index 2727a2df5cd9..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateClusterRequest.php +++ /dev/null @@ -1,310 +0,0 @@ -google.cloud.alloydb.v1.UpdateClusterRequest - */ -class UpdateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\AlloyDb\V1\Cluster $cluster Required. The resource being updated - * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * @return \Google\Cloud\AlloyDb\V1\UpdateClusterRequest - * - * @experimental - */ - public static function build(\Google\Cloud\AlloyDb\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCluster($cluster) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1\Cluster $cluster - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster::class); - $this->cluster = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php deleted file mode 100644 index 45b774ddbd49..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateInstanceRequest.php +++ /dev/null @@ -1,310 +0,0 @@ -google.cloud.alloydb.v1.UpdateInstanceRequest - */ -class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\AlloyDb\V1\Instance $instance Required. The resource being updated - * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * @return \Google\Cloud\AlloyDb\V1\UpdateInstanceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\AlloyDb\V1\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setInstance($instance) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1\Instance $instance - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance::class); - $this->instance = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php deleted file mode 100644 index 0afb7647923a..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UpdateUserRequest.php +++ /dev/null @@ -1,302 +0,0 @@ -google.cloud.alloydb.v1.UpdateUserRequest - */ -class UpdateUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\AlloyDb\V1\User $user Required. The resource being updated - * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * @return \Google\Cloud\AlloyDb\V1\UpdateUserRequest - * - * @experimental - */ - public static function build(\Google\Cloud\AlloyDb\V1\User $user, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setUser($user) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1\User $user - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allow_missing - * Optional. Allow missing fields in the update mask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1\User|null - */ - public function getUser() - { - return $this->user; - } - - public function hasUser() - { - return isset($this->user); - } - - public function clearUser() - { - unset($this->user); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1\User $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\User::class); - $this->user = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php deleted file mode 100644 index 5936d629c1da..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.alloydb.v1.User - */ -class User extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $password = ''; - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_roles; - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * @type string $password - * Input only. Password for the user. - * @type array|\Google\Protobuf\Internal\RepeatedField $database_roles - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * @type int $user_type - * Optional. Type of this user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDatabaseRoles() - { - return $this->database_roles; - } - - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDatabaseRoles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->database_roles = $arr; - - return $this; - } - - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getUserType() - { - return $this->user_type; - } - - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setUserType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\User\UserType::class); - $this->user_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php deleted file mode 100644 index 8324887d69cf..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/User/UserType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1.User.UserType - */ -class UserType -{ - /** - * Unspecified user type. - * - * Generated from protobuf enum USER_TYPE_UNSPECIFIED = 0; - */ - const USER_TYPE_UNSPECIFIED = 0; - /** - * The default user type that authenticates via password-based - * authentication. - * - * Generated from protobuf enum ALLOYDB_BUILT_IN = 1; - */ - const ALLOYDB_BUILT_IN = 1; - /** - * Database user that can authenticate via IAM-Based authentication. - * - * Generated from protobuf enum ALLOYDB_IAM_USER = 2; - */ - const ALLOYDB_IAM_USER = 2; - - private static $valueToName = [ - self::USER_TYPE_UNSPECIFIED => 'USER_TYPE_UNSPECIFIED', - self::ALLOYDB_BUILT_IN => 'ALLOYDB_BUILT_IN', - self::ALLOYDB_IAM_USER => 'ALLOYDB_IAM_USER', - ]; - - 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(UserType::class, \Google\Cloud\AlloyDb\V1\User_UserType::class); - diff --git a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php b/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php deleted file mode 100644 index 6f1de9b58940..000000000000 --- a/owl-bot-staging/AlloyDb/v1/proto/src/Google/Cloud/AlloyDb/V1/UserPassword.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.alloydb.v1.UserPassword - */ -class UserPassword extends \Google\Protobuf\Internal\Message -{ - /** - * The database username. - * - * Generated from protobuf field string user = 1; - */ - protected $user = ''; - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - */ - protected $password = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $user - * The database username. - * @type string $password - * The initial password for the user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The database username. - * - * Generated from protobuf field string user = 1; - * @return string - */ - public function getUser() - { - return $this->user; - } - - /** - * The database username. - * - * Generated from protobuf field string user = 1; - * @param string $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkString($var, True); - $this->user = $var; - - return $this; - } - - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php deleted file mode 100644 index e16eba8aa0f5..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/batch_create_instances.php +++ /dev/null @@ -1,127 +0,0 @@ -setInstanceType($requestsCreateInstanceRequestsInstanceInstanceType); - $createInstanceRequest = (new CreateInstanceRequest()) - ->setParent($formattedRequestsCreateInstanceRequestsParent) - ->setInstanceId($requestsCreateInstanceRequestsInstanceId) - ->setInstance($requestsCreateInstanceRequestsInstance); - $requestsCreateInstanceRequests = [$createInstanceRequest,]; - $requests = (new CreateInstanceRequests()) - ->setCreateInstanceRequests($requestsCreateInstanceRequests); - $request = (new BatchCreateInstancesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->batchCreateInstances($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchCreateInstancesResponse $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $formattedRequestsCreateInstanceRequestsParent = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - $requestsCreateInstanceRequestsInstanceId = '[INSTANCE_ID]'; - $requestsCreateInstanceRequestsInstanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - batch_create_instances_sample( - $formattedParent, - $formattedRequestsCreateInstanceRequestsParent, - $requestsCreateInstanceRequestsInstanceId, - $requestsCreateInstanceRequestsInstanceInstanceType - ); -} -// [END alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php deleted file mode 100644 index d8d4e288615f..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_backup.php +++ /dev/null @@ -1,100 +0,0 @@ -setClusterName($formattedBackupClusterName); - $request = (new CreateBackupRequest()) - ->setParent($formattedParent) - ->setBackupId($backupId) - ->setBackup($backup); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createBackup($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $backupId = '[BACKUP_ID]'; - $formattedBackupClusterName = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - - create_backup_sample($formattedParent, $backupId, $formattedBackupClusterName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php deleted file mode 100644 index 428b9bdd7ecd..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_cluster.php +++ /dev/null @@ -1,100 +0,0 @@ -setNetwork($formattedClusterNetwork); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - create_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php deleted file mode 100644 index 6b44ed18b72b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_instance.php +++ /dev/null @@ -1,96 +0,0 @@ -setInstanceType($instanceInstanceType); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = '[INSTANCE_ID]'; - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - create_instance_sample($formattedParent, $instanceId, $instanceInstanceType); -} -// [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php deleted file mode 100644 index e832e93faf37..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php +++ /dev/null @@ -1,101 +0,0 @@ -setNetwork($formattedClusterNetwork); - $request = (new CreateSecondaryClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createSecondaryCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - create_secondary_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php deleted file mode 100644 index cade42bfca4c..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_secondary_instance.php +++ /dev/null @@ -1,96 +0,0 @@ -setInstanceType($instanceInstanceType); - $request = (new CreateSecondaryInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createSecondaryInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = '[INSTANCE_ID]'; - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - create_secondary_instance_sample($formattedParent, $instanceId, $instanceInstanceType); -} -// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php deleted file mode 100644 index 6f7318acd711..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/create_user.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent) - ->setUserId($userId) - ->setUser($user); - - // Call the API and handle any network failures. - try { - /** @var User $response */ - $response = $alloyDBAdminClient->createUser($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 -{ - $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = '[USER_ID]'; - - create_user_sample($formattedParent, $userId); -} -// [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php deleted file mode 100644 index e231bc91b361..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_backup.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->deleteBackup($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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - delete_backup_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php deleted file mode 100644 index 3a46a394444f..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_cluster.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->deleteCluster($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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - delete_cluster_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php deleted file mode 100644 index 48b2adc65263..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_instance.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->deleteInstance($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 = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - delete_instance_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php deleted file mode 100644 index a56239eb05a8..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/delete_user.php +++ /dev/null @@ -1,70 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $alloyDBAdminClient->deleteUser($request); - printf('Call completed successfully.' . PHP_EOL); - } 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - - delete_user_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php deleted file mode 100644 index 0671f3936786..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/failover_instance.php +++ /dev/null @@ -1,91 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->failoverInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - failover_instance_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php deleted file mode 100644 index f47bf4fe971e..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/generate_client_certificate.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var GenerateClientCertificateResponse $response */ - $response = $alloyDBAdminClient->generateClientCertificate($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 -{ - $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - generate_client_certificate_sample($formattedParent); -} -// [END alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php deleted file mode 100644 index d636d3919a73..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_backup.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Backup $response */ - $response = $alloyDBAdminClient->getBackup($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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - get_backup_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php deleted file mode 100644 index 85a23f11f396..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_cluster.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Cluster $response */ - $response = $alloyDBAdminClient->getCluster($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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - get_cluster_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php deleted file mode 100644 index 050f420eeb47..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_connection_info.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var ConnectionInfo $response */ - $response = $alloyDBAdminClient->getConnectionInfo($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 -{ - $formattedParent = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - get_connection_info_sample($formattedParent); -} -// [END alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php deleted file mode 100644 index 2143841275c0..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_instance.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Instance $response */ - $response = $alloyDBAdminClient->getInstance($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 = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - get_instance_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_location.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_location.php deleted file mode 100644 index 0068e9fe716c..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/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 alloydb_v1_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php deleted file mode 100644 index 15ea2837fd55..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/get_user.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var User $response */ - $response = $alloyDBAdminClient->getUser($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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - - get_user_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php deleted file mode 100644 index c93847e544b3..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/inject_fault.php +++ /dev/null @@ -1,94 +0,0 @@ -setFaultType($faultType) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->injectFault($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - inject_fault_sample($faultType, $formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php deleted file mode 100644 index 6e4c0b653caa..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_backups.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $alloyDBAdminClient->listBackups($request); - - /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_backups_sample($formattedParent); -} -// [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php deleted file mode 100644 index 76f1afa64f1b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_clusters.php +++ /dev/null @@ -1,79 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $alloyDBAdminClient->listClusters($request); - - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_clusters_sample($formattedParent); -} -// [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php deleted file mode 100644 index ab1b61c782cb..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_instances.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $alloyDBAdminClient->listInstances($request); - - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - list_instances_sample($formattedParent); -} -// [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_locations.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_locations.php deleted file mode 100644 index d37fe484e341..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/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 alloydb_v1_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php deleted file mode 100644 index 6765773e4824..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_supported_database_flags.php +++ /dev/null @@ -1,82 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $alloyDBAdminClient->listSupportedDatabaseFlags($request); - - /** @var SupportedDatabaseFlag $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_supported_database_flags_sample($formattedParent); -} -// [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php deleted file mode 100644 index db5784fcae9e..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/list_users.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $alloyDBAdminClient->listUsers($request); - - /** @var User $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - list_users_sample($formattedParent); -} -// [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php deleted file mode 100644 index 1db2d064b5c6..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/promote_cluster.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->promoteCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 -{ - $formattedName = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - promote_cluster_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php deleted file mode 100644 index ff39eb5bf7c7..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restart_instance.php +++ /dev/null @@ -1,90 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->restartInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - restart_instance_sample($formattedName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php deleted file mode 100644 index 7517809adc5c..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/restore_cluster.php +++ /dev/null @@ -1,102 +0,0 @@ -setNetwork($formattedClusterNetwork); - $request = (new RestoreClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->restoreCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - restore_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php deleted file mode 100644 index 41bd5abd7f5f..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_backup.php +++ /dev/null @@ -1,90 +0,0 @@ -setClusterName($formattedBackupClusterName); - $request = (new UpdateBackupRequest()) - ->setBackup($backup); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateBackup($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Backup $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 -{ - $formattedBackupClusterName = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - - update_backup_sample($formattedBackupClusterName); -} -// [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php deleted file mode 100644 index 58655649630f..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_cluster.php +++ /dev/null @@ -1,89 +0,0 @@ -setNetwork($formattedClusterNetwork); - $request = (new UpdateClusterRequest()) - ->setCluster($cluster); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateCluster($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 -{ - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - update_cluster_sample($formattedClusterNetwork); -} -// [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php deleted file mode 100644 index ddd12709471e..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_instance.php +++ /dev/null @@ -1,85 +0,0 @@ -setInstanceType($instanceInstanceType); - $request = (new UpdateInstanceRequest()) - ->setInstance($instance); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateInstance($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - update_instance_sample($instanceInstanceType); -} -// [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php b/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php deleted file mode 100644 index 91f5435d8fc2..000000000000 --- a/owl-bot-staging/AlloyDb/v1/samples/V1/AlloyDBAdminClient/update_user.php +++ /dev/null @@ -1,59 +0,0 @@ -setUser($user); - - // Call the API and handle any network failures. - try { - /** @var User $response */ - $response = $alloyDBAdminClient->updateUser($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php b/owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php deleted file mode 100644 index 46b275bf3d44..000000000000 --- a/owl-bot-staging/AlloyDb/v1/src/V1/AlloyDBAdminClient.php +++ /dev/null @@ -1,34 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_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; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName(string $project, string $location, string $backup): string - { - return self::getPathTemplate('backup')->render([ - 'project' => $project, - 'location' => $location, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted cluster resource. - */ - public static function clusterName(string $project, string $location, string $cluster): string - { - return self::getPathTemplate('cluster')->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * crypto_key_version resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * @param string $cryptoKeyVersion - * - * @return string The formatted crypto_key_version resource. - */ - public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string - { - return self::getPathTemplate('cryptoKeyVersion')->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - 'crypto_key_version' => $cryptoKeyVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName(string $project, string $location, string $cluster, string $instance): string - { - return self::getPathTemplate('instance')->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'instance' => $instance, - ]); - } - - /** - * 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 network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName(string $project, string $network): string - { - return self::getPathTemplate('network')->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a user - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $user - * - * @return string The formatted user resource. - */ - public static function userName(string $project, string $location, string $cluster, string $user): string - { - return self::getPathTemplate('user')->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'user' => $user, - ]); - } - - /** - * 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}/backups/{backup} - * - cluster: projects/{project}/locations/{location}/clusters/{cluster} - * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} - * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} - * - * 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 'alloydb.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); - } - - /** - * Creates new instances under the given project, location and cluster. - * There can be only one primary instance in a cluster. If the primary - * instance exists in the cluster as well as this request, then API will - * throw an error. - * The primary instance should exist before any read pool instance is - * created. If the primary instance is a part of the request payload, then - * the API will take care of creating instances in the correct order. - * This method is here to support Google-internal use cases, and is not meant - * for external customers to consume. Please do not start relying on it; its - * behavior is subject to change without notice. - * - * The async variant is {@see AlloyDBAdminClient::batchCreateInstancesAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/batch_create_instances.php - * - * @param BatchCreateInstancesRequest $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 batchCreateInstances(BatchCreateInstancesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchCreateInstances', $request, $callOptions)->wait(); - } - - /** - * Creates a new Backup in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::createBackupAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/create_backup.php - * - * @param CreateBackupRequest $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 createBackup(CreateBackupRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateBackup', $request, $callOptions)->wait(); - } - - /** - * Creates a new Cluster in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::createClusterAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/create_cluster.php - * - * @param CreateClusterRequest $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 createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); - } - - /** - * Creates a new Instance in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::createInstanceAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/create_instance.php - * - * @param CreateInstanceRequest $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 createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); - } - - /** - * Creates a cluster of type SECONDARY in the given location using - * the primary cluster as the source. - * - * The async variant is {@see AlloyDBAdminClient::createSecondaryClusterAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/create_secondary_cluster.php - * - * @param CreateSecondaryClusterRequest $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 createSecondaryCluster(CreateSecondaryClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateSecondaryCluster', $request, $callOptions)->wait(); - } - - /** - * Creates a new SECONDARY Instance in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::createSecondaryInstanceAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/create_secondary_instance.php - * - * @param CreateSecondaryInstanceRequest $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 createSecondaryInstance(CreateSecondaryInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateSecondaryInstance', $request, $callOptions)->wait(); - } - - /** - * Creates a new User in a given project, location, and cluster. - * - * The async variant is {@see AlloyDBAdminClient::createUserAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/create_user.php - * - * @param CreateUserRequest $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 User - * - * @throws ApiException Thrown if the API call fails. - */ - public function createUser(CreateUserRequest $request, array $callOptions = []): User - { - return $this->startApiCall('CreateUser', $request, $callOptions)->wait(); - } - - /** - * Deletes a single Backup. - * - * The async variant is {@see AlloyDBAdminClient::deleteBackupAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/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 Cluster. - * - * The async variant is {@see AlloyDBAdminClient::deleteClusterAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/delete_cluster.php - * - * @param DeleteClusterRequest $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 deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); - } - - /** - * Deletes a single Instance. - * - * The async variant is {@see AlloyDBAdminClient::deleteInstanceAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/delete_instance.php - * - * @param DeleteInstanceRequest $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 deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); - } - - /** - * Deletes a single User. - * - * The async variant is {@see AlloyDBAdminClient::deleteUserAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/delete_user.php - * - * @param DeleteUserRequest $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. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteUser(DeleteUserRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteUser', $request, $callOptions)->wait(); - } - - /** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. - * Imperative only. - * - * The async variant is {@see AlloyDBAdminClient::failoverInstanceAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/failover_instance.php - * - * @param FailoverInstanceRequest $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 failoverInstance(FailoverInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('FailoverInstance', $request, $callOptions)->wait(); - } - - /** - * Generate a client certificate signed by a Cluster CA. - * The sole purpose of this endpoint is to support AlloyDB connectors and the - * Auth Proxy client. The endpoint's behavior is subject to change without - * notice, so do not rely on its behavior remaining constant. Future changes - * will not break AlloyDB connectors or the Auth Proxy client. - * - * The async variant is {@see AlloyDBAdminClient::generateClientCertificateAsync()} - * . - * - * @example samples/V1/AlloyDBAdminClient/generate_client_certificate.php - * - * @param GenerateClientCertificateRequest $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 GenerateClientCertificateResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function generateClientCertificate(GenerateClientCertificateRequest $request, array $callOptions = []): GenerateClientCertificateResponse - { - return $this->startApiCall('GenerateClientCertificate', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single Backup. - * - * The async variant is {@see AlloyDBAdminClient::getBackupAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/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 Cluster. - * - * The async variant is {@see AlloyDBAdminClient::getClusterAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/get_cluster.php - * - * @param GetClusterRequest $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 Cluster - * - * @throws ApiException Thrown if the API call fails. - */ - public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster - { - return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); - } - - /** - * Get instance metadata used for a connection. - * - * The async variant is {@see AlloyDBAdminClient::getConnectionInfoAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/get_connection_info.php - * - * @param GetConnectionInfoRequest $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 ConnectionInfo - * - * @throws ApiException Thrown if the API call fails. - */ - public function getConnectionInfo(GetConnectionInfoRequest $request, array $callOptions = []): ConnectionInfo - { - return $this->startApiCall('GetConnectionInfo', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single Instance. - * - * The async variant is {@see AlloyDBAdminClient::getInstanceAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/get_instance.php - * - * @param GetInstanceRequest $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 Instance - * - * @throws ApiException Thrown if the API call fails. - */ - public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance - { - return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single User. - * - * The async variant is {@see AlloyDBAdminClient::getUserAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/get_user.php - * - * @param GetUserRequest $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 User - * - * @throws ApiException Thrown if the API call fails. - */ - public function getUser(GetUserRequest $request, array $callOptions = []): User - { - return $this->startApiCall('GetUser', $request, $callOptions)->wait(); - } - - /** - * Injects fault in an instance. - * Imperative only. - * - * The async variant is {@see AlloyDBAdminClient::injectFaultAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/inject_fault.php - * - * @param InjectFaultRequest $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 injectFault(InjectFaultRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('InjectFault', $request, $callOptions)->wait(); - } - - /** - * Lists Backups in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::listBackupsAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/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 Clusters in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::listClustersAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/list_clusters.php - * - * @param ListClustersRequest $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 listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListClusters', $request, $callOptions); - } - - /** - * Lists Instances in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::listInstancesAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/list_instances.php - * - * @param ListInstancesRequest $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 listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListInstances', $request, $callOptions); - } - - /** - * Lists SupportedDatabaseFlags for a given project and location. - * - * The async variant is - * {@see AlloyDBAdminClient::listSupportedDatabaseFlagsAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/list_supported_database_flags.php - * - * @param ListSupportedDatabaseFlagsRequest $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 listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSupportedDatabaseFlags', $request, $callOptions); - } - - /** - * Lists Users in a given project and location. - * - * The async variant is {@see AlloyDBAdminClient::listUsersAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/list_users.php - * - * @param ListUsersRequest $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 listUsers(ListUsersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListUsers', $request, $callOptions); - } - - /** - * Promotes a SECONDARY cluster. This turns down replication - * from the PRIMARY cluster and promotes a secondary cluster - * into its own standalone cluster. - * Imperative only. - * - * The async variant is {@see AlloyDBAdminClient::promoteClusterAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/promote_cluster.php - * - * @param PromoteClusterRequest $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 promoteCluster(PromoteClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('PromoteCluster', $request, $callOptions)->wait(); - } - - /** - * Restart an Instance in a cluster. - * Imperative only. - * - * The async variant is {@see AlloyDBAdminClient::restartInstanceAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/restart_instance.php - * - * @param RestartInstanceRequest $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 restartInstance(RestartInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RestartInstance', $request, $callOptions)->wait(); - } - - /** - * Creates a new Cluster in a given project and location, with a volume - * restored from the provided source, either a backup ID or a point-in-time - * and a source cluster. - * - * The async variant is {@see AlloyDBAdminClient::restoreClusterAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/restore_cluster.php - * - * @param RestoreClusterRequest $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 restoreCluster(RestoreClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RestoreCluster', $request, $callOptions)->wait(); - } - - /** - * Updates the parameters of a single Backup. - * - * The async variant is {@see AlloyDBAdminClient::updateBackupAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/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 parameters of a single Cluster. - * - * The async variant is {@see AlloyDBAdminClient::updateClusterAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/update_cluster.php - * - * @param UpdateClusterRequest $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 updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); - } - - /** - * Updates the parameters of a single Instance. - * - * The async variant is {@see AlloyDBAdminClient::updateInstanceAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/update_instance.php - * - * @param UpdateInstanceRequest $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 updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); - } - - /** - * Updates the parameters of a single User. - * - * The async variant is {@see AlloyDBAdminClient::updateUserAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/update_user.php - * - * @param UpdateUserRequest $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 User - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateUser(UpdateUserRequest $request, array $callOptions = []): User - { - return $this->startApiCall('UpdateUser', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see AlloyDBAdminClient::getLocationAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/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 AlloyDBAdminClient::listLocationsAsync()} . - * - * @example samples/V1/AlloyDBAdminClient/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); - } -} diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php b/owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php deleted file mode 100644 index 5c6d79e8ea6b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/src/V1/Gapic/AlloyDBAdminGapicClient.php +++ /dev/null @@ -1,3291 +0,0 @@ -clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $requests = new CreateInstanceRequests(); - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\AlloyDb\V1\Client\AlloyDBAdminClient} to use the new surface. - */ -class AlloyDBAdminGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.alloydb.v1.AlloyDBAdmin'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'alloydb.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $backupNameTemplate; - - private static $clusterNameTemplate; - - private static $cryptoKeyVersionNameTemplate; - - private static $instanceNameTemplate; - - private static $locationNameTemplate; - - private static $networkNameTemplate; - - private static $userNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getClusterNameTemplate() - { - if (self::$clusterNameTemplate == null) { - self::$clusterNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}'); - } - - return self::$clusterNameTemplate; - } - - private static function getCryptoKeyVersionNameTemplate() - { - if (self::$cryptoKeyVersionNameTemplate == null) { - self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); - } - - return self::$cryptoKeyVersionNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}'); - } - - return self::$instanceNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getUserNameTemplate() - { - if (self::$userNameTemplate == null) { - self::$userNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/users/{user}'); - } - - return self::$userNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'cluster' => self::getClusterNameTemplate(), - 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'user' => self::getUserNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName($project, $location, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted cluster resource. - */ - public static function clusterName($project, $location, $cluster) - { - return self::getClusterNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * crypto_key_version resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * @param string $cryptoKeyVersion - * - * @return string The formatted crypto_key_version resource. - */ - public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) - { - return self::getCryptoKeyVersionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - 'crypto_key_version' => $cryptoKeyVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $instance - * - * @return string The formatted instance resource. - */ - public static function instanceName($project, $location, $cluster, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'instance' => $instance, - ]); - } - - /** - * 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($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a user - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $user - * - * @return string The formatted user resource. - */ - public static function userName($project, $location, $cluster, $user) - { - return self::getUserNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'user' => $user, - ]); - } - - /** - * 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}/backups/{backup} - * - cluster: projects/{project}/locations/{location}/clusters/{cluster} - * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} - * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} - * - * 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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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; - } - - /** - * 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 'alloydb.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); - } - - /** - * Creates new instances under the given project, location and cluster. - * There can be only one primary instance in a cluster. If the primary - * instance exists in the cluster as well as this request, then API will - * throw an error. - * The primary instance should exist before any read pool instance is - * created. If the primary instance is a part of the request payload, then - * the API will take care of creating instances in the correct order. - * This method is here to support Google-internal use cases, and is not meant - * for external customers to consume. Please do not start relying on it; its - * behavior is subject to change without notice. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $requests = new CreateInstanceRequests(); - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. - * @param CreateInstanceRequests $requests Required. Resources being created. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCreateInstances($parent, $requests, array $optionalArgs = []) - { - $request = new BatchCreateInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchCreateInstances', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Backup in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Value for parent. - * @param string $backupId Required. ID of the requesting object. - * @param Backup $backup Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Cluster in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object. - * @param Cluster $cluster Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new CreateClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Instance in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $instanceId = 'instance_id'; - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param string $instanceId Required. ID of the requesting object. - * @param Instance $instance Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createInstance($parent, $instanceId, $instance, array $optionalArgs = []) - { - $request = new CreateInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a cluster of type SECONDARY in the given location using - * the primary cluster as the source. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object (the secondary cluster). - * @param Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createSecondaryCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new CreateSecondaryClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateSecondaryCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new SECONDARY Instance in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $instanceId = 'instance_id'; - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param string $instanceId Required. ID of the requesting object. - * @param Instance $instance Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createSecondaryInstance($parent, $instanceId, $instance, array $optionalArgs = []) - { - $request = new CreateSecondaryInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateSecondaryInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new User in a given project, location, and cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $userId = 'user_id'; - * $user = new User(); - * $response = $alloyDBAdminClient->createUser($formattedParent, $userId, $user); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Value for parent. - * @param string $userId Required. ID of the requesting object. - * @param User $user Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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 \Google\Cloud\AlloyDb\V1\User - * - * @throws ApiException if the remote call fails - */ - public function createUser($parent, $userId, $user, array $optionalArgs = []) - { - $request = new CreateUserRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setUserId($userId); - $request->setUser($user); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type string $etag - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @type bool $force - * Optional. Whether to cascade delete child instances for given cluster. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteCluster($name, array $optionalArgs = []) - { - $request = new DeleteClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteInstance($name, array $optionalArgs = []) - { - $request = new DeleteInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - * $alloyDBAdminClient->deleteUser($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteUser($name, array $optionalArgs = []) - { - $request = new DeleteUserRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteUser', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'failoverInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function failoverInstance($name, array $optionalArgs = []) - { - $request = new FailoverInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('FailoverInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Generate a client certificate signed by a Cluster CA. - * The sole purpose of this endpoint is to support AlloyDB connectors and the - * Auth Proxy client. The endpoint's behavior is subject to change without - * notice, so do not rely on its behavior remaining constant. Future changes - * will not break AlloyDB connectors or the Auth Proxy client. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $response = $alloyDBAdminClient->generateClientCertificate($formattedParent); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type Duration $certDuration - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * @type string $publicKey - * Optional. The public key from the client. - * @type bool $useMetadataExchange - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * @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 \Google\Cloud\AlloyDb\V1\GenerateClientCertificateResponse - * - * @throws ApiException if the remote call fails - */ - public function generateClientCertificate($parent, array $optionalArgs = []) - { - $request = new GenerateClientCertificateRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['certDuration'])) { - $request->setCertDuration($optionalArgs['certDuration']); - } - - if (isset($optionalArgs['publicKey'])) { - $request->setPublicKey($optionalArgs['publicKey']); - } - - if (isset($optionalArgs['useMetadataExchange'])) { - $request->setUseMetadataExchange($optionalArgs['useMetadataExchange']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateClientCertificate', GenerateClientCertificateResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $response = $alloyDBAdminClient->getBackup($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the resource - * @param array $optionalArgs { - * 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 \Google\Cloud\AlloyDb\V1\Backup - * - * @throws ApiException if the remote call fails - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $response = $alloyDBAdminClient->getCluster($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\ClusterView} - * @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 \Google\Cloud\AlloyDb\V1\Cluster - * - * @throws ApiException if the remote call fails - */ - public function getCluster($name, array $optionalArgs = []) - { - $request = new GetClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetCluster', Cluster::class, $optionalArgs, $request)->wait(); - } - - /** - * Get instance metadata used for a connection. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $response = $alloyDBAdminClient->getConnectionInfo($formattedParent); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @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 \Google\Cloud\AlloyDb\V1\ConnectionInfo - * - * @throws ApiException if the remote call fails - */ - public function getConnectionInfo($parent, array $optionalArgs = []) - { - $request = new GetConnectionInfoRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConnectionInfo', ConnectionInfo::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $response = $alloyDBAdminClient->getInstance($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * The view of the instance to return. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\InstanceView} - * @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 \Google\Cloud\AlloyDb\V1\Instance - * - * @throws ApiException if the remote call fails - */ - public function getInstance($name, array $optionalArgs = []) - { - $request = new GetInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - * $response = $alloyDBAdminClient->getUser($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param array $optionalArgs { - * 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 \Google\Cloud\AlloyDb\V1\User - * - * @throws ApiException if the remote call fails - */ - public function getUser($name, array $optionalArgs = []) - { - $request = new GetUserRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Injects fault in an instance. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'injectFault'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param int $faultType Required. The type of fault to be injected in an instance. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1\InjectFaultRequest\FaultType} - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function injectFault($faultType, $name, array $optionalArgs = []) - { - $request = new InjectFaultRequest(); - $requestParamHeaders = []; - $request->setFaultType($faultType); - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('InjectFault', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Lists Backups in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent value for ListBackupsRequest - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filtering results - * @type string $orderBy - * Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists Clusters in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listClusters($parent, array $optionalArgs = []) - { - $request = new ListClustersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListClusters', $optionalArgs, ListClustersResponse::class, $request); - } - - /** - * Lists Instances in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listInstances($parent, array $optionalArgs = []) - { - $request = new ListInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListInstances', $optionalArgs, ListInstancesResponse::class, $request); - } - - /** - * Lists SupportedDatabaseFlags for a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSupportedDatabaseFlags($parent, array $optionalArgs = []) - { - $request = new ListSupportedDatabaseFlagsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListSupportedDatabaseFlags', $optionalArgs, ListSupportedDatabaseFlagsResponse::class, $request); - } - - /** - * Lists Users in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent value for ListUsersRequest - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listUsers($parent, array $optionalArgs = []) - { - $request = new ListUsersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListUsers', $optionalArgs, ListUsersResponse::class, $request); - } - - /** - * Promotes a SECONDARY cluster. This turns down replication - * from the PRIMARY cluster and promotes a secondary cluster - * into its own standalone cluster. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'promoteCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function promoteCluster($name, array $optionalArgs = []) - { - $request = new PromoteClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('PromoteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Restart an Instance in a cluster. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restartInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restartInstance($name, array $optionalArgs = []) - { - $request = new RestartInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestartInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Cluster in a given project and location, with a volume - * restored from the provided source, either a backup ID or a point-in-time - * and a source cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restoreCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object. - * @param Cluster $cluster Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type BackupSource $backupSource - * Backup source. - * @type ContinuousBackupSource $continuousBackupSource - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restoreCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new RestoreClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['backupSource'])) { - $request->setBackupSource($optionalArgs['backupSource']); - } - - if (isset($optionalArgs['continuousBackupSource'])) { - $request->setContinuousBackupSource($optionalArgs['continuousBackupSource']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $backup = new Backup(); - * $operationResponse = $alloyDBAdminClient->updateBackup($backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateBackup($backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Backup $backup Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateBackup($backup, array $optionalArgs = []) - { - $request = new UpdateBackupRequest(); - $requestParamHeaders = []; - $request->setBackup($backup); - $requestParamHeaders['backup.name'] = $backup->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Cluster $cluster Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateCluster($cluster, array $optionalArgs = []) - { - $request = new UpdateClusterRequest(); - $requestParamHeaders = []; - $request->setCluster($cluster); - $requestParamHeaders['cluster.name'] = $cluster->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->updateInstance($instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateInstance($instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Instance $instance Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateInstance($instance, array $optionalArgs = []) - { - $request = new UpdateInstanceRequest(); - $requestParamHeaders = []; - $request->setInstance($instance); - $requestParamHeaders['instance.name'] = $instance->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $user = new User(); - * $response = $alloyDBAdminClient->updateUser($user); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param User $user Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allowMissing - * Optional. Allow missing fields in the update mask. - * @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 \Google\Cloud\AlloyDb\V1\User - * - * @throws ApiException if the remote call fails - */ - public function updateUser($user, array $optionalArgs = []) - { - $request = new UpdateUserRequest(); - $requestParamHeaders = []; - $request->setUser($user); - $requestParamHeaders['user.name'] = $user->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $response = $alloyDBAdminClient->getLocation(); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json b/owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json deleted file mode 100644 index acfc6419e997..000000000000 --- a/owl-bot-staging/AlloyDb/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.alloydb.v1", - "libraryPackage": "Google\\Cloud\\AlloyDb\\V1", - "services": { - "AlloyDBAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBAdminGapicClient", - "rpcs": { - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags" - ] - }, - "ListUsers": { - "methods": [ - "listUsers" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json deleted file mode 100644 index 3643e0bcf47b..000000000000 --- a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_client_config.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1.AlloyDBAdmin": { - "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": 60000, - "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": { - "BatchCreateInstances": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateSecondaryCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateSecondaryInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateUser": { - "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_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteUser": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GenerateClientCertificate": { - "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" - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetConnectionInfo": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetUser": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "InjectFault": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListSupportedDatabaseFlags": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListUsers": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PromoteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RestoreCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateUser": { - "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_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php deleted file mode 100644 index 4bf356dc4b3c..000000000000 --- a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_descriptor_config.php +++ /dev/null @@ -1,586 +0,0 @@ - [ - 'google.cloud.alloydb.v1.AlloyDBAdmin' => [ - 'BatchCreateInstances' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\BatchCreateInstancesResponse', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Backup', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateSecondaryCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateSecondaryInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\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\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'FailoverInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'InjectFault' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'PromoteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RestartInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RestoreCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Backup', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'backup.name', - 'fieldAccessors' => [ - 'getBackup', - 'getName', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'cluster.name', - 'fieldAccessors' => [ - 'getCluster', - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'instance.name', - 'fieldAccessors' => [ - 'getInstance', - 'getName', - ], - ], - ], - ], - 'CreateUser' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\User', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteUser' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GenerateClientCertificate' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\GenerateClientCertificateResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetBackup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\Backup', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\Cluster', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetConnectionInfo' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\ConnectionInfo', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetInstance' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\Instance', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetUser' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\User', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\ListBackupsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListClusters' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getClusters', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\ListClustersResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListInstances' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInstances', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\ListInstancesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListSupportedDatabaseFlags' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSupportedDatabaseFlags', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\ListSupportedDatabaseFlagsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListUsers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUsers', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\ListUsersResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateUser' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\AlloyDb\V1\User', - 'headerParams' => [ - [ - 'keyName' => 'user.name', - 'fieldAccessors' => [ - 'getUser', - 'getName', - ], - ], - ], - ], - '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', - ], - 'templateMap' => [ - 'backup' => 'projects/{project}/locations/{location}/backups/{backup}', - 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', - 'cryptoKeyVersion' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}', - 'instance' => 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}', - 'location' => 'projects/{project}/locations/{location}', - 'network' => 'projects/{project}/global/networks/{network}', - 'user' => 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}', - ], - ], - ], -]; diff --git a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php b/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php deleted file mode 100644 index a37ac074be16..000000000000 --- a/owl-bot-staging/AlloyDb/v1/src/V1/resources/alloy_db_admin_rest_client_config.php +++ /dev/null @@ -1,454 +0,0 @@ - [ - 'google.cloud.alloydb.v1.AlloyDBAdmin' => [ - 'BatchCreateInstances' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate', - 'body' => 'requests', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backups', - 'body' => 'backup', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_id', - ], - ], - 'CreateCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'cluster_id', - ], - ], - 'CreateInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'instance_id', - ], - ], - 'CreateSecondaryCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters:createsecondary', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateSecondaryInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateUser' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/users', - 'body' => 'user', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'user_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteCluster' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteUser' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/users/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'FailoverInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GenerateClientCertificate' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetConnectionInfo' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetInstance' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetUser' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/users/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'InjectFault' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListClusters' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListInstances' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListSupportedDatabaseFlags' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListUsers' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/users', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PromoteCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}:promote', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestartInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestoreCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters:restore', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateBackup' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{backup.name=projects/*/locations/*/backups/*}', - 'body' => 'backup', - 'placeholders' => [ - 'backup.name' => [ - 'getters' => [ - 'getBackup', - 'getName', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', - 'body' => 'cluster', - 'placeholders' => [ - 'cluster.name' => [ - 'getters' => [ - 'getCluster', - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}', - 'body' => 'instance', - 'placeholders' => [ - 'instance.name' => [ - 'getters' => [ - 'getInstance', - 'getName', - ], - ], - ], - ], - 'UpdateUser' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{user.name=projects/*/locations/*/clusters/*/users/*}', - 'body' => 'user', - 'placeholders' => [ - 'user.name' => [ - 'getters' => [ - 'getUser', - 'getName', - ], - ], - ], - ], - ], - '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.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/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php deleted file mode 100644 index 12c69d40f054..000000000000 --- a/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/AlloyDBAdminClientTest.php +++ /dev/null @@ -1,3401 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return AlloyDBAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new AlloyDBAdminClient($options); - } - - /** @test */ - public function batchCreateInstancesTest() - { - $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/batchCreateInstancesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateInstancesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateInstancesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $response = $gapicClient->batchCreateInstances($formattedParent, $requests); - $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.alloydb.v1.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - $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 batchCreateInstancesExceptionTest() - { - $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/batchCreateInstancesTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $response = $gapicClient->batchCreateInstances($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - 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 createBackupTest() - { - $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/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $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.alloydb.v1.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $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 createBackupExceptionTest() - { - $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/createBackupTest'); - $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]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - 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 createClusterTest() - { - $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/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $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 createClusterExceptionTest() - { - $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/createClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - 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 createInstanceTest() - { - $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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); - $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.alloydb.v1.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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 createInstanceExceptionTest() - { - $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/createInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - 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 createSecondaryClusterTest() - { - $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/createSecondaryClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - $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 createSecondaryClusterExceptionTest() - { - $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/createSecondaryClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - 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 createSecondaryInstanceTest() - { - $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/createSecondaryInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $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.alloydb.v1.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - $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 createSecondaryInstanceExceptionTest() - { - $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/createSecondaryInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - 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 createUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - $response = $gapicClient->createUser($formattedParent, $userId, $user); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/CreateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getUserId(); - $this->assertProtobufEquals($userId, $actualValue); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createUserExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - try { - $gapicClient->createUser($formattedParent, $userId, $user); - // 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 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); - $expectedResponse = new GPBEmpty(); - $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]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $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.alloydb.v1.AlloyDBAdmin/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]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $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 deleteClusterTest() - { - $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/deleteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->deleteCluster($formattedName); - $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.alloydb.v1.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - $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 deleteClusterExceptionTest() - { - $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/deleteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->deleteCluster($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - 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 deleteInstanceTest() - { - $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/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $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.alloydb.v1.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $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 deleteInstanceExceptionTest() - { - $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/deleteInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - 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 deleteUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $gapicClient->deleteUser($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/DeleteUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - try { - $gapicClient->deleteUser($formattedName); - // 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 failoverInstanceTest() - { - $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/failoverInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/failoverInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->failoverInstance($formattedName); - $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.alloydb.v1.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - $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 failoverInstanceExceptionTest() - { - $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/failoverInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->failoverInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - 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 generateClientCertificateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $caCert = 'caCert536363365'; - $expectedResponse = new GenerateClientCertificateResponse(); - $expectedResponse->setCaCert($caCert); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->generateClientCertificate($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateClientCertificateExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->generateClientCertificate($formattedParent); - // 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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $response = $gapicClient->getBackup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/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]', '[BACKUP]'); - try { - $gapicClient->getBackup($formattedName); - // 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 getClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->getCluster($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->getCluster($formattedName); - // 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 getConnectionInfoTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $ipAddress = 'ipAddress1480014044'; - $instanceUid = 'instanceUid-737331802'; - $expectedResponse = new ConnectionInfo(); - $expectedResponse->setName($name); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setInstanceUid($instanceUid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->getConnectionInfo($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConnectionInfoExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - try { - $gapicClient->getConnectionInfo($formattedParent); - // 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 getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->getInstance($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - try { - $gapicClient->getInstance($formattedName); - // 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 getUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name2); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $response = $gapicClient->getUser($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/GetUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - try { - $gapicClient->getUser($formattedName); - // 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 injectFaultTest() - { - $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/injectFaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/injectFaultTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->injectFault($faultType, $formattedName); - $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.alloydb.v1.AlloyDBAdmin/InjectFault', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFaultType(); - $this->assertProtobufEquals($faultType, $actualValue); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - $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 injectFaultExceptionTest() - { - $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/injectFaultTest'); - $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 - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->injectFault($faultType, $formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - 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 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->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listBackups($formattedParent); - $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.alloydb.v1.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listBackups($formattedParent); - // 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 listClustersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $clustersElement = new Cluster(); - $clusters = [ - $clustersElement, - ]; - $expectedResponse = new ListClustersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setClusters($clusters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listClusters($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListClusters', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersExceptionTest() - { - $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]'); - try { - $gapicClient->listClusters($formattedParent); - // 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 listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->listInstances($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->listInstances($formattedParent); - // 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 listSupportedDatabaseFlagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); - $supportedDatabaseFlags = [ - $supportedDatabaseFlagsElement, - ]; - $expectedResponse = new ListSupportedDatabaseFlagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listSupportedDatabaseFlags($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSupportedDatabaseFlagsExceptionTest() - { - $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]'); - try { - $gapicClient->listSupportedDatabaseFlags($formattedParent); - // 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 listUsersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $usersElement = new User(); - $users = [ - $usersElement, - ]; - $expectedResponse = new ListUsersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUsers($users); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->listUsers($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListUsers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listUsersExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->listUsers($formattedParent); - // 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 promoteClusterTest() - { - $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/promoteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag2 = 'etag2-1293302904'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag2); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/promoteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->promoteCluster($formattedName); - $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.alloydb.v1.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - $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 promoteClusterExceptionTest() - { - $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/promoteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->promoteCluster($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - 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 restartInstanceTest() - { - $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/restartInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restartInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $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.alloydb.v1.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - $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 restartInstanceExceptionTest() - { - $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/restartInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - 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 restoreClusterTest() - { - $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/restoreClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - $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 restoreClusterExceptionTest() - { - $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/restoreClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - 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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->updateBackup($backup); - $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.alloydb.v1.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->updateBackup($backup); - $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 updateClusterTest() - { - $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/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->updateCluster($cluster); - $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.alloydb.v1.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - $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 updateClusterExceptionTest() - { - $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/updateClusterTest'); - $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 - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->updateCluster($cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - 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 updateInstanceTest() - { - $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/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->updateInstance($instance); - $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.alloydb.v1.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $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 updateInstanceExceptionTest() - { - $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/updateInstanceTest'); - $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 - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->updateInstance($instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - 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 updateUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $user = new User(); - $response = $gapicClient->updateUser($user); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/UpdateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateUserExceptionTest() - { - $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 - $user = new User(); - try { - $gapicClient->updateUser($user); - // 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 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php deleted file mode 100644 index b6a4fbae1e92..000000000000 --- a/owl-bot-staging/AlloyDb/v1/tests/Unit/V1/Client/AlloyDBAdminClientTest.php +++ /dev/null @@ -1,3664 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return AlloyDBAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new AlloyDBAdminClient($options); - } - - /** @test */ - public function batchCreateInstancesTest() - { - $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/batchCreateInstancesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateInstancesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateInstancesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $request = (new BatchCreateInstancesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); - $response = $gapicClient->batchCreateInstances($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.alloydb.v1.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - $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 batchCreateInstancesExceptionTest() - { - $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/batchCreateInstancesTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $request = (new BatchCreateInstancesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); - $response = $gapicClient->batchCreateInstances($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - 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 createBackupTest() - { - $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/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $request = (new CreateBackupRequest()) - ->setParent($formattedParent) - ->setBackupId($backupId) - ->setBackup($backup); - $response = $gapicClient->createBackup($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.alloydb.v1.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $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 createBackupExceptionTest() - { - $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/createBackupTest'); - $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]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $request = (new CreateBackupRequest()) - ->setParent($formattedParent) - ->setBackupId($backupId) - ->setBackup($backup); - $response = $gapicClient->createBackup($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - 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 createClusterTest() - { - $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/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createCluster($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.alloydb.v1.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $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 createClusterExceptionTest() - { - $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/createClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new CreateClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - 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 createInstanceTest() - { - $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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($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.alloydb.v1.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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 createInstanceExceptionTest() - { - $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/createInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $request = (new CreateInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - 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 createSecondaryClusterTest() - { - $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/createSecondaryClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new CreateSecondaryClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createSecondaryCluster($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.alloydb.v1.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - $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 createSecondaryClusterExceptionTest() - { - $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/createSecondaryClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new CreateSecondaryClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->createSecondaryCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - 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 createSecondaryInstanceTest() - { - $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/createSecondaryInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $request = (new CreateSecondaryInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createSecondaryInstance($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.alloydb.v1.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - $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 createSecondaryInstanceExceptionTest() - { - $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/createSecondaryInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $request = (new CreateSecondaryInstanceRequest()) - ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createSecondaryInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - 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 createUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - $request = (new CreateUserRequest()) - ->setParent($formattedParent) - ->setUserId($userId) - ->setUser($user); - $response = $gapicClient->createUser($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.alloydb.v1.AlloyDBAdmin/CreateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getUserId(); - $this->assertProtobufEquals($userId, $actualValue); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createUserExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - $request = (new CreateUserRequest()) - ->setParent($formattedParent) - ->setUserId($userId) - ->setUser($user); - try { - $gapicClient->createUser($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 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); - $expectedResponse = new GPBEmpty(); - $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]', '[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.alloydb.v1.AlloyDBAdmin/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]', '[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 deleteClusterTest() - { - $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/deleteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCluster($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.alloydb.v1.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - $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 deleteClusterExceptionTest() - { - $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/deleteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - 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 deleteInstanceTest() - { - $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/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($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.alloydb.v1.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $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 deleteInstanceExceptionTest() - { - $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/deleteInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - 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 deleteUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $request = (new DeleteUserRequest()) - ->setName($formattedName); - $gapicClient->deleteUser($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/DeleteUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $request = (new DeleteUserRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteUser($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 failoverInstanceTest() - { - $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/failoverInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/failoverInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new FailoverInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->failoverInstance($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.alloydb.v1.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - $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 failoverInstanceExceptionTest() - { - $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/failoverInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new FailoverInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->failoverInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - 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 generateClientCertificateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $caCert = 'caCert536363365'; - $expectedResponse = new GenerateClientCertificateResponse(); - $expectedResponse->setCaCert($caCert); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GenerateClientCertificateRequest()) - ->setParent($formattedParent); - $response = $gapicClient->generateClientCertificate($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.alloydb.v1.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateClientCertificateExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GenerateClientCertificateRequest()) - ->setParent($formattedParent); - try { - $gapicClient->generateClientCertificate($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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[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.alloydb.v1.AlloyDBAdmin/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]', '[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 getClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->getCluster($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.alloydb.v1.AlloyDBAdmin/GetCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); - try { - $gapicClient->getCluster($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 getConnectionInfoTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $ipAddress = 'ipAddress1480014044'; - $instanceUid = 'instanceUid-737331802'; - $expectedResponse = new ConnectionInfo(); - $expectedResponse->setName($name); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setInstanceUid($instanceUid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new GetConnectionInfoRequest()) - ->setParent($formattedParent); - $response = $gapicClient->getConnectionInfo($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.alloydb.v1.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConnectionInfoExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new GetConnectionInfoRequest()) - ->setParent($formattedParent); - try { - $gapicClient->getConnectionInfo($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 getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->getInstance($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.alloydb.v1.AlloyDBAdmin/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); - try { - $gapicClient->getInstance($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 getUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name2); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $request = (new GetUserRequest()) - ->setName($formattedName); - $response = $gapicClient->getUser($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.alloydb.v1.AlloyDBAdmin/GetUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $request = (new GetUserRequest()) - ->setName($formattedName); - try { - $gapicClient->getUser($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 injectFaultTest() - { - $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/injectFaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/injectFaultTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new InjectFaultRequest()) - ->setFaultType($faultType) - ->setName($formattedName); - $response = $gapicClient->injectFault($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.alloydb.v1.AlloyDBAdmin/InjectFault', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFaultType(); - $this->assertProtobufEquals($faultType, $actualValue); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - $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 injectFaultExceptionTest() - { - $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/injectFaultTest'); - $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 - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new InjectFaultRequest()) - ->setFaultType($faultType) - ->setName($formattedName); - $response = $gapicClient->injectFault($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - 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 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->locationName('[PROJECT]', '[LOCATION]'); - $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.alloydb.v1.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); - $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 listClustersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $clustersElement = new Cluster(); - $clusters = [ - $clustersElement, - ]; - $expectedResponse = new ListClustersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setClusters($clusters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListClustersRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listClusters($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListClusters', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersExceptionTest() - { - $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 ListClustersRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listClusters($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 listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listInstances($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listInstances($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 listSupportedDatabaseFlagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); - $supportedDatabaseFlags = [ - $supportedDatabaseFlagsElement, - ]; - $expectedResponse = new ListSupportedDatabaseFlagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListSupportedDatabaseFlagsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listSupportedDatabaseFlags($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSupportedDatabaseFlagsExceptionTest() - { - $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 ListSupportedDatabaseFlagsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listSupportedDatabaseFlags($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 listUsersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $usersElement = new User(); - $users = [ - $usersElement, - ]; - $expectedResponse = new ListUsersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUsers($users); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new ListUsersRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listUsers($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListUsers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listUsersExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new ListUsersRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listUsers($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 promoteClusterTest() - { - $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/promoteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag2 = 'etag2-1293302904'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag2); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/promoteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new PromoteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->promoteCluster($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.alloydb.v1.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - $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 promoteClusterExceptionTest() - { - $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/promoteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $request = (new PromoteClusterRequest()) - ->setName($formattedName); - $response = $gapicClient->promoteCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - 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 restartInstanceTest() - { - $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/restartInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restartInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new RestartInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->restartInstance($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.alloydb.v1.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - $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 restartInstanceExceptionTest() - { - $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/restartInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $request = (new RestartInstanceRequest()) - ->setName($formattedName); - $response = $gapicClient->restartInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - 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 restoreClusterTest() - { - $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/restoreClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new RestoreClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->restoreCluster($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.alloydb.v1.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - $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 restoreClusterExceptionTest() - { - $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/restoreClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new RestoreClusterRequest()) - ->setParent($formattedParent) - ->setClusterId($clusterId) - ->setCluster($cluster); - $response = $gapicClient->restoreCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - 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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $request = (new UpdateBackupRequest()) - ->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.alloydb.v1.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $request = (new UpdateBackupRequest()) - ->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 updateClusterTest() - { - $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/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new UpdateClusterRequest()) - ->setCluster($cluster); - $response = $gapicClient->updateCluster($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.alloydb.v1.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - $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 updateClusterExceptionTest() - { - $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/updateClusterTest'); - $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 - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $request = (new UpdateClusterRequest()) - ->setCluster($cluster); - $response = $gapicClient->updateCluster($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - 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 updateInstanceTest() - { - $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/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $request = (new UpdateInstanceRequest()) - ->setInstance($instance); - $response = $gapicClient->updateInstance($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.alloydb.v1.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $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 updateInstanceExceptionTest() - { - $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/updateInstanceTest'); - $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 - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $request = (new UpdateInstanceRequest()) - ->setInstance($instance); - $response = $gapicClient->updateInstance($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - 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 updateUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $user = new User(); - $request = (new UpdateUserRequest()) - ->setUser($user); - $response = $gapicClient->updateUser($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.alloydb.v1.AlloyDBAdmin/UpdateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateUserExceptionTest() - { - $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 - $user = new User(); - $request = (new UpdateUserRequest()) - ->setUser($user); - try { - $gapicClient->updateUser($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 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 batchCreateInstancesAsyncTest() - { - $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/batchCreateInstancesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateInstancesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateInstancesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $request = (new BatchCreateInstancesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); - $response = $gapicClient->batchCreateInstancesAsync($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.alloydb.v1.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - $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()); - } -} diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Resources.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Resources.php deleted file mode 100644 index d666427d32b4f539552090cce38d5ee9be2d13ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12477 zcmds7&2t+^b~gZi01qStjYtZDWC@1lnD)w`4a*-3e-1uKK?VT`0I6`7*{LBg1ZOpz zfoBGiX&0}_R_!S{<&ayda@hYPm*kl19`>?TDg6OC_>jtb-93X(5+Ey=T^+>1O!u$5 zU%!6u_g=p*zv-Ry;O*3oW@@(TYMs>4S;{@pQa#&pt+r*Pj{3*Pnw@G}r#;=!>`W?E ztfi{8R;pAix8B08j@7r@S}xVKtgfMLwGFG^*-{O|I_n&5z5GZudME0Zt?_0~h5-YZ z>Z#`R)V7w|spoe!SM8{-dbqQtK%eAe^%#O4HkrT^tm7Zn0ykkD} zCpjeDffZXr!=>S=R`d=>;GcdCQErSBnsOq9*s-jf;mepV;LO;t7wDwMa&rDFUIX&FMr-DW(H-h_C`Y};o& zI#>nEJl4C?8mzoHb(9y{nL^f+uQvVrAjAeu%jU5q)!+s$TXg1&B$39lA6>r4QJ9Rs zDCsH0y^&wyiNh&5DA3SmB>y4G`e*rl*kpQ%jl>A3h)xE5##Vu*VST5a?emW5!$VkL zB3Xm@6bZZucXn#Eok~e5mbT@+N=qqK3yp(12`(Ox9>CqgUb9u(Ej5%~xhn6Jio*?p z>EDGQ(sT?VvTX=Ej-i}d9WJg|cI$Ex_+2yjw2R$nR|C=$h_qFOYYkJSSoXttfeI>D zRfd%QLjaZqw3L9gX0xK~){5hLumLgui(IMHp2q{pU^sw1;{N+a>DgYnQHlrImn2C3 zm;F+synUb)_N!6&gRsKfue1nY9&wN8mwxhQ@>% z&E_u`>QuDMa|YEENKf97j$w^VjdG+qT1P=Qs+n|*5({_;qS@{1j6v2vPjC$n?MXl~ zA@O}*MQrzMVys0r*3;{Z^-N$+jJF2MnyDTcT8Ewe@RQ*00s-kmSUqCGRbJ_4$9lyK zS~Ppd8`?Ac8P88kRk%51AKJ{iB*JXM8L!t=Ka&|)2!6o$=|D?uSZ&4u5=#gZK?}5G zs7IRNB$m-kM6=&q4m*8cD-5Azy7pP}1;j?TS^5Q9aaXlnh50KK2#vGhjpL%x&CsUR zj?v*uk6;BolcQM23Mn2lUa_&(*sgX=gCxr!P42h!F~ogUQjmD)7T<=;M4dc*7dEEv zr?d)-ZL4o`ueF%`0HQ++mZA_sL(gqIHGQcXeSS(Jx!~u4JfLM08lR6s#Ge^`P=uDG z|1|&`xKXZd_N~6dkD#!O6T0*U>C!z|v$eK`M*d7_lR|Q1CudPAPtzN6pV919^=5dM z=)u;;XUY87(-A+WqibXGh-M#o+dNB435NM)=@VEHQeg@s>`l@G@(&4ZJY%H1+Xn+N zn;t{ttj2f896EhGsTX26)Qh&!cQC-=x<~5@N}s}N&q8jCk<}H% z7fk=N1j_{uhd$J^Q^JqlV4Cy3w*}Mpa#$8j#%SNG5I^;3py!n14D5r;!N!=Ghj$Ye zhD6BdBXX^d?(_^*a4kkak&=dJ6G-JFe8V3@v~6qX;I6XA687r%FyIxvxUZO{8Puzz z8R&obSY&CV*_plMF;hH)1B%_s4BMh_V37h>jroXJ_7|56*+Xbj7cQj=tO%vzY&3yW zpUFl&9PxL+Mk^4fWC3}1MbObigdxt@{-Wq5s3^@XAk`seYA(hfFO)X-gl{szemvhQ ztGq9_svPl`uq+T0fKZYAW+K3jWeV<78l~@Q0^2{90)-+VOoen4QR*js2T|2DEy`;U z<6dDd?$i0^B@a3>4~o<=N~Yax>xOQ26RS8vnD0&rRz$)?Vc}Pdt$)V391h$FWdF|=!VrC&n=S0?Mpvx#esmJ|5ip$8VRhudN}mnRD$6?L|7OmU`T!(yvB-Kc#L#<+t(slI&zSU+ zTX181naHmEWpYUj1@g&HV0C06(nGjCB<7(G4r9CA16`3fCbJNqFby-fX8K!vQ zdIzFIJ_0#xqENvc0cHrMv;9V=$2aM^#w6eK@J zL1q{pPbecC(a_2tB32UcI%I`T0LbWBRLao;+FCHj-DiX>YI zUHu~UcM@xCN>>L^Vg36)g|52k=-m_7@%Ck%?aPehl0Tzogn_>pg!fkL61qO5`yC`U zmQPAJUz*|iJe*7eyVKo}0L1VPy@%TAV7TZcC?pb*#TZ|s_(t$Gk0cVSil7#bkVJ{e zZf=bkXNgZ?RYWF&x^cfg?;+V^QH{v*b&%X(D2!2K+cHfwnaE^V;I3Cp>pVO_Km((;sn z!p!iK0Oe)w!Y!`Zj%y=(R}9VUx+iQJtJ2%B!9QZSY9iawY~>U)J~&MZELT~UFrS13 zW+bLgCZB)}@7w4U@^|32G95el5MpDhjH06RJ0jwL3g8{juu^Qp!caE;^Enk@7$QSy z`E(8z=r3N1#HZxX(aVeL1N8F9AGT|B;ew0;)7ru0Pni9fs!@2oAlcgYecfgzowUue ziEW9q7m&Uk2}fubquKex5sDwKO4uHQG{xx7plsKodH;A_nm5et7}N8)-NHC|n?d#_ zxZU5vif1{QN5ku(auq2k62W=c9kEiSUaM7*jE<1KP#Tj+6aMlocvId-CMxI4m2&G~ z+6YK#e^sl>71S$ScB8a|_fq&PnET93&2zKJ$E>Abmk((ru$^8F<#WuWWC zvXx>9@Aiv4Z6fbs4F)EHD9aNAz#IxDWAGOGg!4bdzWWV(K{bry8cEi~!njGOvciTrk3>tXzS+BaOihk-pCgWm(wNnCe4=_{Qh?-Itrc!O?8uXY?Mwh^4$Auy6B zUhA_$f^hN?mbFZ502Y14$n?L$)T@{nUH?ateYiD6j8X<77!dKMjLb)~cfBn_HDpDd z8SMD!V;7z!gqUh9O$=j!?U^KCRIwoy`tQbaf&4ctIwKL;*|X^9ujT5@JL^YNrq?yBBh}av*WidPp3aY!u(fM_{H|XQ b{fJk-4;9K&icN1%DUxR`c`5rjoCEwH?ha2D diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Service.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Alpha/Service.php deleted file mode 100644 index f369ba222eebb357938e75c854aec380c81fd368..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16263 zcmds8No?HK84gF*_GHV_vn|WA9gpcOilEFyV>^z=Tc|ZkWLvQ0pbk_JoDn549+51` zk)s$wgEVaqMbV;5dMXMO-Ozi17U-eqsqvxc1{4*#qzh1>w*W;Cy|n+^xQR35j2)n9 z4zWG_-{b%N`}=>s%h&7;8=c9|>89>zp1zu|Z0EfVJ#RafXH~6QzEWRX)17?P+O&6`f*H<$A>)AP%xVX14?ovL2WuUpo7O)pk!R(-Xo)oRxEYNfa}q1EgSt?25` zmQmFUbX$Z>ZBut`t*Yne7ALRkp0=ua+R7Z=VP%T!u%fUXR$iS@$PSkfs@62u%`dT? z(0!DL|Ll6DW>oX8r+M(l6NalArr{Y{&3F^AT*|!7|sKx@j8b`pQk4*n4Zz z@{M4+&emo}?k@%H&1~AYa`1{lL2ceem3p~%$>Vf+#Sxr z($2|__Z10agy`>{byqisJIJ2+5b9bpYVg+Kee@la@CfR$oK@XXE8D}J{?GCbIvi!w zwIRUi_yX#wa@K*}uvwje!2 z!q-*HtZff>f%tnE$lpomFa!A!!WJ^(J=h3tj%^pP-L?tr7`Ag@c=UIbcs4bvzS4*= z58>JcKl)Qqg_T3>_hFPny^`&^2LJ)b01(BIAaGCJG+Y-_C{-#4_dNhNt=IGfaP7EC z)Oe_WGX4h9J}4H~Ss+Pg8KcfM3yRY)t6!DSkwwSawEnkvl|R*ijzCQV^<>;YrqF?k zR=r!dRaQCCu-R7{6DE?FA`6pr$r3HjUwRCG3=Kor@C>tV)m=5ZUk^2)bItdg@>j=p z{^-Y@$sW|jL@R$644EXHc@xql918rzcp;V;SDvPs@iacwATx>`KD5;M78r7jRh}F# zqFzJr&$HuG&6Vpj+gf`3w1hCEN3mLDqVtjbC?thaCG|oiL#EibcqvJd@*hDKEOCgR z1uyOEZ5Z_#T#B*8cm?%{CpbK|Np;2_0UkFE?xW@1Tk6z z!6~2lr^<^Am)rT-=60UAFV%|tV+kFf)V%6Ol;#lxfLBnD&n3&%X`z;4jH%a6GM*rH z%XiR;WcD9AD9B&SCGRa7H+UEg_zLkf2U;OaAHDc48uXvA1BmWIjY$gj#pbF?0wZ2n z5VBdKXByp|F+FE{#70LFAK*UJaaZ4F^*WwKolt<**)gTBbfIN7*h|Z~7bJN%hmIvM z$|&#x>Li%iL7~5NrOh`L$aXp&M7_G>SdO~suCp>7pGKYZCteX?@d7yR(M5F^D`=m$ zZIkniG}>QEaStIqU%tz*RNg|JjDsU+aA{dto>6b#SX!K!nxCDYnI3oy&UpQcGdHH^ zZ_KGvw`Sn^fP{NdC;WB#&Oi?DM?Lgscs|fU{xvZCID%0QR=2MFq{VitUfpx$1|91h#e4<90I2cEb0M3b>-ei!huqB)MQ-2@uV zEN$1#GUWB6vzk$}wshx1=WWlKgNT-&D?XP)c;0+nuX?juz2*u1FCnx>{;g8eCY_4@ zQdt;(ayh(rmjd0ASU8KULg-9v*{hbQ(6iZvd=B;cuLlDfnpJKuEUU|R7URyzk$viD?y^0wJBU^%rWq>8ulXUV!!hWHj_+}N|228>u&)T3+7Q+?S=Ay zdltys=02OdHtl_U36QZc9!1uU_G4#*Z0-mS#JVDZD&#Lp=rr-rrMhif4$SqYVZc_= zTz$5tt@{o;9dp=o)L{#Fyn(|e?v~MiWe6H_GnTlw-bTZ&U|J<(LBh4VM%d0)<0muO z$eZQ=NXValvQgNS?s&$UQH7#QcyfatM{3WvVRRir-L}4|R$YhpvO0$)(l0-c4piaw zs+be-%I=tmSbjTDjG%~1O2ll~Bvd7JZm8QTqa$??-zFcis`?wy-!|9vaM$%dIxQwQ z2?F41Ie`vRh6CBKa+b2zdN0WLQImnAGm|2X;)r6R1ZwS5>-%g}l8T;@A=xv#_&RAnpzlDxjvT1e2Ez zd>r+YQwnqiVMOS{5GSyo4txd;IjoJZuc}qj5v$ec*fcPp4mkex!9Ylbja|^-a5vOr zOy`pr4e;fvYwK0wRr0qaG(h6OZTKd@k3?r17;IssAtayM@nf%I2hYV66;%~F@^-BQ53WqS5_R0pqH}jx2`F;c?!+kW! zDuytm))n1WwNU!t9NMptk87qUmDNqd#6ObIeq!o;F6H8h=4KtH}BFEJx0KZgH$wvmg(X&oqi-J22{J)9PJ?PpR>DB!o!*U=MJy zIU50`;5*yYSblLYt7HP)fKi`M;CWY}12Ft&2_0ZQDR@m0S%g@yds5&FeRWXq^O?Lu z*}N>bF43|W_3kRim=eahu*IJc0v;$QP`6+|A&veOFfvyaL@5{}#2GPul46`LT@0*- zb6Uu#k`UHI0%Sdyz^0*ufOH@->%=K2Bg7d|ZZd-#3u!VVI&N?elreOKe-Ysqjr7YS zoS?a1NYKNJ3`KEDt1wEP5!LGy)m1s9yNsyHfPsu`%hH$+u(>h52auxk)HFy@>Wq-8 zdm&{EVr7R-djV3K$-R>kBa!&WANZ1p2+1V~iz4w=8L@p{qTm)}CGfSZ;Hq?n;filn zLO$1ieEAu89!Wl;CF!PlUW8bHPBHA*8lJ0eP)S_FS29W>oC1o57{&&9>jx6*gKQ*_ z;OCmFF+?h0Wb9qb3wt@w=5qntp)~eS@G53gKIHP~Vmpa?d_W2D@!cFc8gnI|{Bm>EHCUEW5MO65ct^heP=;5o#@z8y3Fhq_ zI-GRs#TT1PC237Yk$i!P58U*Ht1l<|!s z#VMlHtpUGPnhk&pBhFa+M0`5z9f!q6`z#V!5>z*%*Z6?l|7Bk*k&!p1_up#2cm zT44mAT@J)2VfcJ=+m6#`MEM3q`HCFUZW}1eYkY1Ou9Q;L2;Y|Uh2~>v$tXmc5!z>% z%iajPY&+PDU=&E<9So*`<7B@FN(xdi*n_0Z3k}e4%EuTn@{EY@QDwd?&jha84q#Fu z07Q>dVxp{2v?cspfHtL0tgwMxP!N4nLcLJsu$^(C zxrh0Lg6B;0ANkr|Hk&Dh^BAgr;2YlkEMss!Q)CsU6|AOIJ}e59<(5TR=JUK=-Z0LSuDHgI9ujNsm+3Q$TH0y|;cHBDcPgfxHxjF|lx%~nm} z{T$%2?2`>%m^LH48ndslknUQtuhvr22ND_~?wdI8a`Cn1F4TCX0Q+M58}LKZB2zcM z7N|QVEclbZ$hb0y5-_Yg)^JvZuQunn;X;8pMPyCZbHEw}e5C5~MD03@`velNo;lK(G{(1w=q8Knw}b zg~lkonOvaFU12F>A)9W`Qbt~WpbRBXUw@?(HayRE%f;fod-pga{*^$j?rnglz#Z;q zZI~6q1)R-ENWSC-x!^gmS2?+ViCyi6*0N_UO0Sg}nYh*mw++`V|6)13PTVc$Oxl%8 z{@=czJ26KulNY84BLz0^sucKT@(1Ga3cqa5Zktb6R^Ylhy|Dg|+$pv}xlDH`m)RDR ogoogle.cloud.alloydb.v1alpha.AutomatedBackupPolicy - */ -class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - */ - protected $enabled = null; - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - */ - protected $backup_window = null; - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - */ - protected $location = ''; - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - protected $schedule; - protected $retention; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule $weekly_schedule - * Weekly schedule for the Backup. - * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention $time_based_retention - * Time-based Backup retention policy. - * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention $quantity_based_retention - * Quantity-based Backup retention policy to retain recent backups. - * @type bool $enabled - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * @type \Google\Protobuf\Duration $backup_window - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * @type string $location - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels to apply to backups created using this configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Weekly schedule for the Backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; - * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule|null - */ - public function getWeeklySchedule() - { - return $this->readOneof(2); - } - - public function hasWeeklySchedule() - { - return $this->hasOneof(2); - } - - /** - * Weekly schedule for the Backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; - * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule $var - * @return $this - */ - public function setWeeklySchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\WeeklySchedule::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Time-based Backup retention policy. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; - * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention|null - */ - public function getTimeBasedRetention() - { - return $this->readOneof(4); - } - - public function hasTimeBasedRetention() - { - return $this->hasOneof(4); - } - - /** - * Time-based Backup retention policy. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; - * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention $var - * @return $this - */ - public function setTimeBasedRetention($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\TimeBasedRetention::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Quantity-based Backup retention policy to retain recent backups. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; - * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention|null - */ - public function getQuantityBasedRetention() - { - return $this->readOneof(5); - } - - public function hasQuantityBasedRetention() - { - return $this->hasOneof(5); - } - - /** - * Quantity-based Backup retention policy to retain recent backups. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; - * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention $var - * @return $this - */ - public function setQuantityBasedRetention($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy\QuantityBasedRetention::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - * @return bool - */ - public function getEnabled() - { - return isset($this->enabled) ? $this->enabled : false; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getBackupWindow() - { - return $this->backup_window; - } - - public function hasBackupWindow() - { - return isset($this->backup_window); - } - - public function clearBackupWindow() - { - unset($this->backup_window); - } - - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setBackupWindow($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->backup_window = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - * @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; - } - - /** - * @return string - */ - public function getSchedule() - { - return $this->whichOneof("schedule"); - } - - /** - * @return string - */ - public function getRetention() - { - return $this->whichOneof("retention"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php deleted file mode 100644 index 113d149b44f3..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/QuantityBasedRetention.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - */ -class QuantityBasedRetention extends \Google\Protobuf\Internal\Message -{ - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - */ - protected $count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $count - * The number of backups to retain. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - * @param int $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkInt32($var); - $this->count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QuantityBasedRetention::class, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy_QuantityBasedRetention::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php deleted file mode 100644 index 9285be82129f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/TimeBasedRetention.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - */ -class TimeBasedRetention extends \Google\Protobuf\Internal\Message -{ - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - */ - protected $retention_period = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $retention_period - * The retention period. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - * @return \Google\Protobuf\Duration|null - */ - public function getRetentionPeriod() - { - return $this->retention_period; - } - - public function hasRetentionPeriod() - { - return isset($this->retention_period); - } - - public function clearRetentionPeriod() - { - unset($this->retention_period); - } - - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRetentionPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->retention_period = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TimeBasedRetention::class, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy_TimeBasedRetention::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php deleted file mode 100644 index b9ab088ee67d..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/AutomatedBackupPolicy/WeeklySchedule.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - */ -class WeeklySchedule extends \Google\Protobuf\Internal\Message -{ - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - */ - private $start_times; - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - */ - private $days_of_week; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $start_times - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStartTimes() - { - return $this->start_times; - } - - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - * @param array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStartTimes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\TimeOfDay::class); - $this->start_times = $arr; - - return $this; - } - - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDaysOfWeek() - { - return $this->days_of_week; - } - - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDaysOfWeek($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); - $this->days_of_week = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(WeeklySchedule::class, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy_WeeklySchedule::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php deleted file mode 100644 index bce5253a4d57..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup.php +++ /dev/null @@ -1,951 +0,0 @@ -google.cloud.alloydb.v1alpha.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - */ - private $labels; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.Type type = 8; - */ - protected $type = 0; - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - */ - protected $description = ''; - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cluster_uid = ''; - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $cluster_name = ''; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - */ - private $annotations; - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $size_bytes = 0; - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expiry_time = null; - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expiry_quantity = null; - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 21; - */ - protected $satisfies_pzs = false; - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $database_version = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * @type string $display_name - * User-settable and human-readable display name for the Backup. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current state of the backup. - * @type int $type - * The backup type, which suggests the trigger for the backup. - * @type string $description - * User-provided description of the backup. - * @type string $cluster_uid - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * @type string $cluster_name - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $encryption_info - * Output only. The encryption information for the backup. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type int|string $size_bytes - * Output only. The size of the backup in bytes. - * @type \Google\Protobuf\Timestamp $expiry_time - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * @type \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry $expiry_quantity - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * @type bool $satisfies_pzs - * Reserved for future use. - * @type int $database_version - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - * @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 current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Backup\State::class); - $this->state = $var; - - return $this; - } - - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.Type type = 8; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.Type type = 8; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Backup\Type::class); - $this->type = $var; - - return $this; - } - - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getClusterUid() - { - return $this->cluster_uid; - } - - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setClusterUid($var) - { - GPBUtil::checkString($var, True); - $this->cluster_uid = $var; - - return $this; - } - - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getClusterName() - { - return $this->cluster_name; - } - - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setClusterName($var) - { - GPBUtil::checkString($var, True); - $this->cluster_name = $var; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getSizeBytes() - { - return $this->size_bytes; - } - - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setSizeBytes($var) - { - GPBUtil::checkInt64($var); - $this->size_bytes = $var; - - return $this; - } - - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpiryTime() - { - return $this->expiry_time; - } - - public function hasExpiryTime() - { - return isset($this->expiry_time); - } - - public function clearExpiryTime() - { - unset($this->expiry_time); - } - - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpiryTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expiry_time = $var; - - return $this; - } - - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry|null - */ - public function getExpiryQuantity() - { - return $this->expiry_quantity; - } - - public function hasExpiryQuantity() - { - return isset($this->expiry_quantity); - } - - public function clearExpiryQuantity() - { - unset($this->expiry_quantity); - } - - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry $var - * @return $this - */ - public function setExpiryQuantity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Backup\QuantityBasedExpiry::class); - $this->expiry_quantity = $var; - - return $this; - } - - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 21; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 21; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDatabaseVersion() - { - return $this->database_version; - } - - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDatabaseVersion($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\DatabaseVersion::class); - $this->database_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php deleted file mode 100644 index d9700614507c..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/QuantityBasedExpiry.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - */ -class QuantityBasedExpiry extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $retention_count = 0; - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $total_retention_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $retention_count - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * @type int $total_retention_count - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRetentionCount() - { - return $this->retention_count; - } - - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRetentionCount($var) - { - GPBUtil::checkInt32($var); - $this->retention_count = $var; - - return $this; - } - - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getTotalRetentionCount() - { - return $this->total_retention_count; - } - - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setTotalRetentionCount($var) - { - GPBUtil::checkInt32($var); - $this->total_retention_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QuantityBasedExpiry::class, \Google\Cloud\AlloyDb\V1alpha\Backup_QuantityBasedExpiry::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php deleted file mode 100644 index cb2114f4f8e2..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.alloydb.v1alpha.Backup.State - */ -class State -{ - /** - * The state of the backup is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The backup is ready. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The backup is creating. - * - * Generated from protobuf enum CREATING = 2; - */ - const CREATING = 2; - /** - * The backup failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The backup is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::CREATING => 'CREATING', - self::FAILED => 'FAILED', - self::DELETING => 'DELETING', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1alpha\Backup_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php deleted file mode 100644 index 5f953aa43d84..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Backup/Type.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.alloydb.v1alpha.Backup.Type - */ -class Type -{ - /** - * Backup Type is unknown. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * ON_DEMAND backups that were triggered by the customer (e.g., not - * AUTOMATED). - * - * Generated from protobuf enum ON_DEMAND = 1; - */ - const ON_DEMAND = 1; - /** - * AUTOMATED backups triggered by the automated backups scheduler pursuant - * to an automated backup policy. - * - * Generated from protobuf enum AUTOMATED = 2; - */ - const AUTOMATED = 2; - /** - * CONTINUOUS backups triggered by the automated backups scheduler - * due to a continuous backup policy. - * - * Generated from protobuf enum CONTINUOUS = 3; - */ - const CONTINUOUS = 3; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::ON_DEMAND => 'ON_DEMAND', - self::AUTOMATED => 'AUTOMATED', - self::CONTINUOUS => 'CONTINUOUS', - ]; - - 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(Type::class, \Google\Cloud\AlloyDb\V1alpha\Backup_Type::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php deleted file mode 100644 index 849d85f34994..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BackupSource.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.alloydb.v1alpha.BackupSource - */ -class BackupSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $backup_uid = ''; - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $backup_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $backup_uid - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * @type string $backup_name - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBackupUid() - { - return $this->backup_uid; - } - - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBackupUid($var) - { - GPBUtil::checkString($var, True); - $this->backup_uid = $var; - - return $this; - } - - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackupName() - { - return $this->backup_name; - } - - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackupName($var) - { - GPBUtil::checkString($var, True); - $this->backup_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php deleted file mode 100644 index 52ed601803b8..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - */ -class BatchCreateInstanceStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; - */ - protected $state = 0; - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - */ - protected $error_msg = ''; - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - */ - protected $error = null; - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * @type string $error_msg - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * @type \Google\Rpc\Status $error - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * @type int $type - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstanceStatus\State::class); - $this->state = $var; - - return $this; - } - - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - * @return string - */ - public function getErrorMsg() - { - return $this->error_msg; - } - - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - * @param string $var - * @return $this - */ - public function setErrorMsg($var) - { - GPBUtil::checkString($var, True); - $this->error_msg = $var; - - return $this; - } - - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType type = 3; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\InstanceType::class); - $this->type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php deleted file mode 100644 index 805f5c4f5d95..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstanceStatus/State.php +++ /dev/null @@ -1,97 +0,0 @@ -google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State - */ -class State -{ - /** - * The state of the instance is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Instance is pending creation and has not yet been picked up for - * processsing in the backend. - * - * Generated from protobuf enum PENDING_CREATE = 1; - */ - const PENDING_CREATE = 1; - /** - * The instance is active and running. - * - * Generated from protobuf enum READY = 2; - */ - const READY = 2; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 3; - */ - const CREATING = 3; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The creation of the instance failed or a fatal error occurred during - * an operation on the instance or a batch of instances. - * - * Generated from protobuf enum FAILED = 5; - */ - const FAILED = 5; - /** - * The instance was created successfully, but was rolled back and deleted - * due to some other failure during BatchCreateInstances operation. - * - * Generated from protobuf enum ROLLED_BACK = 6; - */ - const ROLLED_BACK = 6; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING_CREATE => 'PENDING_CREATE', - self::READY => 'READY', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::ROLLED_BACK => 'ROLLED_BACK', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstanceStatus_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php deleted file mode 100644 index 38316776ba6b..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesMetadata.php +++ /dev/null @@ -1,134 +0,0 @@ -google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - */ -class BatchCreateInstancesMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - */ - private $instance_targets; - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - */ - private $instance_statuses; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $instance_targets - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * @type array|\Google\Protobuf\Internal\MapField $instance_statuses - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstanceTargets() - { - return $this->instance_targets; - } - - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstanceTargets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->instance_targets = $arr; - - return $this; - } - - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getInstanceStatuses() - { - return $this->instance_statuses; - } - - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setInstanceStatuses($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstanceStatus::class); - $this->instance_statuses = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php deleted file mode 100644 index 89e196065983..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - */ -class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $requests = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. - * @type \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests $requests - * Required. Resources being created. - * @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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. - * - * 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 name of the parent resource. - * - * 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. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests|null - */ - public function getRequests() - { - return $this->requests; - } - - public function hasRequests() - { - return isset($this->requests); - } - - public function clearRequests() - { - unset($this->requests); - } - - /** - * Required. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests $var - * @return $this - */ - public function setRequests($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequests::class); - $this->requests = $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 = 3 [(.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 = 3 [(.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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php deleted file mode 100644 index 7ca68670a4de..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/BatchCreateInstancesResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - */ -class BatchCreateInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; - */ - private $instances; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * Created instances. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; - * @param array<\Google\Cloud\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Instance::class); - $this->instances = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php deleted file mode 100644 index 258d83ea51d9..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster.php +++ /dev/null @@ -1,1223 +0,0 @@ -google.cloud.alloydb.v1alpha.Cluster - */ -class Cluster extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - /** - * Output only. The current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cluster_type = 0; - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $database_version = 0; - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $network_config = null; - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @deprecated - */ - protected $network = ''; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - */ - private $annotations; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $initial_user = null; - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; - */ - protected $automated_backup_policy = null; - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; - * @deprecated - */ - protected $ssl_config = null; - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $continuous_backup_config = null; - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $continuous_backup_info = null; - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; - */ - protected $secondary_config = null; - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $primary_config = null; - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 30; - */ - protected $satisfies_pzs = false; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1alpha\BackupSource $backup_source - * Output only. Cluster created from backup. - * @type \Google\Cloud\AlloyDb\V1alpha\MigrationSource $migration_source - * Output only. Cluster created via DMS migration. - * @type string $name - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * @type string $display_name - * User-settable and human-readable display name for the Cluster. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current serving state of the cluster. - * @type int $cluster_type - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * @type int $database_version - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * @type \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig $network_config - * @type string $network - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * @type \Google\Cloud\AlloyDb\V1alpha\UserPassword $initial_user - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * @type \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy $automated_backup_policy - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * @type \Google\Cloud\AlloyDb\V1alpha\SslConfig $ssl_config - * SSL configuration for this AlloyDB cluster. - * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $encryption_info - * Output only. The encryption information for the cluster. - * @type \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig $continuous_backup_config - * Optional. Continuous backup configuration for this cluster. - * @type \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo $continuous_backup_info - * Output only. Continuous backup properties for this cluster. - * @type \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig $secondary_config - * Cross Region replication config specific to SECONDARY cluster. - * @type \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig $primary_config - * Output only. Cross Region replication config specific to PRIMARY cluster. - * @type bool $satisfies_pzs - * Reserved for future use. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Cluster created from backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\BackupSource|null - */ - public function getBackupSource() - { - return $this->readOneof(15); - } - - public function hasBackupSource() - { - return $this->hasOneof(15); - } - - /** - * Output only. Cluster created from backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\BackupSource $var - * @return $this - */ - public function setBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\BackupSource::class); - $this->writeOneof(15, $var); - - return $this; - } - - /** - * Output only. Cluster created via DMS migration. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\MigrationSource|null - */ - public function getMigrationSource() - { - return $this->readOneof(16); - } - - public function hasMigrationSource() - { - return $this->hasOneof(16); - } - - /** - * Output only. Cluster created via DMS migration. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\MigrationSource $var - * @return $this - */ - public function setMigrationSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\MigrationSource::class); - $this->writeOneof(16, $var); - - return $this; - } - - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @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 current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getClusterType() - { - return $this->cluster_type; - } - - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setClusterType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\ClusterType::class); - $this->cluster_type = $var; - - return $this; - } - - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDatabaseVersion() - { - return $this->database_version; - } - - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDatabaseVersion($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\DatabaseVersion::class); - $this->database_version = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - * @deprecated - */ - public function getNetwork() - { - @trigger_error('network is deprecated.', E_USER_DEPRECATED); - return $this->network; - } - - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - * @deprecated - */ - public function setNetwork($var) - { - @trigger_error('network is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\UserPassword|null - */ - public function getInitialUser() - { - return $this->initial_user; - } - - public function hasInitialUser() - { - return isset($this->initial_user); - } - - public function clearInitialUser() - { - unset($this->initial_user); - } - - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\UserPassword $var - * @return $this - */ - public function setInitialUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\UserPassword::class); - $this->initial_user = $var; - - return $this; - } - - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; - * @return \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy|null - */ - public function getAutomatedBackupPolicy() - { - return $this->automated_backup_policy; - } - - public function hasAutomatedBackupPolicy() - { - return isset($this->automated_backup_policy); - } - - public function clearAutomatedBackupPolicy() - { - unset($this->automated_backup_policy); - } - - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.AutomatedBackupPolicy automated_backup_policy = 17; - * @param \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy $var - * @return $this - */ - public function setAutomatedBackupPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\AutomatedBackupPolicy::class); - $this->automated_backup_policy = $var; - - return $this; - } - - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; - * @return \Google\Cloud\AlloyDb\V1alpha\SslConfig|null - * @deprecated - */ - public function getSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - return $this->ssl_config; - } - - public function hasSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - return isset($this->ssl_config); - } - - public function clearSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - unset($this->ssl_config); - } - - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; - * @param \Google\Cloud\AlloyDb\V1alpha\SslConfig $var - * @return $this - * @deprecated - */ - public function setSslConfig($var) - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig::class); - $this->ssl_config = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig|null - */ - public function getContinuousBackupConfig() - { - return $this->continuous_backup_config; - } - - public function hasContinuousBackupConfig() - { - return isset($this->continuous_backup_config); - } - - public function clearContinuousBackupConfig() - { - unset($this->continuous_backup_config); - } - - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig $var - * @return $this - */ - public function setContinuousBackupConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupConfig::class); - $this->continuous_backup_config = $var; - - return $this; - } - - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo|null - */ - public function getContinuousBackupInfo() - { - return $this->continuous_backup_info; - } - - public function hasContinuousBackupInfo() - { - return isset($this->continuous_backup_info); - } - - public function clearContinuousBackupInfo() - { - unset($this->continuous_backup_info); - } - - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo $var - * @return $this - */ - public function setContinuousBackupInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupInfo::class); - $this->continuous_backup_info = $var; - - return $this; - } - - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; - * @return \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig|null - */ - public function getSecondaryConfig() - { - return $this->secondary_config; - } - - public function hasSecondaryConfig() - { - return isset($this->secondary_config); - } - - public function clearSecondaryConfig() - { - unset($this->secondary_config); - } - - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; - * @param \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig $var - * @return $this - */ - public function setSecondaryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\SecondaryConfig::class); - $this->secondary_config = $var; - - return $this; - } - - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig|null - */ - public function getPrimaryConfig() - { - return $this->primary_config; - } - - public function hasPrimaryConfig() - { - return isset($this->primary_config); - } - - public function clearPrimaryConfig() - { - unset($this->primary_config); - } - - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig $var - * @return $this - */ - public function setPrimaryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster\PrimaryConfig::class); - $this->primary_config = $var; - - return $this; - } - - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 30; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 30; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php deleted file mode 100644 index fb3e38451206..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/ClusterType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1alpha.Cluster.ClusterType - */ -class ClusterType -{ - /** - * The type of the cluster is unknown. - * - * Generated from protobuf enum CLUSTER_TYPE_UNSPECIFIED = 0; - */ - const CLUSTER_TYPE_UNSPECIFIED = 0; - /** - * Primary cluster that support read and write operations. - * - * Generated from protobuf enum PRIMARY = 1; - */ - const PRIMARY = 1; - /** - * Secondary cluster that is replicating from another region. - * This only supports read. - * - * Generated from protobuf enum SECONDARY = 2; - */ - const SECONDARY = 2; - - private static $valueToName = [ - self::CLUSTER_TYPE_UNSPECIFIED => 'CLUSTER_TYPE_UNSPECIFIED', - self::PRIMARY => 'PRIMARY', - self::SECONDARY => 'SECONDARY', - ]; - - 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(ClusterType::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_ClusterType::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php deleted file mode 100644 index 12828836847a..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/NetworkConfig.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $network = ''; - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allocated_ip_range = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * @type string $allocated_ip_range - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAllocatedIpRange() - { - return $this->allocated_ip_range; - } - - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAllocatedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->allocated_ip_range = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NetworkConfig::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_NetworkConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php deleted file mode 100644 index 0d5f41ce6145..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/PrimaryConfig.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - */ -class PrimaryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $secondary_cluster_names; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_cluster_names - * Output only. Names of the clusters that are replicating from this - * cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecondaryClusterNames() - { - return $this->secondary_cluster_names; - } - - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecondaryClusterNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->secondary_cluster_names = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PrimaryConfig::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_PrimaryConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php deleted file mode 100644 index 85e186b7b42c..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/SecondaryConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - */ -class SecondaryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - */ - protected $primary_cluster_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $primary_cluster_name - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - * @return string - */ - public function getPrimaryClusterName() - { - return $this->primary_cluster_name; - } - - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - * @param string $var - * @return $this - */ - public function setPrimaryClusterName($var) - { - GPBUtil::checkString($var, True); - $this->primary_cluster_name = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SecondaryConfig::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_SecondaryConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php deleted file mode 100644 index ccaebbfd128a..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Cluster/State.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.alloydb.v1alpha.Cluster.State - */ -class State -{ - /** - * The state of the cluster is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The cluster is active and running. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The cluster is stopped. All instances in the cluster are stopped. - * Customers can start a stopped cluster at any point and all their - * instances will come back to life with same names and IP resources. In - * this state, customer pays for storage. - * Associated backups could also be present in a stopped cluster. - * - * Generated from protobuf enum STOPPED = 2; - */ - const STOPPED = 2; - /** - * The cluster is empty and has no associated resources. - * All instances, associated storage and backups have been deleted. - * - * Generated from protobuf enum EMPTY = 3; - */ - const PBEMPTY = 3; - /** - * The cluster is being created. - * - * Generated from protobuf enum CREATING = 4; - */ - const CREATING = 4; - /** - * The cluster is being deleted. - * - * Generated from protobuf enum DELETING = 5; - */ - const DELETING = 5; - /** - * The creation of the cluster failed. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * The cluster is bootstrapping with data from some other source. - * Direct mutations to the cluster (e.g. adding read pool) are not allowed. - * - * Generated from protobuf enum BOOTSTRAPPING = 7; - */ - const BOOTSTRAPPING = 7; - /** - * The cluster is under maintenance. AlloyDB regularly performs maintenance - * and upgrades on customer clusters. Updates on the cluster are - * not allowed while the cluster is in this state. - * - * Generated from protobuf enum MAINTENANCE = 8; - */ - const MAINTENANCE = 8; - /** - * The cluster is being promoted. - * - * Generated from protobuf enum PROMOTING = 9; - */ - const PROMOTING = 9; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::STOPPED => 'STOPPED', - self::PBEMPTY => 'EMPTY', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::BOOTSTRAPPING => 'BOOTSTRAPPING', - self::MAINTENANCE => 'MAINTENANCE', - self::PROMOTING => 'PROMOTING', - ]; - - 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)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\AlloyDb\V1alpha\Cluster_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php deleted file mode 100644 index b494dbbb0aa3..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ClusterView.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.alloydb.v1alpha.ClusterView - */ -class ClusterView -{ - /** - * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - * - * Generated from protobuf enum CLUSTER_VIEW_UNSPECIFIED = 0; - */ - const CLUSTER_VIEW_UNSPECIFIED = 0; - /** - * BASIC server responses include all the relevant cluster details, excluding - * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific - * fields. The default value. - * - * Generated from protobuf enum CLUSTER_VIEW_BASIC = 1; - */ - const CLUSTER_VIEW_BASIC = 1; - /** - * CONTINUOUS_BACKUP response returns all the fields from BASIC plus - * the earliest restorable time if continuous backups are enabled. - * May increase latency. - * - * Generated from protobuf enum CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; - */ - const CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; - - private static $valueToName = [ - self::CLUSTER_VIEW_UNSPECIFIED => 'CLUSTER_VIEW_UNSPECIFIED', - self::CLUSTER_VIEW_BASIC => 'CLUSTER_VIEW_BASIC', - self::CLUSTER_VIEW_CONTINUOUS_BACKUP => 'CLUSTER_VIEW_CONTINUOUS_BACKUP', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php deleted file mode 100644 index 07ab7dcfa02f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ConnectionInfo.php +++ /dev/null @@ -1,195 +0,0 @@ -google.cloud.alloydb.v1alpha.ConnectionInfo - */ -class ConnectionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $ip_address = ''; - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated - */ - private $pem_certificate_chain; - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $instance_uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * @type string $ip_address - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * @type string $instance_uid - * Output only. The unique ID of the Instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getPemCertificateChain() - { - @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); - return $this->pem_certificate_chain; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setPemCertificateChain($var) - { - @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->pem_certificate_chain = $arr; - - return $this; - } - - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getInstanceUid() - { - return $this->instance_uid; - } - - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setInstanceUid($var) - { - GPBUtil::checkString($var, True); - $this->instance_uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php deleted file mode 100644 index 97fcd1aae35d..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupConfig.php +++ /dev/null @@ -1,176 +0,0 @@ -google.cloud.alloydb.v1alpha.ContinuousBackupConfig - */ -class ContinuousBackupConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - */ - protected $enabled = null; - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - */ - protected $recovery_window_days = 0; - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; - */ - protected $encryption_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enabled - * Whether ContinuousBackup is enabled. - * @type int $recovery_window_days - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $encryption_config - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - * @return bool - */ - public function getEnabled() - { - return isset($this->enabled) ? $this->enabled : false; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - * @return int - */ - public function getRecoveryWindowDays() - { - return $this->recovery_window_days; - } - - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - * @param int $var - * @return $this - */ - public function setRecoveryWindowDays($var) - { - GPBUtil::checkInt32($var); - $this->recovery_window_days = $var; - - return $this; - } - - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; - * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionConfig encryption_config = 3; - * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php deleted file mode 100644 index ec1861fc8ef7..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupInfo.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.alloydb.v1alpha.ContinuousBackupInfo - */ -class ContinuousBackupInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $enabled_time = null; - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $schedule; - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $earliest_restorable_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $encryption_info - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * @type \Google\Protobuf\Timestamp $enabled_time - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * @type array|\Google\Protobuf\Internal\RepeatedField $schedule - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * @type \Google\Protobuf\Timestamp $earliest_restorable_time - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEnabledTime() - { - return $this->enabled_time; - } - - public function hasEnabledTime() - { - return isset($this->enabled_time); - } - - public function clearEnabledTime() - { - unset($this->enabled_time); - } - - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEnabledTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->enabled_time = $var; - - return $this; - } - - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSchedule() - { - return $this->schedule; - } - - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSchedule($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); - $this->schedule = $arr; - - return $this; - } - - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEarliestRestorableTime() - { - return $this->earliest_restorable_time; - } - - public function hasEarliestRestorableTime() - { - return isset($this->earliest_restorable_time); - } - - public function clearEarliestRestorableTime() - { - unset($this->earliest_restorable_time); - } - - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEarliestRestorableTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->earliest_restorable_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php deleted file mode 100644 index 81a495e66d86..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ContinuousBackupSource.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.alloydb.v1alpha.ContinuousBackupSource - */ -class ContinuousBackupSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = ''; - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $point_in_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cluster - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * @type \Google\Protobuf\Timestamp $point_in_time - * Required. The point in time to restore to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCluster() - { - return $this->cluster; - } - - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkString($var, True); - $this->cluster = $var; - - return $this; - } - - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPointInTime() - { - return $this->point_in_time; - } - - public function hasPointInTime() - { - return isset($this->point_in_time); - } - - public function clearPointInTime() - { - unset($this->point_in_time); - } - - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPointInTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->point_in_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php deleted file mode 100644 index 4820325840a1..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateBackupRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -google.cloud.alloydb.v1alpha.CreateBackupRequest - */ -class CreateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Value for parent. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup = 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Value for parent. - * @type string $backup_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1alpha\Backup $backup - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Value for parent. - * - * 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. Value for parent. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBackupId() - { - return $this->backup_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBackupId($var) - { - GPBUtil::checkString($var, True); - $this->backup_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Backup::class); - $this->backup = $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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php deleted file mode 100644 index 758b0dc83a8f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateClusterRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.alloydb.v1alpha.CreateClusterRequest - */ -class CreateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * 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 location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); - $this->cluster = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php deleted file mode 100644 index abfc159d2310..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.alloydb.v1alpha.CreateInstanceRequest - */ -class CreateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @type string $instance_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance $instance - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance::class); - $this->instance = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php deleted file mode 100644 index c54bd2203db5..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateInstanceRequests.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1alpha.CreateInstanceRequests - */ -class CreateInstanceRequests extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $create_instance_requests; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $create_instance_requests - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCreateInstanceRequests() - { - return $this->create_instance_requests; - } - - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCreateInstanceRequests($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\CreateInstanceRequest::class); - $this->create_instance_requests = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php deleted file mode 100644 index 2b71e6a4fda9..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryClusterRequest.php +++ /dev/null @@ -1,263 +0,0 @@ -google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - */ -class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object (the secondary cluster). - * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster - * Required. Configuration of the requesting object (the secondary cluster). - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * 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 location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * 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. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); - $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php deleted file mode 100644 index 853cb6456819..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateSecondaryInstanceRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - */ -class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @type string $instance_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance $instance - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance::class); - $this->instance = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php deleted file mode 100644 index b08ef823dff2..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/CreateUserRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -google.cloud.alloydb.v1alpha.CreateUserRequest - */ -class CreateUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Value for parent. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user = 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Value for parent. - * @type string $user_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1alpha\User $user - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Value for parent. - * - * 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. Value for parent. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUserId() - { - return $this->user_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUserId($var) - { - GPBUtil::checkString($var, True); - $this->user_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\User|null - */ - public function getUser() - { - return $this->user; - } - - public function hasUser() - { - return isset($this->user); - } - - public function clearUser() - { - unset($this->user); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\User $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\User::class); - $this->user = $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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php deleted file mode 100644 index c451ba37c278..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DatabaseVersion.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.alloydb.v1alpha.DatabaseVersion - */ -class DatabaseVersion -{ - /** - * This is an unknown database version. - * - * Generated from protobuf enum DATABASE_VERSION_UNSPECIFIED = 0; - */ - const DATABASE_VERSION_UNSPECIFIED = 0; - /** - * DEPRECATED - The database version is Postgres 13. - * - * Generated from protobuf enum POSTGRES_13 = 1 [deprecated = true]; - */ - const POSTGRES_13 = 1; - /** - * The database version is Postgres 14. - * - * Generated from protobuf enum POSTGRES_14 = 2; - */ - const POSTGRES_14 = 2; - /** - * The database version is Postgres 15. - * - * Generated from protobuf enum POSTGRES_15 = 3; - */ - const POSTGRES_15 = 3; - - private static $valueToName = [ - self::DATABASE_VERSION_UNSPECIFIED => 'DATABASE_VERSION_UNSPECIFIED', - self::POSTGRES_13 => 'POSTGRES_13', - self::POSTGRES_14 => 'POSTGRES_14', - self::POSTGRES_15 => 'POSTGRES_15', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php deleted file mode 100644 index b8b0c1eb20f9..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteBackupRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.alloydb.v1alpha.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * - * 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type string $etag - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * - * 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. For the required format, see the comment on - * the Backup.name field. - * - * 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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php deleted file mode 100644 index 95797925a3af..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteClusterRequest.php +++ /dev/null @@ -1,259 +0,0 @@ -google.cloud.alloydb.v1alpha.DeleteClusterRequest - */ -class DeleteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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 = ''; - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $force = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @type bool $force - * Optional. Whether to cascade delete child instances for given cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php deleted file mode 100644 index 48157d8dd4f4..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteInstanceRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.alloydb.v1alpha.DeleteInstanceRequest - */ -class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type string $etag - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php deleted file mode 100644 index ce3b7ef1a424..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/DeleteUserRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.alloydb.v1alpha.DeleteUserRequest - */ -class DeleteUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php deleted file mode 100644 index 35dd0478dce4..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionConfig.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1alpha.EncryptionConfig - */ -class EncryptionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - */ - protected $kms_key_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key_name - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php deleted file mode 100644 index 7d838620487d..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1alpha.EncryptionInfo - */ -class EncryptionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_type = 0; - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $kms_key_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $encryption_type - * Output only. Type of encryption. - * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_versions - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getEncryptionType() - { - return $this->encryption_type; - } - - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setEncryptionType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo\Type::class); - $this->encryption_type = $var; - - return $this; - } - - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKmsKeyVersions() - { - return $this->kms_key_versions; - } - - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKmsKeyVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->kms_key_versions = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php deleted file mode 100644 index 91bf8c965574..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/EncryptionInfo/Type.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.alloydb.v1alpha.EncryptionInfo.Type - */ -class Type -{ - /** - * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * The data is encrypted at rest with a key that is fully managed by Google. - * No key version will be populated. This is the default state. - * - * Generated from protobuf enum GOOGLE_DEFAULT_ENCRYPTION = 1; - */ - const GOOGLE_DEFAULT_ENCRYPTION = 1; - /** - * The data is encrypted at rest with a key that is managed by the customer. - * KMS key versions will be populated. - * - * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 2; - */ - const CUSTOMER_MANAGED_ENCRYPTION = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::GOOGLE_DEFAULT_ENCRYPTION => 'GOOGLE_DEFAULT_ENCRYPTION', - self::CUSTOMER_MANAGED_ENCRYPTION => 'CUSTOMER_MANAGED_ENCRYPTION', - ]; - - 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(Type::class, \Google\Cloud\AlloyDb\V1alpha\EncryptionInfo_Type::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php deleted file mode 100644 index 988fd61608e5..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/FailoverInstanceRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.alloydb.v1alpha.FailoverInstanceRequest - */ -class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php deleted file mode 100644 index ca404e21d3e2..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateRequest.php +++ /dev/null @@ -1,321 +0,0 @@ -google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - */ -class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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 = ''; - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * - * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $pem_csr = ''; - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $cert_duration = null; - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $public_key = ''; - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $use_metadata_exchange = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @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). - * @type string $pem_csr - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * @type \Google\Protobuf\Duration $cert_duration - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * @type string $public_key - * Optional. The public key from the client. - * @type bool $use_metadata_exchange - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * 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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * 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. 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; - } - - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * - * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return string - * @deprecated - */ - public function getPemCsr() - { - @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); - return $this->pem_csr; - } - - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * - * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - * @deprecated - */ - public function setPemCsr($var) - { - @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->pem_csr = $var; - - return $this; - } - - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getCertDuration() - { - return $this->cert_duration; - } - - public function hasCertDuration() - { - return isset($this->cert_duration); - } - - public function clearCertDuration() - { - unset($this->cert_duration); - } - - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setCertDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->cert_duration = $var; - - return $this; - } - - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPublicKey() - { - return $this->public_key; - } - - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPublicKey($var) - { - GPBUtil::checkString($var, True); - $this->public_key = $var; - - return $this; - } - - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUseMetadataExchange() - { - return $this->use_metadata_exchange; - } - - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUseMetadataExchange($var) - { - GPBUtil::checkBool($var); - $this->use_metadata_exchange = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php deleted file mode 100644 index 2e9cea857d81..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GenerateClientCertificateResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - */ -class GenerateClientCertificateResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The pem-encoded, signed X.509 certificate. - * - * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $pem_certificate = ''; - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $pem_certificate_chain; - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ca_cert = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $pem_certificate - * Output only. The pem-encoded, signed X.509 certificate. - * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * @type string $ca_cert - * Optional. The pem-encoded cluster ca X.509 certificate. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The pem-encoded, signed X.509 certificate. - * - * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPemCertificate() - { - return $this->pem_certificate; - } - - /** - * Output only. The pem-encoded, signed X.509 certificate. - * - * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPemCertificate($var) - { - GPBUtil::checkString($var, True); - $this->pem_certificate = $var; - - return $this; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPemCertificateChain() - { - return $this->pem_certificate_chain; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPemCertificateChain($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->pem_certificate_chain = $arr; - - return $this; - } - - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCaCert() - { - return $this->ca_cert; - } - - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCaCert($var) - { - GPBUtil::checkString($var, True); - $this->ca_cert = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php deleted file mode 100644 index 41131a0add13..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetBackupRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.alloydb.v1alpha.GetBackupRequest - */ -class GetBackupRequest 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 = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::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; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php deleted file mode 100644 index 5cee7559048f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetClusterRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.alloydb.v1alpha.GetClusterRequest - */ -class GetClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @type int $view - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\ClusterView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php deleted file mode 100644 index 9cd7eb1c16c1..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetConnectionInfoRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - */ -class GetConnectionInfoRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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 = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * 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 name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * 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. 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php deleted file mode 100644 index 98eaade41c89..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetInstanceRequest.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1alpha.GetInstanceRequest - */ -class GetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.InstanceView view = 2; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @type int $view - * The view of the instance to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.InstanceView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.InstanceView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\InstanceView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php deleted file mode 100644 index 63713ddc1371..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/GetUserRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1alpha.GetUserRequest - */ -class GetUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php deleted file mode 100644 index 96ba7b2d392d..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.alloydb.v1alpha.InjectFaultRequest - */ -class InjectFaultRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $fault_type = 0; - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $fault_type - * Required. The type of fault to be injected in an instance. - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getFaultType() - { - return $this->fault_type; - } - - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setFaultType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\InjectFaultRequest\FaultType::class); - $this->fault_type = $var; - - return $this; - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php deleted file mode 100644 index 891e891b310f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InjectFaultRequest/FaultType.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType - */ -class FaultType -{ - /** - * The fault type is unknown. - * - * Generated from protobuf enum FAULT_TYPE_UNSPECIFIED = 0; - */ - const FAULT_TYPE_UNSPECIFIED = 0; - /** - * Stop the VM - * - * Generated from protobuf enum STOP_VM = 1; - */ - const STOP_VM = 1; - - private static $valueToName = [ - self::FAULT_TYPE_UNSPECIFIED => 'FAULT_TYPE_UNSPECIFIED', - self::STOP_VM => 'STOP_VM', - ]; - - 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(FaultType::class, \Google\Cloud\AlloyDb\V1alpha\InjectFaultRequest_FaultType::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php deleted file mode 100644 index 4fe821be9c40..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance.php +++ /dev/null @@ -1,1112 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance - */ -class Instance extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - /** - * Output only. The current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_type = 0; - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; - */ - protected $machine_config = null; - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; - */ - protected $availability_type = 0; - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - */ - protected $gce_zone = ''; - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - */ - private $database_flags; - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $writable_node = null; - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $nodes; - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - */ - protected $query_insights_config = null; - /** - * Read pool specific config. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; - */ - protected $read_pool_config = null; - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $ip_address = ''; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - */ - private $annotations; - /** - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; - */ - protected $update_policy = null; - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $client_connection_config = null; - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 24; - */ - protected $satisfies_pzs = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * @type string $display_name - * User-settable and human-readable display name for the Instance. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current serving state of the instance. - * @type int $instance_type - * Required. The type of the instance. Specified at creation time. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig $machine_config - * Configurations for the machines that host the underlying - * database engine. - * @type int $availability_type - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * @type string $gce_zone - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * @type array|\Google\Protobuf\Internal\MapField $database_flags - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance\Node $writable_node - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * @type array<\Google\Cloud\AlloyDb\V1alpha\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $nodes - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig $query_insights_config - * Configuration for query insights. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig $read_pool_config - * Read pool specific config. - * @type string $ip_address - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy $update_policy - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig $client_connection_config - * Optional. Client connection specific configurations - * @type bool $satisfies_pzs - * Reserved for future use. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @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 current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\State::class); - $this->state = $var; - - return $this; - } - - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getInstanceType() - { - return $this->instance_type; - } - - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setInstanceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\InstanceType::class); - $this->instance_type = $var; - - return $this; - } - - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig|null - */ - public function getMachineConfig() - { - return $this->machine_config; - } - - public function hasMachineConfig() - { - return isset($this->machine_config); - } - - public function clearMachineConfig() - { - unset($this->machine_config); - } - - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.MachineConfig machine_config = 10; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig $var - * @return $this - */ - public function setMachineConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\MachineConfig::class); - $this->machine_config = $var; - - return $this; - } - - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; - * @return int - */ - public function getAvailabilityType() - { - return $this->availability_type; - } - - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; - * @param int $var - * @return $this - */ - public function setAvailabilityType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\AvailabilityType::class); - $this->availability_type = $var; - - return $this; - } - - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - * @return string - */ - public function getGceZone() - { - return $this->gce_zone; - } - - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - * @param string $var - * @return $this - */ - public function setGceZone($var) - { - GPBUtil::checkString($var, True); - $this->gce_zone = $var; - - return $this; - } - - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDatabaseFlags() - { - return $this->database_flags; - } - - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDatabaseFlags($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->database_flags = $arr; - - return $this; - } - - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance\Node|null - */ - public function getWritableNode() - { - return $this->writable_node; - } - - public function hasWritableNode() - { - return isset($this->writable_node); - } - - public function clearWritableNode() - { - unset($this->writable_node); - } - - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance\Node $var - * @return $this - */ - public function setWritableNode($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\Node::class); - $this->writable_node = $var; - - return $this; - } - - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNodes() - { - return $this->nodes; - } - - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\AlloyDb\V1alpha\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Instance\Node::class); - $this->nodes = $arr; - - return $this; - } - - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig|null - */ - public function getQueryInsightsConfig() - { - return $this->query_insights_config; - } - - public function hasQueryInsightsConfig() - { - return isset($this->query_insights_config); - } - - public function clearQueryInsightsConfig() - { - unset($this->query_insights_config); - } - - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig $var - * @return $this - */ - public function setQueryInsightsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\QueryInsightsInstanceConfig::class); - $this->query_insights_config = $var; - - return $this; - } - - /** - * Read pool specific config. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig|null - */ - public function getReadPoolConfig() - { - return $this->read_pool_config; - } - - public function hasReadPoolConfig() - { - return isset($this->read_pool_config); - } - - public function clearReadPoolConfig() - { - unset($this->read_pool_config); - } - - /** - * Read pool specific config. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig read_pool_config = 14; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig $var - * @return $this - */ - public function setReadPoolConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\ReadPoolConfig::class); - $this->read_pool_config = $var; - - return $this; - } - - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy|null - */ - public function getUpdatePolicy() - { - return $this->update_policy; - } - - public function hasUpdatePolicy() - { - return isset($this->update_policy); - } - - public function clearUpdatePolicy() - { - unset($this->update_policy); - } - - /** - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy $var - * @return $this - */ - public function setUpdatePolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy::class); - $this->update_policy = $var; - - return $this; - } - - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig|null - */ - public function getClientConnectionConfig() - { - return $this->client_connection_config; - } - - public function hasClientConnectionConfig() - { - return isset($this->client_connection_config); - } - - public function clearClientConnectionConfig() - { - unset($this->client_connection_config); - } - - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig $var - * @return $this - */ - public function setClientConnectionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance\ClientConnectionConfig::class); - $this->client_connection_config = $var; - - return $this; - } - - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 24; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 24; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php deleted file mode 100644 index 5776d323dde0..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/AvailabilityType.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.AvailabilityType - */ -class AvailabilityType -{ - /** - * This is an unknown Availability type. - * - * Generated from protobuf enum AVAILABILITY_TYPE_UNSPECIFIED = 0; - */ - const AVAILABILITY_TYPE_UNSPECIFIED = 0; - /** - * Zonal available instance. - * - * Generated from protobuf enum ZONAL = 1; - */ - const ZONAL = 1; - /** - * Regional (or Highly) available instance. - * - * Generated from protobuf enum REGIONAL = 2; - */ - const REGIONAL = 2; - - private static $valueToName = [ - self::AVAILABILITY_TYPE_UNSPECIFIED => 'AVAILABILITY_TYPE_UNSPECIFIED', - self::ZONAL => 'ZONAL', - self::REGIONAL => 'REGIONAL', - ]; - - 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(AvailabilityType::class, \Google\Cloud\AlloyDb\V1alpha\Instance_AvailabilityType::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php deleted file mode 100644 index 14ecee7f2bd3..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ClientConnectionConfig.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - */ -class ClientConnectionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $require_connectors = false; - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ssl_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $require_connectors - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * @type \Google\Cloud\AlloyDb\V1alpha\SslConfig $ssl_config - * Optional. SSL config option for this instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getRequireConnectors() - { - return $this->require_connectors; - } - - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setRequireConnectors($var) - { - GPBUtil::checkBool($var); - $this->require_connectors = $var; - - return $this; - } - - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1alpha\SslConfig|null - */ - public function getSslConfig() - { - return $this->ssl_config; - } - - public function hasSslConfig() - { - return isset($this->ssl_config); - } - - public function clearSslConfig() - { - unset($this->ssl_config); - } - - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1alpha\SslConfig $var - * @return $this - */ - public function setSslConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig::class); - $this->ssl_config = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ClientConnectionConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_ClientConnectionConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php deleted file mode 100644 index 6031f901d1fa..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/InstanceType.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.InstanceType - */ -class InstanceType -{ - /** - * The type of the instance is unknown. - * - * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; - */ - const INSTANCE_TYPE_UNSPECIFIED = 0; - /** - * PRIMARY instances support read and write operations. - * - * Generated from protobuf enum PRIMARY = 1; - */ - const PRIMARY = 1; - /** - * READ POOL instances support read operations only. Each read pool instance - * consists of one or more homogeneous nodes. - * * Read pool of size 1 can only have zonal availability. - * * Read pools with node count of 2 or more can have regional - * availability (nodes are present in 2 or more zones in a region). - * - * Generated from protobuf enum READ_POOL = 2; - */ - const READ_POOL = 2; - /** - * SECONDARY instances support read operations only. SECONDARY instance - * is a cross-region read replica - * - * Generated from protobuf enum SECONDARY = 3; - */ - const SECONDARY = 3; - - private static $valueToName = [ - self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', - self::PRIMARY => 'PRIMARY', - self::READ_POOL => 'READ_POOL', - self::SECONDARY => 'SECONDARY', - ]; - - 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\AlloyDb\V1alpha\Instance_InstanceType::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php deleted file mode 100644 index 655df1f93235..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/MachineConfig.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.MachineConfig - */ -class MachineConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - */ - protected $cpu_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $cpu_count - * The number of CPU's in the VM instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - * @return int - */ - public function getCpuCount() - { - return $this->cpu_count; - } - - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - * @param int $var - * @return $this - */ - public function setCpuCount($var) - { - GPBUtil::checkInt32($var); - $this->cpu_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MachineConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_MachineConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php deleted file mode 100644 index 7614f7c0d9b7..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/Node.php +++ /dev/null @@ -1,186 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.Node - */ -class Node extends \Google\Protobuf\Internal\Message -{ - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - */ - protected $zone_id = ''; - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - */ - protected $id = ''; - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - */ - protected $ip = ''; - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - */ - protected $state = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $zone_id - * The Compute Engine zone of the VM e.g. "us-central1-b". - * @type string $id - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * @type string $ip - * The private IP address of the VM e.g. "10.57.0.34". - * @type string $state - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - * @return string - */ - public function getZoneId() - { - return $this->zone_id; - } - - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - * @param string $var - * @return $this - */ - public function setZoneId($var) - { - GPBUtil::checkString($var, True); - $this->zone_id = $var; - - return $this; - } - - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - * @return string - */ - public function getIp() - { - return $this->ip; - } - - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - * @param string $var - * @return $this - */ - public function setIp($var) - { - GPBUtil::checkString($var, True); - $this->ip = $var; - - return $this; - } - - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - * @param string $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkString($var, True); - $this->state = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Node::class, \Google\Cloud\AlloyDb\V1alpha\Instance_Node::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php deleted file mode 100644 index cc86f298b500..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/QueryInsightsInstanceConfig.php +++ /dev/null @@ -1,222 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - */ -class QueryInsightsInstanceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - */ - protected $record_application_tags = null; - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - */ - protected $record_client_address = null; - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - */ - protected $query_string_length = 0; - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - */ - protected $query_plans_per_minute = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $record_application_tags - * Record application tags for an instance. - * This flag is turned "on" by default. - * @type bool $record_client_address - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * @type int $query_string_length - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * @type int $query_plans_per_minute - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - * @return bool - */ - public function getRecordApplicationTags() - { - return isset($this->record_application_tags) ? $this->record_application_tags : false; - } - - public function hasRecordApplicationTags() - { - return isset($this->record_application_tags); - } - - public function clearRecordApplicationTags() - { - unset($this->record_application_tags); - } - - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - * @param bool $var - * @return $this - */ - public function setRecordApplicationTags($var) - { - GPBUtil::checkBool($var); - $this->record_application_tags = $var; - - return $this; - } - - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - * @return bool - */ - public function getRecordClientAddress() - { - return isset($this->record_client_address) ? $this->record_client_address : false; - } - - public function hasRecordClientAddress() - { - return isset($this->record_client_address); - } - - public function clearRecordClientAddress() - { - unset($this->record_client_address); - } - - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - * @param bool $var - * @return $this - */ - public function setRecordClientAddress($var) - { - GPBUtil::checkBool($var); - $this->record_client_address = $var; - - return $this; - } - - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - * @return int - */ - public function getQueryStringLength() - { - return $this->query_string_length; - } - - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - * @param int $var - * @return $this - */ - public function setQueryStringLength($var) - { - GPBUtil::checkUint32($var); - $this->query_string_length = $var; - - return $this; - } - - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - * @return int - */ - public function getQueryPlansPerMinute() - { - return isset($this->query_plans_per_minute) ? $this->query_plans_per_minute : 0; - } - - public function hasQueryPlansPerMinute() - { - return isset($this->query_plans_per_minute); - } - - public function clearQueryPlansPerMinute() - { - unset($this->query_plans_per_minute); - } - - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - * @param int $var - * @return $this - */ - public function setQueryPlansPerMinute($var) - { - GPBUtil::checkUint32($var); - $this->query_plans_per_minute = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryInsightsInstanceConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_QueryInsightsInstanceConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php deleted file mode 100644 index bab7bd31c641..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/ReadPoolConfig.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - */ -class ReadPoolConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - */ - protected $node_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $node_count - * Read capacity, i.e. number of nodes in a read pool instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - * @return int - */ - public function getNodeCount() - { - return $this->node_count; - } - - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - * @param int $var - * @return $this - */ - public function setNodeCount($var) - { - GPBUtil::checkInt32($var); - $this->node_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReadPoolConfig::class, \Google\Cloud\AlloyDb\V1alpha\Instance_ReadPoolConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php deleted file mode 100644 index 9f54198a1d9e..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/State.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.State - */ -class State -{ - /** - * The state of the instance is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The instance is active and running. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The instance is stopped. Instance name and IP resources are preserved. - * - * Generated from protobuf enum STOPPED = 2; - */ - const STOPPED = 2; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 3; - */ - const CREATING = 3; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The instance is down for maintenance. - * - * Generated from protobuf enum MAINTENANCE = 5; - */ - const MAINTENANCE = 5; - /** - * The creation of the instance failed or a fatal error occurred during - * an operation on the instance. - * Note: Instances in this state would tried to be auto-repaired. And - * Customers should be able to restart, update or delete these instances. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that - * index unused in case that state also needs to exposed via consumer apis - * in future. - * The instance has been configured to sync data from some other source. - * - * Generated from protobuf enum BOOTSTRAPPING = 8; - */ - const BOOTSTRAPPING = 8; - /** - * The instance is being promoted. - * - * Generated from protobuf enum PROMOTING = 9; - */ - const PROMOTING = 9; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::STOPPED => 'STOPPED', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::MAINTENANCE => 'MAINTENANCE', - self::FAILED => 'FAILED', - self::BOOTSTRAPPING => 'BOOTSTRAPPING', - self::PROMOTING => 'PROMOTING', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1alpha\Instance_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php deleted file mode 100644 index 16e871196953..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - */ -class UpdatePolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Mode for updating the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; - */ - protected $mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $mode - * Mode for updating the instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Mode for updating the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Mode for updating the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\Instance\UpdatePolicy\Mode::class); - $this->mode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UpdatePolicy::class, \Google\Cloud\AlloyDb\V1alpha\Instance_UpdatePolicy::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php deleted file mode 100644 index 80aa40437feb..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/Instance/UpdatePolicy/Mode.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode - */ -class Mode -{ - /** - * Mode is unknown. - * - * Generated from protobuf enum MODE_UNSPECIFIED = 0; - */ - const MODE_UNSPECIFIED = 0; - /** - * Least disruptive way to apply the update. - * - * Generated from protobuf enum DEFAULT = 1; - */ - const PBDEFAULT = 1; - /** - * Performs a forced update when applicable. This will be fast but may - * incur a downtime. - * - * Generated from protobuf enum FORCE_APPLY = 2; - */ - const FORCE_APPLY = 2; - - private static $valueToName = [ - self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', - self::PBDEFAULT => 'DEFAULT', - self::FORCE_APPLY => 'FORCE_APPLY', - ]; - - 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)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Mode::class, \Google\Cloud\AlloyDb\V1alpha\Instance_UpdatePolicy_Mode::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php deleted file mode 100644 index 823659026d58..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/InstanceView.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1alpha.InstanceView - */ -class InstanceView -{ - /** - * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - * - * Generated from protobuf enum INSTANCE_VIEW_UNSPECIFIED = 0; - */ - const INSTANCE_VIEW_UNSPECIFIED = 0; - /** - * BASIC server responses for a primary or read instance include all the - * relevant instance details, excluding the details of each node in the - * instance. The default value. - * - * Generated from protobuf enum INSTANCE_VIEW_BASIC = 1; - */ - const INSTANCE_VIEW_BASIC = 1; - /** - * FULL response is equivalent to BASIC for primary instance (for now). - * For read pool instance, this includes details of each node in the pool. - * - * Generated from protobuf enum INSTANCE_VIEW_FULL = 2; - */ - const INSTANCE_VIEW_FULL = 2; - - private static $valueToName = [ - self::INSTANCE_VIEW_UNSPECIFIED => 'INSTANCE_VIEW_UNSPECIFIED', - self::INSTANCE_VIEW_BASIC => 'INSTANCE_VIEW_BASIC', - self::INSTANCE_VIEW_FULL => 'INSTANCE_VIEW_FULL', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php deleted file mode 100644 index 4043325e0bef..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.alloydb.v1alpha.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value for ListBackupsRequest - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent value for ListBackupsRequest - * @type int $page_size - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. - * @type string $filter - * Filtering results - * @type string $order_by - * Hint for how to order the results - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value for ListBackupsRequest - * - * 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. Parent value for ListBackupsRequest - * - * 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; - } - - /** - * 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; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * 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; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - * @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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php deleted file mode 100644 index e41b58c193b0..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListBackupsResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1alpha.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; - */ - private $backups; - /** - * 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\AlloyDb\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * The list of Backup - * @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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Backup backups = 1; - * @param array<\Google\Cloud\AlloyDb\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Backup::class); - $this->backups = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php deleted file mode 100644 index 693183573339..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersRequest.php +++ /dev/null @@ -1,219 +0,0 @@ -google.cloud.alloydb.v1alpha.ListClustersRequest - */ -class ListClustersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. Filtering results - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * @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 - * 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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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 name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php deleted file mode 100644 index f64218d54048..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListClustersResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1alpha.ListClustersResponse - */ -class ListClustersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; - */ - private $clusters; - /** - * 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\AlloyDb\V1alpha\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters - * The list of Cluster - * @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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getClusters() - { - return $this->clusters; - } - - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Cluster clusters = 1; - * @param array<\Google\Cloud\AlloyDb\V1alpha\Cluster>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setClusters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); - $this->clusters = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php deleted file mode 100644 index 6393c825a01a..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesRequest.php +++ /dev/null @@ -1,227 +0,0 @@ -google.cloud.alloydb.v1alpha.ListInstancesRequest - */ -class ListInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. Filtering results - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * @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 - * 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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php deleted file mode 100644 index 5ef3b7494243..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListInstancesResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1alpha.ListInstancesResponse - */ -class ListInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; - */ - private $instances; - /** - * 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\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * The list of Instance - * @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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.Instance instances = 1; - * @param array<\Google\Cloud\AlloyDb\V1alpha\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\Instance::class); - $this->instances = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php deleted file mode 100644 index d264b94b533b..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - */ -class ListSupportedDatabaseFlagsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * @type int $page_size - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * 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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * 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; - } - - /** - * 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; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * 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; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php deleted file mode 100644 index 69ac851214b6..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListSupportedDatabaseFlagsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - */ -class ListSupportedDatabaseFlagsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; - */ - private $supported_database_flags; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $supported_database_flags - * The list of SupportedDatabaseFlags. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedDatabaseFlags() - { - return $this->supported_database_flags; - } - - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag supported_database_flags = 1; - * @param array<\Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedDatabaseFlags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag::class); - $this->supported_database_flags = $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; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php deleted file mode 100644 index 53728f69e137..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.alloydb.v1alpha.ListUsersRequest - */ -class ListUsersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value for ListUsersRequest - * - * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent value for ListUsersRequest - * @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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value for ListUsersRequest - * - * 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. Parent value for ListUsersRequest - * - * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php deleted file mode 100644 index ad1058afc0d2..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/ListUsersResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1alpha.ListUsersResponse - */ -class ListUsersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.User users = 1; - */ - private $users; - /** - * 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\AlloyDb\V1alpha\User>|\Google\Protobuf\Internal\RepeatedField $users - * The list of User - * @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\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.User users = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUsers() - { - return $this->users; - } - - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.User users = 1; - * @param array<\Google\Cloud\AlloyDb\V1alpha\User>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUsers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1alpha\User::class); - $this->users = $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/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php deleted file mode 100644 index be816a1f56cb..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource.php +++ /dev/null @@ -1,144 +0,0 @@ -google.cloud.alloydb.v1alpha.MigrationSource - */ -class MigrationSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $host_port = ''; - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reference_id = ''; - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $source_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $host_port - * Output only. The host and port of the on-premises instance in host:port - * format - * @type string $reference_id - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * @type int $source_type - * Output only. Type of migration source. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getHostPort() - { - return $this->host_port; - } - - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setHostPort($var) - { - GPBUtil::checkString($var, True); - $this->host_port = $var; - - return $this; - } - - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReferenceId() - { - return $this->reference_id; - } - - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReferenceId($var) - { - GPBUtil::checkString($var, True); - $this->reference_id = $var; - - return $this; - } - - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getSourceType() - { - return $this->source_type; - } - - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setSourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\MigrationSource\MigrationSourceType::class); - $this->source_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php deleted file mode 100644 index c395671cb399..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/MigrationSource/MigrationSourceType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType - */ -class MigrationSourceType -{ - /** - * Migration source is unknown. - * - * Generated from protobuf enum MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - */ - const MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - /** - * DMS source means the cluster was created via DMS migration job. - * - * Generated from protobuf enum DMS = 1; - */ - const DMS = 1; - - private static $valueToName = [ - self::MIGRATION_SOURCE_TYPE_UNSPECIFIED => 'MIGRATION_SOURCE_TYPE_UNSPECIFIED', - self::DMS => 'DMS', - ]; - - 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(MigrationSourceType::class, \Google\Cloud\AlloyDb\V1alpha\MigrationSource_MigrationSourceType::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php deleted file mode 100644 index d45e78a3391a..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/OperationMetadata.php +++ /dev/null @@ -1,349 +0,0 @@ -google.cloud.alloydb.v1alpha.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 = ''; - protected $request_specific; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata $batch_create_instances_metadata - * Output only. BatchCreateInstances related metadata. - * @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. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Output only. BatchCreateInstances related metadata. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata|null - */ - public function getBatchCreateInstancesMetadata() - { - return $this->readOneof(8); - } - - public function hasBatchCreateInstancesMetadata() - { - return $this->hasOneof(8); - } - - /** - * Output only. BatchCreateInstances related metadata. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata $var - * @return $this - */ - public function setBatchCreateInstancesMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesMetadata::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * 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; - } - - /** - * @return string - */ - public function getRequestSpecific() - { - return $this->whichOneof("request_specific"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php deleted file mode 100644 index 6958d1967903..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/PromoteClusterRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.alloydb.v1alpha.PromoteClusterRequest - */ -class PromoteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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 = ''; - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php deleted file mode 100644 index 459a9f6c3d3c..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestartInstanceRequest.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.alloydb.v1alpha.RestartInstanceRequest - */ -class RestartInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php deleted file mode 100644 index dcde34c3116f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/RestoreClusterRequest.php +++ /dev/null @@ -1,344 +0,0 @@ -google.cloud.alloydb.v1alpha.RestoreClusterRequest - */ -class RestoreClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1alpha\BackupSource $backup_source - * Backup source. - * @type \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource $continuous_backup_source - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Backup source. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; - * @return \Google\Cloud\AlloyDb\V1alpha\BackupSource|null - */ - public function getBackupSource() - { - return $this->readOneof(4); - } - - public function hasBackupSource() - { - return $this->hasOneof(4); - } - - /** - * Backup source. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.BackupSource backup_source = 4; - * @param \Google\Cloud\AlloyDb\V1alpha\BackupSource $var - * @return $this - */ - public function setBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\BackupSource::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; - * @return \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource|null - */ - public function getContinuousBackupSource() - { - return $this->readOneof(8); - } - - public function hasContinuousBackupSource() - { - return $this->hasOneof(8); - } - - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.ContinuousBackupSource continuous_backup_source = 8; - * @param \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource $var - * @return $this - */ - public function setContinuousBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\ContinuousBackupSource::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); - $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php deleted file mode 100644 index d71785650e02..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1alpha.SslConfig - */ -class SslConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ssl_mode = 0; - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ca_source = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $ssl_mode - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * @type int $ca_source - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSslMode() - { - return $this->ssl_mode; - } - - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSslMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig\SslMode::class); - $this->ssl_mode = $var; - - return $this; - } - - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getCaSource() - { - return $this->ca_source; - } - - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setCaSource($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\SslConfig\CaSource::class); - $this->ca_source = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php deleted file mode 100644 index a68ee5bbf7c1..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/CaSource.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.alloydb.v1alpha.SslConfig.CaSource - */ -class CaSource -{ - /** - * Certificate Authority (CA) source not specified. Defaults to - * CA_SOURCE_MANAGED. - * - * Generated from protobuf enum CA_SOURCE_UNSPECIFIED = 0; - */ - const CA_SOURCE_UNSPECIFIED = 0; - /** - * Certificate Authority (CA) managed by the AlloyDB Cluster. - * - * Generated from protobuf enum CA_SOURCE_MANAGED = 1; - */ - const CA_SOURCE_MANAGED = 1; - - private static $valueToName = [ - self::CA_SOURCE_UNSPECIFIED => 'CA_SOURCE_UNSPECIFIED', - self::CA_SOURCE_MANAGED => 'CA_SOURCE_MANAGED', - ]; - - 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(CaSource::class, \Google\Cloud\AlloyDb\V1alpha\SslConfig_CaSource::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php deleted file mode 100644 index 796a4cc9a6a7..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SslConfig/SslMode.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.alloydb.v1alpha.SslConfig.SslMode - */ -class SslMode -{ - /** - * SSL mode not specified. Defaults to ENCRYPTED_ONLY. - * - * Generated from protobuf enum SSL_MODE_UNSPECIFIED = 0; - */ - const SSL_MODE_UNSPECIFIED = 0; - /** - * SSL connections are optional. CA verification not enforced. - * - * Generated from protobuf enum SSL_MODE_ALLOW = 1 [deprecated = true]; - */ - const SSL_MODE_ALLOW = 1; - /** - * SSL connections are required. CA verification not enforced. - * Clients may use locally self-signed certificates (default psql client - * behavior). - * - * Generated from protobuf enum SSL_MODE_REQUIRE = 2 [deprecated = true]; - */ - const SSL_MODE_REQUIRE = 2; - /** - * SSL connections are required. CA verification enforced. - * Clients must have certificates signed by a Cluster CA, e.g. via - * GenerateClientCertificate. - * - * Generated from protobuf enum SSL_MODE_VERIFY_CA = 3 [deprecated = true]; - */ - const SSL_MODE_VERIFY_CA = 3; - /** - * SSL connections are optional. CA verification not enforced. - * - * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - */ - const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - /** - * SSL connections are required. CA verification not enforced. - * - * Generated from protobuf enum ENCRYPTED_ONLY = 5; - */ - const ENCRYPTED_ONLY = 5; - - private static $valueToName = [ - self::SSL_MODE_UNSPECIFIED => 'SSL_MODE_UNSPECIFIED', - self::SSL_MODE_ALLOW => 'SSL_MODE_ALLOW', - self::SSL_MODE_REQUIRE => 'SSL_MODE_REQUIRE', - self::SSL_MODE_VERIFY_CA => 'SSL_MODE_VERIFY_CA', - self::ALLOW_UNENCRYPTED_AND_ENCRYPTED => 'ALLOW_UNENCRYPTED_AND_ENCRYPTED', - self::ENCRYPTED_ONLY => 'ENCRYPTED_ONLY', - ]; - - 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(SslMode::class, \Google\Cloud\AlloyDb\V1alpha\SslConfig_SslMode::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php deleted file mode 100644 index c9fb2230b3be..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag.php +++ /dev/null @@ -1,337 +0,0 @@ -google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - */ -class SupportedDatabaseFlag extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - */ - protected $flag_name = ''; - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; - */ - protected $value_type = 0; - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - */ - protected $accepts_multiple_values = false; - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; - */ - private $supported_db_versions; - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - */ - protected $requires_db_restart = false; - protected $restrictions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions $string_restrictions - * Restriction on STRING type value. - * @type \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions $integer_restrictions - * Restriction on INTEGER type value. - * @type string $name - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * @type string $flag_name - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * @type int $value_type - * @type bool $accepts_multiple_values - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * @type array|\Google\Protobuf\Internal\RepeatedField $supported_db_versions - * Major database engine versions for which this flag is supported. - * @type bool $requires_db_restart - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Restriction on STRING type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; - * @return \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions|null - */ - public function getStringRestrictions() - { - return $this->readOneof(7); - } - - public function hasStringRestrictions() - { - return $this->hasOneof(7); - } - - /** - * Restriction on STRING type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; - * @param \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions $var - * @return $this - */ - public function setStringRestrictions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\StringRestrictions::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Restriction on INTEGER type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; - * @return \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions|null - */ - public function getIntegerRestrictions() - { - return $this->readOneof(8); - } - - public function hasIntegerRestrictions() - { - return $this->hasOneof(8); - } - - /** - * Restriction on INTEGER type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; - * @param \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions $var - * @return $this - */ - public function setIntegerRestrictions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\IntegerRestrictions::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - * @return string - */ - public function getFlagName() - { - return $this->flag_name; - } - - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - * @param string $var - * @return $this - */ - public function setFlagName($var) - { - GPBUtil::checkString($var, True); - $this->flag_name = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; - * @return int - */ - public function getValueType() - { - return $this->value_type; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType value_type = 3; - * @param int $var - * @return $this - */ - public function setValueType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag\ValueType::class); - $this->value_type = $var; - - return $this; - } - - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - * @return bool - */ - public function getAcceptsMultipleValues() - { - return $this->accepts_multiple_values; - } - - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - * @param bool $var - * @return $this - */ - public function setAcceptsMultipleValues($var) - { - GPBUtil::checkBool($var); - $this->accepts_multiple_values = $var; - - return $this; - } - - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedDbVersions() - { - return $this->supported_db_versions; - } - - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1alpha.DatabaseVersion supported_db_versions = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedDbVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AlloyDb\V1alpha\DatabaseVersion::class); - $this->supported_db_versions = $arr; - - return $this; - } - - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - * @return bool - */ - public function getRequiresDbRestart() - { - return $this->requires_db_restart; - } - - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - * @param bool $var - * @return $this - */ - public function setRequiresDbRestart($var) - { - GPBUtil::checkBool($var); - $this->requires_db_restart = $var; - - return $this; - } - - /** - * @return string - */ - public function getRestrictions() - { - return $this->whichOneof("restrictions"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php deleted file mode 100644 index 9c66c1e17e3d..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/IntegerRestrictions.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - */ -class IntegerRestrictions extends \Google\Protobuf\Internal\Message -{ - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - */ - protected $min_value = null; - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - */ - protected $max_value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int64Value $min_value - * The minimum value that can be specified, if applicable. - * @type \Google\Protobuf\Int64Value $max_value - * The maximum value that can be specified, if applicable. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMinValue() - { - return $this->min_value; - } - - public function hasMinValue() - { - return isset($this->min_value); - } - - public function clearMinValue() - { - unset($this->min_value); - } - - /** - * Returns the unboxed value from getMinValue() - - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @return int|string|null - */ - public function getMinValueUnwrapped() - { - return $this->readWrapperValue("min_value"); - } - - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMinValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->min_value = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @param int|string|null $var - * @return $this - */ - public function setMinValueUnwrapped($var) - { - $this->writeWrapperValue("min_value", $var); - return $this;} - - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMaxValue() - { - return $this->max_value; - } - - public function hasMaxValue() - { - return isset($this->max_value); - } - - public function clearMaxValue() - { - unset($this->max_value); - } - - /** - * Returns the unboxed value from getMaxValue() - - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @return int|string|null - */ - public function getMaxValueUnwrapped() - { - return $this->readWrapperValue("max_value"); - } - - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMaxValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->max_value = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @param int|string|null $var - * @return $this - */ - public function setMaxValueUnwrapped($var) - { - $this->writeWrapperValue("max_value", $var); - return $this;} - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IntegerRestrictions::class, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag_IntegerRestrictions::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php deleted file mode 100644 index b5a92631ce5b..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/StringRestrictions.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - */ -class StringRestrictions extends \Google\Protobuf\Internal\Message -{ - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - */ - private $allowed_values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedValues() - { - return $this->allowed_values; - } - - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_values = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StringRestrictions::class, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag_StringRestrictions::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php deleted file mode 100644 index 26fc5fd68422..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/SupportedDatabaseFlag/ValueType.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType - */ -class ValueType -{ - /** - * This is an unknown flag type. - * - * Generated from protobuf enum VALUE_TYPE_UNSPECIFIED = 0; - */ - const VALUE_TYPE_UNSPECIFIED = 0; - /** - * String type flag. - * - * Generated from protobuf enum STRING = 1; - */ - const STRING = 1; - /** - * Integer type flag. - * - * Generated from protobuf enum INTEGER = 2; - */ - const INTEGER = 2; - /** - * Float type flag. - * - * Generated from protobuf enum FLOAT = 3; - */ - const FLOAT = 3; - /** - * Denotes that the flag does not accept any values. - * - * Generated from protobuf enum NONE = 4; - */ - const NONE = 4; - - private static $valueToName = [ - self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', - self::STRING => 'STRING', - self::INTEGER => 'INTEGER', - self::FLOAT => 'FLOAT', - self::NONE => 'NONE', - ]; - - 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(ValueType::class, \Google\Cloud\AlloyDb\V1alpha\SupportedDatabaseFlag_ValueType::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php deleted file mode 100644 index 8c09730c698a..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateBackupRequest.php +++ /dev/null @@ -1,287 +0,0 @@ -google.cloud.alloydb.v1alpha.UpdateBackupRequest - */ -class UpdateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1alpha\Backup $backup - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Backup::class); - $this->backup = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php deleted file mode 100644 index 1a665c7123cd..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateClusterRequest.php +++ /dev/null @@ -1,291 +0,0 @@ -google.cloud.alloydb.v1alpha.UpdateClusterRequest - */ -class UpdateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1alpha\Cluster $cluster - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Cluster::class); - $this->cluster = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php deleted file mode 100644 index c777ca05973d..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateInstanceRequest.php +++ /dev/null @@ -1,291 +0,0 @@ -google.cloud.alloydb.v1alpha.UpdateInstanceRequest - */ -class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1alpha\Instance $instance - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\Instance::class); - $this->instance = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php deleted file mode 100644 index e424f09f05d4..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UpdateUserRequest.php +++ /dev/null @@ -1,283 +0,0 @@ -google.cloud.alloydb.v1alpha.UpdateUserRequest - */ -class UpdateUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1alpha\User $user - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allow_missing - * Optional. Allow missing fields in the update mask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1alpha\User|null - */ - public function getUser() - { - return $this->user; - } - - public function hasUser() - { - return isset($this->user); - } - - public function clearUser() - { - unset($this->user); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1alpha\User $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1alpha\User::class); - $this->user = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php deleted file mode 100644 index 84a4fad9db08..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.alloydb.v1alpha.User - */ -class User extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $password = ''; - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_roles; - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * @type string $password - * Input only. Password for the user. - * @type array|\Google\Protobuf\Internal\RepeatedField $database_roles - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * @type int $user_type - * Optional. Type of this user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDatabaseRoles() - { - return $this->database_roles; - } - - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDatabaseRoles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->database_roles = $arr; - - return $this; - } - - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getUserType() - { - return $this->user_type; - } - - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setUserType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1alpha\User\UserType::class); - $this->user_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php deleted file mode 100644 index 7d3f081756c0..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/User/UserType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1alpha.User.UserType - */ -class UserType -{ - /** - * Unspecified user type. - * - * Generated from protobuf enum USER_TYPE_UNSPECIFIED = 0; - */ - const USER_TYPE_UNSPECIFIED = 0; - /** - * The default user type that authenticates via password-based - * authentication. - * - * Generated from protobuf enum ALLOYDB_BUILT_IN = 1; - */ - const ALLOYDB_BUILT_IN = 1; - /** - * Database user that can authenticate via IAM-Based authentication. - * - * Generated from protobuf enum ALLOYDB_IAM_USER = 2; - */ - const ALLOYDB_IAM_USER = 2; - - private static $valueToName = [ - self::USER_TYPE_UNSPECIFIED => 'USER_TYPE_UNSPECIFIED', - self::ALLOYDB_BUILT_IN => 'ALLOYDB_BUILT_IN', - self::ALLOYDB_IAM_USER => 'ALLOYDB_IAM_USER', - ]; - - 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(UserType::class, \Google\Cloud\AlloyDb\V1alpha\User_UserType::class); - diff --git a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php b/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php deleted file mode 100644 index 62343abaae0d..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/proto/src/Google/Cloud/AlloyDb/V1alpha/UserPassword.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.alloydb.v1alpha.UserPassword - */ -class UserPassword extends \Google\Protobuf\Internal\Message -{ - /** - * The database username. - * - * Generated from protobuf field string user = 1; - */ - protected $user = ''; - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - */ - protected $password = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $user - * The database username. - * @type string $password - * The initial password for the user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Alpha\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The database username. - * - * Generated from protobuf field string user = 1; - * @return string - */ - public function getUser() - { - return $this->user; - } - - /** - * The database username. - * - * Generated from protobuf field string user = 1; - * @param string $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkString($var, True); - $this->user = $var; - - return $this; - } - - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php deleted file mode 100644 index 6eee1e0b5d34..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/batch_create_instances.php +++ /dev/null @@ -1,123 +0,0 @@ -setInstanceType($requestsCreateInstanceRequestsInstanceInstanceType); - $createInstanceRequest = (new CreateInstanceRequest()) - ->setParent($formattedRequestsCreateInstanceRequestsParent) - ->setInstanceId($requestsCreateInstanceRequestsInstanceId) - ->setInstance($requestsCreateInstanceRequestsInstance); - $requestsCreateInstanceRequests = [$createInstanceRequest,]; - $requests = (new CreateInstanceRequests()) - ->setCreateInstanceRequests($requestsCreateInstanceRequests); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchCreateInstancesResponse $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $formattedRequestsCreateInstanceRequestsParent = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - $requestsCreateInstanceRequestsInstanceId = '[INSTANCE_ID]'; - $requestsCreateInstanceRequestsInstanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - batch_create_instances_sample( - $formattedParent, - $formattedRequestsCreateInstanceRequestsParent, - $requestsCreateInstanceRequestsInstanceId, - $requestsCreateInstanceRequestsInstanceInstanceType - ); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php deleted file mode 100644 index abda32a85b44..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_backup.php +++ /dev/null @@ -1,95 +0,0 @@ -setClusterName($formattedBackupClusterName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $backupId = '[BACKUP_ID]'; - $formattedBackupClusterName = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - - create_backup_sample($formattedParent, $backupId, $formattedBackupClusterName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php deleted file mode 100644 index 96ea1b80ebe7..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_cluster.php +++ /dev/null @@ -1,95 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - create_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php deleted file mode 100644 index e6fe0a81e759..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_instance.php +++ /dev/null @@ -1,91 +0,0 @@ -setInstanceType($instanceInstanceType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = '[INSTANCE_ID]'; - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - create_instance_sample($formattedParent, $instanceId, $instanceInstanceType); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php deleted file mode 100644 index 4047d99f70fe..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_cluster.php +++ /dev/null @@ -1,96 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - create_secondary_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php deleted file mode 100644 index 3e820205bdae..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_secondary_instance.php +++ /dev/null @@ -1,91 +0,0 @@ -setInstanceType($instanceInstanceType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = '[INSTANCE_ID]'; - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - create_secondary_instance_sample($formattedParent, $instanceId, $instanceInstanceType); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php deleted file mode 100644 index 1d9104352ce2..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/create_user.php +++ /dev/null @@ -1,71 +0,0 @@ -createUser($formattedParent, $userId, $user); - 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 -{ - $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = '[USER_ID]'; - - create_user_sample($formattedParent, $userId); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php deleted file mode 100644 index a2ff825fbd2f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_backup.php +++ /dev/null @@ -1,76 +0,0 @@ -deleteBackup($formattedName); - $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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - delete_backup_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php deleted file mode 100644 index c6c523a317f0..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_cluster.php +++ /dev/null @@ -1,76 +0,0 @@ -deleteCluster($formattedName); - $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - delete_cluster_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php deleted file mode 100644 index 24d9fa333d53..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_instance.php +++ /dev/null @@ -1,81 +0,0 @@ -deleteInstance($formattedName); - $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 = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - delete_instance_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php deleted file mode 100644 index 1538f759473b..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/delete_user.php +++ /dev/null @@ -1,65 +0,0 @@ -deleteUser($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - - delete_user_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php deleted file mode 100644 index 8323a7670394..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/failover_instance.php +++ /dev/null @@ -1,86 +0,0 @@ -failoverInstance($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - failover_instance_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php deleted file mode 100644 index 6609e26c45e9..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/generate_client_certificate.php +++ /dev/null @@ -1,71 +0,0 @@ -generateClientCertificate($formattedParent); - 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 -{ - $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - generate_client_certificate_sample($formattedParent); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php deleted file mode 100644 index 2d91670b9f8b..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_backup.php +++ /dev/null @@ -1,66 +0,0 @@ -getBackup($formattedName); - 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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - get_backup_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php deleted file mode 100644 index 698c95c92ab1..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_cluster.php +++ /dev/null @@ -1,67 +0,0 @@ -getCluster($formattedName); - 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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - get_cluster_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php deleted file mode 100644 index e6258d304278..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_connection_info.php +++ /dev/null @@ -1,72 +0,0 @@ -getConnectionInfo($formattedParent); - 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 -{ - $formattedParent = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - get_connection_info_sample($formattedParent); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php deleted file mode 100644 index 4d62ee36ca6b..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_instance.php +++ /dev/null @@ -1,72 +0,0 @@ -getInstance($formattedName); - 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 = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - get_instance_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php deleted file mode 100644 index 22d386b5cb08..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php deleted file mode 100644 index 998ee4887eb5..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/get_user.php +++ /dev/null @@ -1,67 +0,0 @@ -getUser($formattedName); - 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - - get_user_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php deleted file mode 100644 index d99b91cb6f0f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/inject_fault.php +++ /dev/null @@ -1,88 +0,0 @@ -injectFault($faultType, $formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - inject_fault_sample($faultType, $formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php deleted file mode 100644 index c5973c3a478c..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_backups.php +++ /dev/null @@ -1,71 +0,0 @@ -listBackups($formattedParent); - - /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_backups_sample($formattedParent); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php deleted file mode 100644 index f788df0033ec..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_clusters.php +++ /dev/null @@ -1,74 +0,0 @@ -listClusters($formattedParent); - - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_clusters_sample($formattedParent); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php deleted file mode 100644 index 6e7e861adef2..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_instances.php +++ /dev/null @@ -1,76 +0,0 @@ -listInstances($formattedParent); - - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - list_instances_sample($formattedParent); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php deleted file mode 100644 index 7d2ef19587be..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 alloydb_v1alpha_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php deleted file mode 100644 index 700c6fbe9930..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_supported_database_flags.php +++ /dev/null @@ -1,77 +0,0 @@ -listSupportedDatabaseFlags($formattedParent); - - /** @var SupportedDatabaseFlag $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_supported_database_flags_sample($formattedParent); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php deleted file mode 100644 index 279b515b8f7f..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/list_users.php +++ /dev/null @@ -1,71 +0,0 @@ -listUsers($formattedParent); - - /** @var User $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - list_users_sample($formattedParent); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php deleted file mode 100644 index ac3df299e9b9..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/promote_cluster.php +++ /dev/null @@ -1,82 +0,0 @@ -promoteCluster($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 -{ - $formattedName = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - promote_cluster_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php deleted file mode 100644 index a4a5b4f3d4e1..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restart_instance.php +++ /dev/null @@ -1,85 +0,0 @@ -restartInstance($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - restart_instance_sample($formattedName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php deleted file mode 100644 index 85b7f58762e4..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/restore_cluster.php +++ /dev/null @@ -1,97 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - restore_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php deleted file mode 100644 index e1ae38c03684..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_backup.php +++ /dev/null @@ -1,87 +0,0 @@ -setClusterName($formattedBackupClusterName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateBackup($backup); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Backup $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 -{ - $formattedBackupClusterName = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - - update_backup_sample($formattedBackupClusterName); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php deleted file mode 100644 index 5a7374432dd6..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_cluster.php +++ /dev/null @@ -1,86 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateCluster($cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 -{ - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - update_cluster_sample($formattedClusterNetwork); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php deleted file mode 100644 index b9093e91c94c..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_instance.php +++ /dev/null @@ -1,82 +0,0 @@ -setInstanceType($instanceInstanceType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateInstance($instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - update_instance_sample($instanceInstanceType); -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php b/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php deleted file mode 100644 index 94e0b43edf17..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/samples/V1alpha/AlloyDBAdminClient/update_user.php +++ /dev/null @@ -1,56 +0,0 @@ -updateUser($user); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php deleted file mode 100644 index 674370c0ea34..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/AlloyDBAdminClient.php +++ /dev/null @@ -1,36 +0,0 @@ -clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $requests = new CreateInstanceRequests(); - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class AlloyDBAdminGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.alloydb.v1alpha.AlloyDBAdmin'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'alloydb.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $backupNameTemplate; - - private static $clusterNameTemplate; - - private static $cryptoKeyVersionNameTemplate; - - private static $instanceNameTemplate; - - private static $locationNameTemplate; - - private static $networkNameTemplate; - - private static $userNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getClusterNameTemplate() - { - if (self::$clusterNameTemplate == null) { - self::$clusterNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}'); - } - - return self::$clusterNameTemplate; - } - - private static function getCryptoKeyVersionNameTemplate() - { - if (self::$cryptoKeyVersionNameTemplate == null) { - self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); - } - - return self::$cryptoKeyVersionNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}'); - } - - return self::$instanceNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getUserNameTemplate() - { - if (self::$userNameTemplate == null) { - self::$userNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/users/{user}'); - } - - return self::$userNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'cluster' => self::getClusterNameTemplate(), - 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'user' => self::getUserNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $backup - * - * @return string The formatted backup resource. - * - * @experimental - */ - public static function backupName($project, $location, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted cluster resource. - * - * @experimental - */ - public static function clusterName($project, $location, $cluster) - { - return self::getClusterNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * crypto_key_version resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * @param string $cryptoKeyVersion - * - * @return string The formatted crypto_key_version resource. - * - * @experimental - */ - public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) - { - return self::getCryptoKeyVersionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - 'crypto_key_version' => $cryptoKeyVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $instance - * - * @return string The formatted instance resource. - * - * @experimental - */ - public static function instanceName($project, $location, $cluster, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'instance' => $instance, - ]); - } - - /** - * 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. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a user - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $user - * - * @return string The formatted user resource. - * - * @experimental - */ - public static function userName($project, $location, $cluster, $user) - { - return self::getUserNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'user' => $user, - ]); - } - - /** - * 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}/backups/{backup} - * - cluster: projects/{project}/locations/{location}/clusters/{cluster} - * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} - * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} - * - * 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. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - 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 - * - * @experimental - */ - 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; - } - - /** - * 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 'alloydb.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 - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates new instances under the given project, location and cluster. - * There can be only one primary instance in a cluster. If the primary - * instance exists in the cluster as well as this request, then API will - * throw an error. - * The primary instance should exist before any read pool instance is - * created. If the primary instance is a part of the request payload, then - * the API will take care of creating instances in the correct order. - * This method is here to support Google-internal use cases, and is not meant - * for external customers to consume. Please do not start relying on it; its - * behavior is subject to change without notice. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $requests = new CreateInstanceRequests(); - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. - * @param CreateInstanceRequests $requests Required. Resources being created. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function batchCreateInstances($parent, $requests, array $optionalArgs = []) - { - $request = new BatchCreateInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchCreateInstances', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Backup in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Value for parent. - * @param string $backupId Required. ID of the requesting object. - * @param Backup $backup Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Cluster in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object. - * @param Cluster $cluster Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new CreateClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Instance in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $instanceId = 'instance_id'; - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param string $instanceId Required. ID of the requesting object. - * @param Instance $instance Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createInstance($parent, $instanceId, $instance, array $optionalArgs = []) - { - $request = new CreateInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a cluster of type SECONDARY in the given location using - * the primary cluster as the source. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object (the secondary cluster). - * @param Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createSecondaryCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new CreateSecondaryClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateSecondaryCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new SECONDARY Instance in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $instanceId = 'instance_id'; - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param string $instanceId Required. ID of the requesting object. - * @param Instance $instance Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createSecondaryInstance($parent, $instanceId, $instance, array $optionalArgs = []) - { - $request = new CreateSecondaryInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateSecondaryInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new User in a given project, location, and cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $userId = 'user_id'; - * $user = new User(); - * $response = $alloyDBAdminClient->createUser($formattedParent, $userId, $user); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Value for parent. - * @param string $userId Required. ID of the requesting object. - * @param User $user Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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 \Google\Cloud\AlloyDb\V1alpha\User - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createUser($parent, $userId, $user, array $optionalArgs = []) - { - $request = new CreateUserRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setUserId($userId); - $request->setUser($user); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type string $etag - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @type bool $force - * Optional. Whether to cascade delete child instances for given cluster. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteCluster($name, array $optionalArgs = []) - { - $request = new DeleteClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteInstance($name, array $optionalArgs = []) - { - $request = new DeleteInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - * $alloyDBAdminClient->deleteUser($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteUser($name, array $optionalArgs = []) - { - $request = new DeleteUserRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteUser', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'failoverInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function failoverInstance($name, array $optionalArgs = []) - { - $request = new FailoverInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('FailoverInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Generate a client certificate signed by a Cluster CA. - * The sole purpose of this endpoint is to support AlloyDB connectors and the - * Auth Proxy client. The endpoint's behavior is subject to change without - * notice, so do not rely on its behavior remaining constant. Future changes - * will not break AlloyDB connectors or the Auth Proxy client. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $response = $alloyDBAdminClient->generateClientCertificate($formattedParent); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $pemCsr - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * @type Duration $certDuration - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * @type string $publicKey - * Optional. The public key from the client. - * @type bool $useMetadataExchange - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * @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 \Google\Cloud\AlloyDb\V1alpha\GenerateClientCertificateResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function generateClientCertificate($parent, array $optionalArgs = []) - { - $request = new GenerateClientCertificateRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['pemCsr'])) { - $request->setPemCsr($optionalArgs['pemCsr']); - } - - if (isset($optionalArgs['certDuration'])) { - $request->setCertDuration($optionalArgs['certDuration']); - } - - if (isset($optionalArgs['publicKey'])) { - $request->setPublicKey($optionalArgs['publicKey']); - } - - if (isset($optionalArgs['useMetadataExchange'])) { - $request->setUseMetadataExchange($optionalArgs['useMetadataExchange']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateClientCertificate', GenerateClientCertificateResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $response = $alloyDBAdminClient->getBackup($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the resource - * @param array $optionalArgs { - * 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 \Google\Cloud\AlloyDb\V1alpha\Backup - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $response = $alloyDBAdminClient->getCluster($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1alpha\ClusterView} - * @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 \Google\Cloud\AlloyDb\V1alpha\Cluster - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getCluster($name, array $optionalArgs = []) - { - $request = new GetClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetCluster', Cluster::class, $optionalArgs, $request)->wait(); - } - - /** - * Get instance metadata used for a connection. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $response = $alloyDBAdminClient->getConnectionInfo($formattedParent); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @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 \Google\Cloud\AlloyDb\V1alpha\ConnectionInfo - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getConnectionInfo($parent, array $optionalArgs = []) - { - $request = new GetConnectionInfoRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConnectionInfo', ConnectionInfo::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $response = $alloyDBAdminClient->getInstance($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * The view of the instance to return. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1alpha\InstanceView} - * @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 \Google\Cloud\AlloyDb\V1alpha\Instance - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getInstance($name, array $optionalArgs = []) - { - $request = new GetInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - * $response = $alloyDBAdminClient->getUser($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param array $optionalArgs { - * 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 \Google\Cloud\AlloyDb\V1alpha\User - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getUser($name, array $optionalArgs = []) - { - $request = new GetUserRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Injects fault in an instance. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'injectFault'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param int $faultType Required. The type of fault to be injected in an instance. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1alpha\InjectFaultRequest\FaultType} - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function injectFault($faultType, $name, array $optionalArgs = []) - { - $request = new InjectFaultRequest(); - $requestParamHeaders = []; - $request->setFaultType($faultType); - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('InjectFault', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Lists Backups in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent value for ListBackupsRequest - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filtering results - * @type string $orderBy - * Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists Clusters in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listClusters($parent, array $optionalArgs = []) - { - $request = new ListClustersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListClusters', $optionalArgs, ListClustersResponse::class, $request); - } - - /** - * Lists Instances in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listInstances($parent, array $optionalArgs = []) - { - $request = new ListInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListInstances', $optionalArgs, ListInstancesResponse::class, $request); - } - - /** - * Lists SupportedDatabaseFlags for a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listSupportedDatabaseFlags($parent, array $optionalArgs = []) - { - $request = new ListSupportedDatabaseFlagsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListSupportedDatabaseFlags', $optionalArgs, ListSupportedDatabaseFlagsResponse::class, $request); - } - - /** - * Lists Users in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent value for ListUsersRequest - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listUsers($parent, array $optionalArgs = []) - { - $request = new ListUsersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListUsers', $optionalArgs, ListUsersResponse::class, $request); - } - - /** - * Promotes a SECONDARY cluster. This turns down replication - * from the PRIMARY cluster and promotes a secondary cluster - * into its own standalone cluster. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'promoteCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function promoteCluster($name, array $optionalArgs = []) - { - $request = new PromoteClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('PromoteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Restart an Instance in a cluster. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restartInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restartInstance($name, array $optionalArgs = []) - { - $request = new RestartInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestartInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Cluster in a given project and location, with a volume - * restored from the provided source, either a backup ID or a point-in-time - * and a source cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restoreCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object. - * @param Cluster $cluster Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type BackupSource $backupSource - * Backup source. - * @type ContinuousBackupSource $continuousBackupSource - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restoreCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new RestoreClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['backupSource'])) { - $request->setBackupSource($optionalArgs['backupSource']); - } - - if (isset($optionalArgs['continuousBackupSource'])) { - $request->setContinuousBackupSource($optionalArgs['continuousBackupSource']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $backup = new Backup(); - * $operationResponse = $alloyDBAdminClient->updateBackup($backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateBackup($backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Backup $backup Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateBackup($backup, array $optionalArgs = []) - { - $request = new UpdateBackupRequest(); - $requestParamHeaders = []; - $request->setBackup($backup); - $requestParamHeaders['backup.name'] = $backup->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Cluster $cluster Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateCluster($cluster, array $optionalArgs = []) - { - $request = new UpdateClusterRequest(); - $requestParamHeaders = []; - $request->setCluster($cluster); - $requestParamHeaders['cluster.name'] = $cluster->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->updateInstance($instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateInstance($instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Instance $instance Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateInstance($instance, array $optionalArgs = []) - { - $request = new UpdateInstanceRequest(); - $requestParamHeaders = []; - $request->setInstance($instance); - $requestParamHeaders['instance.name'] = $instance->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $user = new User(); - * $response = $alloyDBAdminClient->updateUser($user); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param User $user Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allowMissing - * Optional. Allow missing fields in the update mask. - * @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 \Google\Cloud\AlloyDb\V1alpha\User - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateUser($user, array $optionalArgs = []) - { - $request = new UpdateUserRequest(); - $requestParamHeaders = []; - $request->setUser($user); - $requestParamHeaders['user.name'] = $user->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $response = $alloyDBAdminClient->getLocation(); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json deleted file mode 100644 index ed35ebdfea2a..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/gapic_metadata.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.alloydb.v1alpha", - "libraryPackage": "Google\\Cloud\\AlloyDb\\V1alpha", - "services": { - "AlloyDBAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBAdminGapicClient", - "rpcs": { - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags" - ] - }, - "ListUsers": { - "methods": [ - "listUsers" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json deleted file mode 100644 index 5a4e197bbaad..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_client_config.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1alpha.AlloyDBAdmin": { - "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": 60000, - "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": { - "BatchCreateInstances": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateSecondaryCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateSecondaryInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateUser": { - "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_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteUser": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GenerateClientCertificate": { - "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" - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetConnectionInfo": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetUser": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "InjectFault": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListSupportedDatabaseFlags": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListUsers": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PromoteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RestoreCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateUser": { - "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_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php deleted file mode 100644 index 57312ffe3f42..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_descriptor_config.php +++ /dev/null @@ -1,242 +0,0 @@ - [ - 'google.cloud.alloydb.v1alpha.AlloyDBAdmin' => [ - 'BatchCreateInstances' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\BatchCreateInstancesResponse', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Backup', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateSecondaryCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateSecondaryInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'FailoverInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'InjectFault' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'PromoteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestartInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestoreCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Backup', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1alpha\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - ], - 'ListClusters' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getClusters', - ], - ], - 'ListInstances' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInstances', - ], - ], - 'ListSupportedDatabaseFlags' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSupportedDatabaseFlags', - ], - ], - 'ListUsers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUsers', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - ], - ], -]; diff --git a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php b/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php deleted file mode 100644 index 61d0cde235b2..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/src/V1alpha/resources/alloy_db_admin_rest_client_config.php +++ /dev/null @@ -1,454 +0,0 @@ - [ - 'google.cloud.alloydb.v1alpha.AlloyDBAdmin' => [ - 'BatchCreateInstances' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate', - 'body' => 'requests', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/backups', - 'body' => 'backup', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_id', - ], - ], - 'CreateCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'cluster_id', - ], - ], - 'CreateInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'instance_id', - ], - ], - 'CreateSecondaryCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateSecondaryInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateUser' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/users', - 'body' => 'user', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'user_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteCluster' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteUser' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'FailoverInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GenerateClientCertificate' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetConnectionInfo' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetInstance' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetUser' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'InjectFault' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListClusters' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListInstances' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListSupportedDatabaseFlags' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListUsers' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/clusters/*}/users', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PromoteCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*}:promote', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestartInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestoreCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/clusters:restore', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateBackup' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{backup.name=projects/*/locations/*/backups/*}', - 'body' => 'backup', - 'placeholders' => [ - 'backup.name' => [ - 'getters' => [ - 'getBackup', - 'getName', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}', - 'body' => 'cluster', - 'placeholders' => [ - 'cluster.name' => [ - 'getters' => [ - 'getCluster', - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}', - 'body' => 'instance', - 'placeholders' => [ - 'instance.name' => [ - 'getters' => [ - 'getInstance', - 'getName', - ], - ], - ], - ], - 'UpdateUser' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}', - 'body' => 'user', - 'placeholders' => [ - 'user.name' => [ - 'getters' => [ - 'getUser', - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php deleted file mode 100644 index 0e8fa9b6f95b..000000000000 --- a/owl-bot-staging/AlloyDb/v1alpha/tests/Unit/V1alpha/AlloyDBAdminClientTest.php +++ /dev/null @@ -1,3435 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return AlloyDBAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new AlloyDBAdminClient($options); - } - - /** @test */ - public function batchCreateInstancesTest() - { - $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/batchCreateInstancesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateInstancesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateInstancesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $response = $gapicClient->batchCreateInstances($formattedParent, $requests); - $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.alloydb.v1alpha.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - $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 batchCreateInstancesExceptionTest() - { - $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/batchCreateInstancesTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $response = $gapicClient->batchCreateInstances($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - 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 createBackupTest() - { - $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/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $satisfiesPzs = false; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $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.alloydb.v1alpha.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $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 createBackupExceptionTest() - { - $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/createBackupTest'); - $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]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - 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 createClusterTest() - { - $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/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $satisfiesPzs = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1alpha.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $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 createClusterExceptionTest() - { - $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/createClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - 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 createInstanceTest() - { - $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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); - $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.alloydb.v1alpha.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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 createInstanceExceptionTest() - { - $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/createInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - 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 createSecondaryClusterTest() - { - $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/createSecondaryClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $satisfiesPzs = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - $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 createSecondaryClusterExceptionTest() - { - $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/createSecondaryClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - 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 createSecondaryInstanceTest() - { - $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/createSecondaryInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $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.alloydb.v1alpha.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - $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 createSecondaryInstanceExceptionTest() - { - $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/createSecondaryInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - 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 createUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - $response = $gapicClient->createUser($formattedParent, $userId, $user); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getUserId(); - $this->assertProtobufEquals($userId, $actualValue); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createUserExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - try { - $gapicClient->createUser($formattedParent, $userId, $user); - // 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 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); - $expectedResponse = new GPBEmpty(); - $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]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $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.alloydb.v1alpha.AlloyDBAdmin/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]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $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 deleteClusterTest() - { - $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/deleteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->deleteCluster($formattedName); - $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.alloydb.v1alpha.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - $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 deleteClusterExceptionTest() - { - $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/deleteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->deleteCluster($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - 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 deleteInstanceTest() - { - $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/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $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.alloydb.v1alpha.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $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 deleteInstanceExceptionTest() - { - $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/deleteInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - 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 deleteUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $gapicClient->deleteUser($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - try { - $gapicClient->deleteUser($formattedName); - // 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 failoverInstanceTest() - { - $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/failoverInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/failoverInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->failoverInstance($formattedName); - $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.alloydb.v1alpha.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - $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 failoverInstanceExceptionTest() - { - $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/failoverInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->failoverInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - 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 generateClientCertificateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $pemCertificate = 'pemCertificate1234463984'; - $caCert = 'caCert536363365'; - $expectedResponse = new GenerateClientCertificateResponse(); - $expectedResponse->setPemCertificate($pemCertificate); - $expectedResponse->setCaCert($caCert); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->generateClientCertificate($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateClientCertificateExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->generateClientCertificate($formattedParent); - // 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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $satisfiesPzs = false; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $response = $gapicClient->getBackup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/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]', '[BACKUP]'); - try { - $gapicClient->getBackup($formattedName); - // 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 getClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $satisfiesPzs = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->getCluster($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->getCluster($formattedName); - // 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 getConnectionInfoTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $ipAddress = 'ipAddress1480014044'; - $instanceUid = 'instanceUid-737331802'; - $expectedResponse = new ConnectionInfo(); - $expectedResponse->setName($name); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setInstanceUid($instanceUid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->getConnectionInfo($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConnectionInfoExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - try { - $gapicClient->getConnectionInfo($formattedParent); - // 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 getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->getInstance($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - try { - $gapicClient->getInstance($formattedName); - // 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 getUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name2); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $response = $gapicClient->getUser($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - try { - $gapicClient->getUser($formattedName); - // 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 injectFaultTest() - { - $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/injectFaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/injectFaultTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->injectFault($faultType, $formattedName); - $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.alloydb.v1alpha.AlloyDBAdmin/InjectFault', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFaultType(); - $this->assertProtobufEquals($faultType, $actualValue); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - $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 injectFaultExceptionTest() - { - $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/injectFaultTest'); - $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 - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->injectFault($faultType, $formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - 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 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->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listBackups($formattedParent); - $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.alloydb.v1alpha.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listBackups($formattedParent); - // 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 listClustersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $clustersElement = new Cluster(); - $clusters = [ - $clustersElement, - ]; - $expectedResponse = new ListClustersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setClusters($clusters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listClusters($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListClusters', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersExceptionTest() - { - $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]'); - try { - $gapicClient->listClusters($formattedParent); - // 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 listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->listInstances($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->listInstances($formattedParent); - // 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 listSupportedDatabaseFlagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); - $supportedDatabaseFlags = [ - $supportedDatabaseFlagsElement, - ]; - $expectedResponse = new ListSupportedDatabaseFlagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listSupportedDatabaseFlags($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSupportedDatabaseFlagsExceptionTest() - { - $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]'); - try { - $gapicClient->listSupportedDatabaseFlags($formattedParent); - // 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 listUsersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $usersElement = new User(); - $users = [ - $usersElement, - ]; - $expectedResponse = new ListUsersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUsers($users); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->listUsers($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListUsers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listUsersExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->listUsers($formattedParent); - // 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 promoteClusterTest() - { - $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/promoteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag2 = 'etag2-1293302904'; - $reconciling = false; - $satisfiesPzs = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag2); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/promoteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->promoteCluster($formattedName); - $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.alloydb.v1alpha.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - $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 promoteClusterExceptionTest() - { - $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/promoteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->promoteCluster($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - 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 restartInstanceTest() - { - $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/restartInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restartInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $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.alloydb.v1alpha.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - $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 restartInstanceExceptionTest() - { - $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/restartInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - 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 restoreClusterTest() - { - $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/restoreClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $satisfiesPzs = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1alpha.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - $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 restoreClusterExceptionTest() - { - $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/restoreClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - 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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $satisfiesPzs = false; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->updateBackup($backup); - $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.alloydb.v1alpha.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->updateBackup($backup); - $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 updateClusterTest() - { - $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/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $satisfiesPzs = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->updateCluster($cluster); - $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.alloydb.v1alpha.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - $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 updateClusterExceptionTest() - { - $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/updateClusterTest'); - $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 - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->updateCluster($cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - 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 updateInstanceTest() - { - $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/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $satisfiesPzs = false; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->updateInstance($instance); - $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.alloydb.v1alpha.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $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 updateInstanceExceptionTest() - { - $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/updateInstanceTest'); - $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 - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->updateInstance($instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - 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 updateUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $user = new User(); - $response = $gapicClient->updateUser($user); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateUserExceptionTest() - { - $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 - $user = new User(); - try { - $gapicClient->updateUser($user); - // 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 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Resources.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/GPBMetadata/Google/Cloud/Alloydb/V1Beta/Resources.php deleted file mode 100644 index aabead8c4481abe28cb622492d26f061e114c61a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12342 zcmds7&2t-9ayI~ep+Q2>h@>FMmSEUk)3yxQuA;`)l(Lo%{yzcj2 zzkc1n{`mUa;qegON$+R_%~Bn$pYEQfontLMv`okBnMS%hIy}^@bk95)>V{@z)9G?O zU8}d#m2$QHHj>)r$m(f@^pR;E8CtGqn4^A9H4O8#-_5=Jw5vI4&eHfOJInY24Ac|N z9;!Vpz0)Y};gG)Ss0TZY#X*T!9LSu-!TzU3{Qea{&roeU-E>*OPmsoc!%^4JduiKI z9sKjIZY%mgcXZXzf5hEm~+g-qV4P$mF4Zu&rxGzo;FnFLl!@6vn$6Gr5S=73%y{o;b=Q z)EkuIHAve!DuJV(46i}^%uo@9gL#--rMDEqru^>muFdgR|^zWyRgf^1GF~BRHu;-MeS}nx*cE zPwdj6?&kX9u*CQKv)>)}L@r|RN{C&27YoZdDBB!Lhs)OQBXMQ|5Ee(y9hId-g`wB~oa~$q4d}=YO3IkZ*Qo*4f{rR*ZM10=H(y(l_Zn zczdt9)0ErQdQEB7JIzu>X+LjNluoVHsFbSP)k-<>hO`Wk@?I+u%4|WRGU!>SL%LNZ zb8x61N$ars;>1>7Xr~HUPQKa9KZYSb9$Fn7nomc-`;`yj0tL*5GBe?u6c4py<3nZ)FCcs{8+E;K2I!WzJ?Wd^>~>!O0uiB z(<-|GH^-mEnV;oG=YNW>}IdY`q`5RDKR7J2npdZt4K95Y+-nbA0|en^v~svw;|Z0R#dcxt2|+|W&a2tk5Q9lQ^l{--Ie z!D7!G4Y;>jOnnToi499Jh@ge%#+`<~RE-h8Akjkj%TN)}rU`8?#vtmgj6NtrM>78! zf=xUpM<0yLk5fJf8?I>B`Qi>m^+p}hgBgHrY^$Jq+CAU1)*bSD3p_ZJQgzE zsR+8xX$A9Ch7Xq^si~HsBMY=RHUmDF{t61NBas(U%=YXL_CYp)D^@R z&iv<1ST1pP=saB;B^>AtrZ*qBN8o#ulcHcEM#H`bi4zz5xz0Gjcs&T@H3P?7b~j;R zLVyf1BEahF_RvrTz+#{iVQ7SofYd$8kNY9SdX|Qc?J6fMA=PMz5w4)(PU14XAgaD* zpyT0lk&%t%FQxkRj1>+Be&VRIlV<1izf(r#anASK-#)uAac1#@%OiE%9 z#9n2d?en>oC6DQt-$bw&BZEHZ>4rWyO0MAqEBs{2uqu)x3JbR4Z1=(UaWYCHE(=l% zZmTZ5LjXkh4nr^kc*&cLVX!!T9l!JlfbhCF7K!osMd1ED#9j<1L;mRI7GrZoKgBe~ z#}BPDW>@z^-$4?0CH%1~FR{~6A(OWqzT=6oJoP!O zO|4jZ7j92TbArHT5SF`^D}upP9untn{v`l1^UonzWQJP8(5=;$+q3a!6c(Emx%?dC z?HI-Bc4-IN;*8oVssfY_c~t+gvPxmKzqRuJPx8_oJ&osmZ~I}n?&{|HQzrCkj9G2r(} z7vTCD&FY@qq{SkmR;5(0mFZ`=(0wf{aPI;@B&LuGhyZ`D^&C6*lXyDIxe*P%b05zz zqs`C}z7tPp%}}Vg0!tj#Wd3CxR;mMZnV4?EZT~;U7V-?X2sSUSOs2rax6|Mv*qnMC zCeTF<)^s6k4lg(w2(~01Blp1t7-8uN#81@Tu|CjTLr0!GmJc?{E}!fkrxkYYDcn?F zsyc?j=zB3eKp`pf@bUZ?friuLCr^;mA}JMmglWtl&4GrnfUrUX;vOVAG}I#-T|5QC zU(Pp!i;T93lp}_1SbJsZh_Wzp8BoTIJI-L_=PkJ=vSkr;;)_IXC)e46u1x=Tu<`wf z;!u5H>qp0q?H$^RC@9#mxoomcq^9DI z;D@mq`V6(-$JozKQhXx*)8M}Q>-p5J#JHfi1QRYe?piajHhq6?V!CxW z!gZ0#^{3Q=%IW?J-M|WMD>j!GoMOY3$016j+=W|Qdu_);;H?eTBqkAj7gJ2aru%Jr3B@~bTk+?edKcm| z3X7tmD>^0Oe+pqSX7cbWurQH0|K)rKJ;@{fPMrU(LZnfMjXkk93O}Y|<*zA|NF$SV;PIDwLo@jOFJIB?$aq6^T6r z$;YN%g2k?d-|(QWhu`JkM1(gFY$Ld- zH0t$TM43}4E|Ni8ea;)c4R6W&2r=bib+_7n?l%Ks)$i&xc^9<`x81DlVEqVxg$qBt zmPc^^0#xYkL8@OL7UpyTOb{x%kAxL7f51ZB*aA|RMdANA2PI9r5te*naSnzK8$<0x z>1mduAChrGr9W2n0ZUCri;I+QU%&LC(zr6We z&$Iiq>&%~Hu*9R-|D!;eXD}~K!hP!jRP++a{89z%U>${1xur_PxaBhuhW$6Z%GM-I;VVEO=3tuC7?*d&7&4lRY|K^t_jNKUPv>{U zlfE}Rks_J#!G z?ZG7>>C1VIeV65U(W&tV=ForMlm6DIWwF2egV z%(fVu#uhb?8J2_&VV%0Iju1yrO~VV?+kqC(e;VrRLv}OsO#5k!PblK%**@l`F&YO} zr{%FeZzu{5jr^zIr(!QN!uK)1-s@>Y41Z5XhNBNLDrZyhn(PY3j2pHqdZpiW>moLW z5>&6e(p99WMZjsBc#$x%!p=(iE2#(AU2;zP*mo5t)BXw*rea-GiI1j6aLY%CQWl~Z z>hPfqr^oVl-Sa^eWL=e6B>dtblK~sA{vgJ4_#QMq(}Cz%cq!Q2mv=k9*b~!}n2w}e zBuj5nCUU3JMB12bj3bM;fQL9v30bCr9%O+|gg%C(B1Ea$!xfaG&C6TotA%679&0CIC@?#D#cC}Tezy!x;62(D(@*ojBwm|E$eXi0{PNp z($2i%JfES>jgSFaEc!$C>ciiS!<2npdnHYVDf`vRvzczZ+o;NJ6vI9jMI7=`?Vn-@^^p+=|+!l!iCU za$CkFRut?3Yf+=&bf*^Lx<fMotu^ pk+*m{>n`DF$NcPluNCf;LgFqSk>CX(o)98JfT#o|0#PL3fd?KCPY9{}=QcOb&dzR9 ziIRudp83z2|NHOf|7XrVUB6yO$I=U$p;@YDtaR1f ztm`$+%B0h!rSz4h)%09xarG!HwatcA)$-{L)7+?O*=o&ftYy_&&D>tAWVcRKG)K+a znzf}@wG7=AAw%8N?7CXj(hJMQ%RsQEI%;`=Zcv^j8GwPtIub|>w6!>BsCX{5=5C8MfM z9#6A93GG956Of-v3zn9NFhCIHMZ?i7L#>rdnq9T@x?@_)K$_2QXpSpFa%J*3e=ONf zUr$dm9`pGfOrA?SRzveYJ)O2Rr(qdqDBom*+wO1W2!R#qdbwa2CXs?^*!jGN$=jmY z!r7Xx8BTj^=5?*MR@APmTe@krxAdyU%_T9DQRYw<+q41pl4)#M4a3lljq*~R7<+rd za&4g0U~7{Dcb9_l<~Hljb_YwT%rC3fmmUx>--Y_G-OaUIBw@G?6g%kjKvJ z+#d>SYp(gvLztL!4VIYiBj{ZR9Zwt|@B|~x&`^@$p(MjX$@l@jk6PCu))3=mQDyvy z@5VZ@P^H36loK5E5m?*~`K?F!t;padXl+h>j1$*9i^`g=MRB6ToQOs|2p!oqZZ`Zr z$C!2RYs4`4O%Y4on+(q;sGm~^ur7robj%5an5=p=OJYxhb1#2OLi;Z1wliC6*bvO@ ztJ)_UU>*1g)Kgb25a*bbmL~g)A9=5k`gb9X4-5G-Kp=KI1IZxE*W*#tUspFY#fF$W zmV%|-#jf`X62=J8>yCLtGse2eo_HVXS=Vdu)UjRk8I*7Y^_kY1W+|2Jv2ORW{0iD1 zWYexgaMOU#zA9%OIPIDo$UT%{tVP;OM(}w6?KQNQ9mU5K;g&Ep&@e1btzK6vH4QlJ zn(UW9E1}^9O$bTIXa?;fsVgWU)Jj5U(5@|AyGeyJn43((?ejoS#VG$-LWgF7J4aj5 zs;04~TH73vV5(Ea9UwWC+JK_3QRe!|BU3n!dif2iwuAy^YhhE185G&nQzsrrd$u4i zL!#Fd)2MBa^?>mE7{+%cw4Y)8@Idn!@D6AMHi!0mfOf4;P=}z+fYs6K3h`=cQ3JVg zVH?7&Gj7F5!gC$ zlc4EP-(>s^qg_w}Zm<~Anq`c-*G;HM{j9z%p^;_F+%*5Uc$Hu6LL*SiKp7dfk0RPr zQL8r^b%hm7G-3|qjtdKk%8i*KU9mz7@@F2vA4OvjG92A#m;Io3wb5v#CT;v8L@!$S zz@eVGrou}Lo7;FU*2W{Zr8<#+B%z6->Qt`>Y3_sTKa2WYCRv7V5n?IAkZ$cL%kdJn z`~rF~n)`bV2lCsg=&ePM29Kd3R~wFMLED2VqaVM7hTS{tz@gbtRgwaIDOOKWP{i{x zLNY7#2&36^hGT7yn`k8R1|C3NH?(b5pW`{y4JBuTok|9BPqfPgduBd$T9V&Qp@R{8 zG75YVbrZzwTrikB+u4IMWH${Dqkhe@OiS6cH&|7UkD_jRiPr#F>j(X>u?Z?-)XKu5edjrM!i@83Q9|cxAP)I;UK_va&okyEwl%R~mW%&U1syb5}}> zR~D4nt8;LFNW%T78-6XlIF!P>Q6Iew_lLU3U!}QAbF1X9U2qcYnJ+9}f^E9-UNmrZ z=@R^|6brK#hkE2cKrCk!vfxX^^3FhJN`E&so(fgP57VOf2tL%LC}zt^ zR10;9A{#`5!3Gf?3ipQOZPvYVx#B5r2K83x;YZX4$6_sobJbq;yMTtE_+?9lk)8~c zzFZh6UKsK_(1K%?M{u(aWeXiRhCNibo<=?FIXz>UGnC!CeVPXcg7g z=4#e1bx6V*+&EV-K-Ws`ELg$s=l#m?95_i>AG-eB?6*BlETr2B@?L>8bG>^?( zS$(O$~1CmU8pljnC~cueT70?*M6THw>RaTneXZDUm-=s0A;xm-hIq>pYI2IO~` zxGfs%rjUBG!+Pt^K{L6_@2AkPJKYnf2&|(c6>{8DLI+CQ72Fu>hsD7 z8YG7kXaK?x(1uBkXFgr{7#g)$yIxyUs-*o@tI@%zXFpwV<{N;ij{+Oppun+SsKl7c zix>^@<%(U`s>G?}Z%Sy0M1gBC^LOLW$xs|RM&r;SJkcZ$k;P5hXv7)F#K|{VVqVhD zc*#b?J}$WvJdV1-n=BEBjtZ}gtTri+&B9LfRB09sf-{hX!UawQ>IW_s6ekw>=P;UL z)q{VdjwB2&OYny32AFb@tGsGxEd(O`4*Oic1}v;*@MGz$Vi0UI|LKhF`%o?1Lc^?B z@FQwp%^ejAxo^*)-39XIOsQB{+tdyGLkaCBcFw0yHhw(Trv0ScM8{9Gv4Z)LTzKuB zzr2~s;m5`MKeyOu`5dG-a?Z1}Q`wpc37EWsk)65?gM2oOzFXi!X#5QcA(A-Q4V;N( z!Xp$+Cz=V%Pw(K9jCY%G=`sln-!0Gy7ygrk_Ap-*jK)hVKr47XB(V8jD9E@;On!wj zc}8wqn0YbAy<0fQ+Jp!{O%cxKPP^v9 z`OG9#hY#sK0kPptS6gBH6<`buGI2b{0Bu5yHD+p4o)!~g!R;42fTfBYZ z^R>>S%1^=LNUjlmN4tf`1!x82c#94#;hE_&6~lRaHklawF+Zz|5v!M_zAvExNIn7v z&crKlScd(tz(>$JiN$a2BOU#&DzT-t1Bo?f13`i~VAw=|IiX!Xe-tia}P$B!nF#P6+#D7PzLoAkcZ> zYOe%(5Bd<{@fMzmwdyc=LX0;l#%ErpbPH3N3JgsqQ89oNpwC<6o-?Q76Q^MHRUyms}U^1THBB zfzvkhNU8`@uCVcf-9nE(N`b5Op`LFo;-GwiLOp@AF4Pv~V1-TBywc}u66%M7hHZ== zi*+oQPB5Hgnj@dz!DE~{ID@`A2VN`Q%`yaMGG0u6Qo(178i#rQQ*ygf%=5wA-NFH0 z(=hI**$-OJOrRdlc0|s)3(!~^N(9YMnh@GH75;_X6Rv?U-eQv#BOx6f4NiQI@omJgwMtD+jO0P8!xVyKlYL2jwu?A z^`dk6JO1fNVC02QwSXNxA{&1+c3E(&CV!k_Tf&!t@9N70|@!V zAW3K2ZV~cbI-$7u4z7=!D{7H~$z!j%6l<0~Ft@X0d|`Whe_cYokb(%?I9{NfO7Prz zh#)WQU^6b1@a81xe^VZP+3Ls8@MbB9@)<8KkFX6^%Vo;z1z*3eO_Ap5VCZgPAJ19@ z!!-F1G8X;`0APtG0RWG%4FJr(=W^#<`zFth%}5af7a)ch_g`Up}=r%(C1>OrV?f?J) diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php deleted file mode 100644 index 9f51a8eccea1..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy.php +++ /dev/null @@ -1,392 +0,0 @@ -google.cloud.alloydb.v1beta.AutomatedBackupPolicy - */ -class AutomatedBackupPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - */ - protected $enabled = null; - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - */ - protected $backup_window = null; - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - */ - protected $location = ''; - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - protected $schedule; - protected $retention; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule $weekly_schedule - * Weekly schedule for the Backup. - * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention $time_based_retention - * Time-based Backup retention policy. - * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention $quantity_based_retention - * Quantity-based Backup retention policy to retain recent backups. - * @type bool $enabled - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * @type \Google\Protobuf\Duration $backup_window - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * @type string $location - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels to apply to backups created using this configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Weekly schedule for the Backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; - * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule|null - */ - public function getWeeklySchedule() - { - return $this->readOneof(2); - } - - public function hasWeeklySchedule() - { - return $this->hasOneof(2); - } - - /** - * Weekly schedule for the Backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule weekly_schedule = 2; - * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule $var - * @return $this - */ - public function setWeeklySchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\WeeklySchedule::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Time-based Backup retention policy. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; - * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention|null - */ - public function getTimeBasedRetention() - { - return $this->readOneof(4); - } - - public function hasTimeBasedRetention() - { - return $this->hasOneof(4); - } - - /** - * Time-based Backup retention policy. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention time_based_retention = 4; - * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention $var - * @return $this - */ - public function setTimeBasedRetention($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\TimeBasedRetention::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Quantity-based Backup retention policy to retain recent backups. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; - * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention|null - */ - public function getQuantityBasedRetention() - { - return $this->readOneof(5); - } - - public function hasQuantityBasedRetention() - { - return $this->hasOneof(5); - } - - /** - * Quantity-based Backup retention policy to retain recent backups. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention quantity_based_retention = 5; - * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention $var - * @return $this - */ - public function setQuantityBasedRetention($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy\QuantityBasedRetention::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - * @return bool - */ - public function getEnabled() - { - return isset($this->enabled) ? $this->enabled : false; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Whether automated automated backups are enabled. If not set, defaults to - * true. - * - * Generated from protobuf field optional bool enabled = 1; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getBackupWindow() - { - return $this->backup_window; - } - - public function hasBackupWindow() - { - return isset($this->backup_window); - } - - public function clearBackupWindow() - { - unset($this->backup_window); - } - - /** - * The length of the time window during which a backup can be - * taken. If a backup does not succeed within this time window, it will be - * canceled and considered failed. - * The backup window must be at least 5 minutes long. There is no upper bound - * on the window. If not set, it defaults to 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration backup_window = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setBackupWindow($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->backup_window = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * The location where the backup will be stored. Currently, the only supported - * option is to store the backup in the same region as the cluster. - * If empty, defaults to the region of the cluster. - * - * Generated from protobuf field string location = 6; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels to apply to backups created using this configuration. - * - * Generated from protobuf field map labels = 7; - * @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; - } - - /** - * @return string - */ - public function getSchedule() - { - return $this->whichOneof("schedule"); - } - - /** - * @return string - */ - public function getRetention() - { - return $this->whichOneof("retention"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php deleted file mode 100644 index 66c0a2f3d5e9..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/QuantityBasedRetention.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - */ -class QuantityBasedRetention extends \Google\Protobuf\Internal\Message -{ - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - */ - protected $count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $count - * The number of backups to retain. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * The number of backups to retain. - * - * Generated from protobuf field int32 count = 1; - * @param int $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkInt32($var); - $this->count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QuantityBasedRetention::class, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy_QuantityBasedRetention::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php deleted file mode 100644 index 2ed7e5644557..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/TimeBasedRetention.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - */ -class TimeBasedRetention extends \Google\Protobuf\Internal\Message -{ - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - */ - protected $retention_period = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $retention_period - * The retention period. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - * @return \Google\Protobuf\Duration|null - */ - public function getRetentionPeriod() - { - return $this->retention_period; - } - - public function hasRetentionPeriod() - { - return isset($this->retention_period); - } - - public function clearRetentionPeriod() - { - unset($this->retention_period); - } - - /** - * The retention period. - * - * Generated from protobuf field .google.protobuf.Duration retention_period = 1; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRetentionPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->retention_period = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TimeBasedRetention::class, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy_TimeBasedRetention::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php deleted file mode 100644 index ff5c67a97ea7..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/AutomatedBackupPolicy/WeeklySchedule.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - */ -class WeeklySchedule extends \Google\Protobuf\Internal\Message -{ - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - */ - private $start_times; - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - */ - private $days_of_week; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $start_times - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStartTimes() - { - return $this->start_times; - } - - /** - * The times during the day to start a backup. The start times are assumed - * to be in UTC and to be an exact hour (e.g., 04:00:00). - * If no start times are provided, a single fixed start time is chosen - * arbitrarily. - * - * Generated from protobuf field repeated .google.type.TimeOfDay start_times = 1; - * @param array<\Google\Type\TimeOfDay>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStartTimes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Type\TimeOfDay::class); - $this->start_times = $arr; - - return $this; - } - - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDaysOfWeek() - { - return $this->days_of_week; - } - - /** - * The days of the week to perform a backup. - * If this field is left empty, the default of every day of the week is - * used. - * - * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDaysOfWeek($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); - $this->days_of_week = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(WeeklySchedule::class, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy_WeeklySchedule::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php deleted file mode 100644 index dacfed1b4c3d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup.php +++ /dev/null @@ -1,917 +0,0 @@ -google.cloud.alloydb.v1beta.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - */ - private $labels; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.Type type = 8; - */ - protected $type = 0; - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - */ - protected $description = ''; - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cluster_uid = ''; - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $cluster_name = ''; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - */ - private $annotations; - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $size_bytes = 0; - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expiry_time = null; - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expiry_quantity = null; - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $database_version = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * @type string $display_name - * User-settable and human-readable display name for the Backup. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current state of the backup. - * @type int $type - * The backup type, which suggests the trigger for the backup. - * @type string $description - * User-provided description of the backup. - * @type string $cluster_uid - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * @type string $cluster_name - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * @type \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $encryption_info - * Output only. The encryption information for the backup. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type int|string $size_bytes - * Output only. The size of the backup in bytes. - * @type \Google\Protobuf\Timestamp $expiry_time - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * @type \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry $expiry_quantity - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * @type int $database_version - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * where the cluster and backup ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the backup resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Backup. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 6; - * @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 current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Backup\State::class); - $this->state = $var; - - return $this; - } - - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.Type type = 8; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The backup type, which suggests the trigger for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.Type type = 8; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Backup\Type::class); - $this->type = $var; - - return $this; - } - - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * User-provided description of the backup. - * - * Generated from protobuf field string description = 9; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getClusterUid() - { - return $this->cluster_uid; - } - - /** - * Output only. The system-generated UID of the cluster which was used to - * create this resource. - * - * Generated from protobuf field string cluster_uid = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setClusterUid($var) - { - GPBUtil::checkString($var, True); - $this->cluster_uid = $var; - - return $this; - } - - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getClusterName() - { - return $this->cluster_name; - } - - /** - * Required. The full resource name of the backup source cluster - * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - * - * Generated from protobuf field string cluster_name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setClusterName($var) - { - GPBUtil::checkString($var, True); - $this->cluster_name = $var; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - * true, indicates that the service is actively updating the resource. This - * can happen due to user-triggered updates or system actions like failover or - * maintenance. - * - * Generated from protobuf field bool reconciling = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the - * backup with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 14; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 16; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getSizeBytes() - { - return $this->size_bytes; - } - - /** - * Output only. The size of the backup in bytes. - * - * Generated from protobuf field int64 size_bytes = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setSizeBytes($var) - { - GPBUtil::checkInt64($var); - $this->size_bytes = $var; - - return $this; - } - - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpiryTime() - { - return $this->expiry_time; - } - - public function hasExpiryTime() - { - return isset($this->expiry_time); - } - - public function clearExpiryTime() - { - unset($this->expiry_time); - } - - /** - * Output only. The time at which after the backup is eligible to be garbage - * collected. It is the duration specified by the backup's retention policy, - * added to the backup's create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp expiry_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpiryTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expiry_time = $var; - - return $this; - } - - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry|null - */ - public function getExpiryQuantity() - { - return $this->expiry_quantity; - } - - public function hasExpiryQuantity() - { - return isset($this->expiry_quantity); - } - - public function clearExpiryQuantity() - { - unset($this->expiry_quantity); - } - - /** - * Output only. The QuantityBasedExpiry of the backup, specified by the - * backup's retention policy. Once the expiry quantity is over retention, the - * backup is eligible to be garbage collected. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry $var - * @return $this - */ - public function setExpiryQuantity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Backup\QuantityBasedExpiry::class); - $this->expiry_quantity = $var; - - return $this; - } - - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDatabaseVersion() - { - return $this->database_version; - } - - /** - * Output only. The database engine major version of the cluster this backup - * was created from. Any restored cluster created from this backup will have - * the same database version. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDatabaseVersion($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\DatabaseVersion::class); - $this->database_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php deleted file mode 100644 index d460888686a4..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/QuantityBasedExpiry.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - */ -class QuantityBasedExpiry extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $retention_count = 0; - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $total_retention_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $retention_count - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * @type int $total_retention_count - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRetentionCount() - { - return $this->retention_count; - } - - /** - * Output only. The backup's position among its backups with the same source - * cluster and type, by descending chronological order create time(i.e. - * newest first). - * - * Generated from protobuf field int32 retention_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRetentionCount($var) - { - GPBUtil::checkInt32($var); - $this->retention_count = $var; - - return $this; - } - - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getTotalRetentionCount() - { - return $this->total_retention_count; - } - - /** - * Output only. The length of the quantity-based queue, specified by the - * backup's retention policy. - * - * Generated from protobuf field int32 total_retention_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setTotalRetentionCount($var) - { - GPBUtil::checkInt32($var); - $this->total_retention_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QuantityBasedExpiry::class, \Google\Cloud\AlloyDb\V1beta\Backup_QuantityBasedExpiry::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php deleted file mode 100644 index bd87c613c3e4..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.alloydb.v1beta.Backup.State - */ -class State -{ - /** - * The state of the backup is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The backup is ready. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The backup is creating. - * - * Generated from protobuf enum CREATING = 2; - */ - const CREATING = 2; - /** - * The backup failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The backup is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::CREATING => 'CREATING', - self::FAILED => 'FAILED', - self::DELETING => 'DELETING', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1beta\Backup_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php deleted file mode 100644 index bdb758166726..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Backup/Type.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.alloydb.v1beta.Backup.Type - */ -class Type -{ - /** - * Backup Type is unknown. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * ON_DEMAND backups that were triggered by the customer (e.g., not - * AUTOMATED). - * - * Generated from protobuf enum ON_DEMAND = 1; - */ - const ON_DEMAND = 1; - /** - * AUTOMATED backups triggered by the automated backups scheduler pursuant - * to an automated backup policy. - * - * Generated from protobuf enum AUTOMATED = 2; - */ - const AUTOMATED = 2; - /** - * CONTINUOUS backups triggered by the automated backups scheduler - * due to a continuous backup policy. - * - * Generated from protobuf enum CONTINUOUS = 3; - */ - const CONTINUOUS = 3; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::ON_DEMAND => 'ON_DEMAND', - self::AUTOMATED => 'AUTOMATED', - self::CONTINUOUS => 'CONTINUOUS', - ]; - - 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(Type::class, \Google\Cloud\AlloyDb\V1beta\Backup_Type::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php deleted file mode 100644 index cd85e48f7c60..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BackupSource.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.alloydb.v1beta.BackupSource - */ -class BackupSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $backup_uid = ''; - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $backup_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $backup_uid - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * @type string $backup_name - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBackupUid() - { - return $this->backup_uid; - } - - /** - * Output only. The system-generated UID of the backup which was used to - * create this resource. The UID is generated when the backup is created, and - * it is retained until the backup is deleted. - * - * Generated from protobuf field string backup_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBackupUid($var) - { - GPBUtil::checkString($var, True); - $this->backup_uid = $var; - - return $this; - } - - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackupName() - { - return $this->backup_name; - } - - /** - * Required. The name of the backup resource with the format: - * * projects/{project}/locations/{region}/backups/{backup_id} - * - * Generated from protobuf field string backup_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackupName($var) - { - GPBUtil::checkString($var, True); - $this->backup_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php deleted file mode 100644 index 8f5aef1eeac6..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - */ -class BatchCreateInstanceStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; - */ - protected $state = 0; - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - */ - protected $error_msg = ''; - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - */ - protected $error = null; - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * @type string $error_msg - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * @type \Google\Rpc\Status $error - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * @type int $type - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The current state of an instance involved in the batch create operation. - * Once the operation is complete, the final state of the instances in the - * LRO can be one of: - * 1. ACTIVE, indicating that instances were created successfully - * 2. FAILED, indicating that a particular instance failed creation - * 3. ROLLED_BACK indicating that although the instance was created - * successfully, it had to be rolled back and deleted due to failure in - * other steps of the workflow. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstanceStatus\State::class); - $this->state = $var; - - return $this; - } - - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - * @return string - */ - public function getErrorMsg() - { - return $this->error_msg; - } - - /** - * DEPRECATED - Use the error field instead. - * Error, if any error occurred and is available, during instance creation. - * - * Generated from protobuf field string error_msg = 2; - * @param string $var - * @return $this - */ - public function setErrorMsg($var) - { - GPBUtil::checkString($var, True); - $this->error_msg = $var; - - return $this; - } - - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * The RPC status of the instance creation operation. This field will be - * present if an error happened during the instance creation. - * - * Generated from protobuf field .google.rpc.Status error = 4; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType type = 3; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\InstanceType::class); - $this->type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php deleted file mode 100644 index 079a5e357c56..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstanceStatus/State.php +++ /dev/null @@ -1,97 +0,0 @@ -google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State - */ -class State -{ - /** - * The state of the instance is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Instance is pending creation and has not yet been picked up for - * processsing in the backend. - * - * Generated from protobuf enum PENDING_CREATE = 1; - */ - const PENDING_CREATE = 1; - /** - * The instance is active and running. - * - * Generated from protobuf enum READY = 2; - */ - const READY = 2; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 3; - */ - const CREATING = 3; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The creation of the instance failed or a fatal error occurred during - * an operation on the instance or a batch of instances. - * - * Generated from protobuf enum FAILED = 5; - */ - const FAILED = 5; - /** - * The instance was created successfully, but was rolled back and deleted - * due to some other failure during BatchCreateInstances operation. - * - * Generated from protobuf enum ROLLED_BACK = 6; - */ - const ROLLED_BACK = 6; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING_CREATE => 'PENDING_CREATE', - self::READY => 'READY', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::ROLLED_BACK => 'ROLLED_BACK', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstanceStatus_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php deleted file mode 100644 index 918b59168228..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesMetadata.php +++ /dev/null @@ -1,134 +0,0 @@ -google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - */ -class BatchCreateInstancesMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - */ - private $instance_targets; - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - */ - private $instance_statuses; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $instance_targets - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * @type array|\Google\Protobuf\Internal\MapField $instance_statuses - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstanceTargets() - { - return $this->instance_targets; - } - - /** - * The instances being created in the API call. Each string in this list - * is the server defined resource path for target instances in the request - * and for the format of each string, see the comment on the Instance.name - * field. - * - * Generated from protobuf field repeated string instance_targets = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstanceTargets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->instance_targets = $arr; - - return $this; - } - - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getInstanceStatuses() - { - return $this->instance_statuses; - } - - /** - * A map representing state of the instances involved in the - * BatchCreateInstances operation during the operation execution. - * The instance state will be in STATE_UNSPECIFIED state if the instance has - * not yet been picked up for processing. - * The key of the map is the name of the instance resource. - * For the format, see the comment on the Instance.name field. - * - * Generated from protobuf field map instance_statuses = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setInstanceStatuses($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstanceStatus::class); - $this->instance_statuses = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php deleted file mode 100644 index 413efcf08245..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - */ -class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $requests = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. - * @type \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests $requests - * Required. Resources being created. - * @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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. - * - * 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 name of the parent resource. - * - * 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. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests|null - */ - public function getRequests() - { - return $this->requests; - } - - public function hasRequests() - { - return isset($this->requests); - } - - public function clearRequests() - { - unset($this->requests); - } - - /** - * Required. Resources being created. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.CreateInstanceRequests requests = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests $var - * @return $this - */ - public function setRequests($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequests::class); - $this->requests = $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 = 3 [(.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 = 3 [(.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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php deleted file mode 100644 index b518af308ff1..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/BatchCreateInstancesResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - */ -class BatchCreateInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; - */ - private $instances; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * Created instances. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * Created instances. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; - * @param array<\Google\Cloud\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Instance::class); - $this->instances = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php deleted file mode 100644 index b1c8edfc1190..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster.php +++ /dev/null @@ -1,1189 +0,0 @@ -google.cloud.alloydb.v1beta.Cluster - */ -class Cluster extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - /** - * Output only. The current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cluster_type = 0; - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $database_version = 0; - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $network_config = null; - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @deprecated - */ - protected $network = ''; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - */ - private $annotations; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $initial_user = null; - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; - */ - protected $automated_backup_policy = null; - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; - * @deprecated - */ - protected $ssl_config = null; - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $encryption_config = null; - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $continuous_backup_config = null; - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $continuous_backup_info = null; - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; - */ - protected $secondary_config = null; - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $primary_config = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1beta\BackupSource $backup_source - * Output only. Cluster created from backup. - * @type \Google\Cloud\AlloyDb\V1beta\MigrationSource $migration_source - * Output only. Cluster created via DMS migration. - * @type string $name - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * @type string $display_name - * User-settable and human-readable display name for the Cluster. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current serving state of the cluster. - * @type int $cluster_type - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * @type int $database_version - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * @type \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig $network_config - * @type string $network - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * @type \Google\Cloud\AlloyDb\V1beta\UserPassword $initial_user - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * @type \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy $automated_backup_policy - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * @type \Google\Cloud\AlloyDb\V1beta\SslConfig $ssl_config - * SSL configuration for this AlloyDB cluster. - * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * @type \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $encryption_info - * Output only. The encryption information for the cluster. - * @type \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig $continuous_backup_config - * Optional. Continuous backup configuration for this cluster. - * @type \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo $continuous_backup_info - * Output only. Continuous backup properties for this cluster. - * @type \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig $secondary_config - * Cross Region replication config specific to SECONDARY cluster. - * @type \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig $primary_config - * Output only. Cross Region replication config specific to PRIMARY cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Cluster created from backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\BackupSource|null - */ - public function getBackupSource() - { - return $this->readOneof(15); - } - - public function hasBackupSource() - { - return $this->hasOneof(15); - } - - /** - * Output only. Cluster created from backup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\BackupSource $var - * @return $this - */ - public function setBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\BackupSource::class); - $this->writeOneof(15, $var); - - return $this; - } - - /** - * Output only. Cluster created via DMS migration. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\MigrationSource|null - */ - public function getMigrationSource() - { - return $this->readOneof(16); - } - - public function hasMigrationSource() - { - return $this->hasOneof(16); - } - - /** - * Output only. Cluster created via DMS migration. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource migration_source = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\MigrationSource $var - * @return $this - */ - public function setMigrationSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\MigrationSource::class); - $this->writeOneof(16, $var); - - return $this; - } - - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the cluster resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * where the cluster ID segment should satisfy the regex expression - * `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - * The prefix of the cluster resource name is the name of the parent resource: - * * projects/{project}/locations/{region} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Cluster. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @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 current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current serving state of the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Cluster\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getClusterType() - { - return $this->cluster_type; - } - - /** - * Output only. The type of the cluster. This is an output-only field and it's - * populated at the Cluster creation time or the Cluster promotion - * time. The cluster type is determined by which RPC was used to create - * the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.ClusterType cluster_type = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setClusterType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Cluster\ClusterType::class); - $this->cluster_type = $var; - - return $this; - } - - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDatabaseVersion() - { - return $this->database_version; - } - - /** - * Optional. The database engine major version. This is an optional field and - * it is populated at the Cluster creation time. If a database version is not - * supplied at cluster creation time, then a default database version will - * be used. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.DatabaseVersion database_version = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDatabaseVersion($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\DatabaseVersion::class); - $this->database_version = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - * @deprecated - */ - public function getNetwork() - { - @trigger_error('network is deprecated.', E_USER_DEPRECATED); - return $this->network; - } - - /** - * Required. The resource link for the VPC network in which cluster resources - * are created and from which they are accessible via Private IP. The network - * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required - * to create a cluster. Deprecated, use network_config.network instead. - * - * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - * @deprecated - */ - public function setNetwork($var) - { - @trigger_error('network is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 11; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 12; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Cluster does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\UserPassword|null - */ - public function getInitialUser() - { - return $this->initial_user; - } - - public function hasInitialUser() - { - return isset($this->initial_user); - } - - public function clearInitialUser() - { - unset($this->initial_user); - } - - /** - * Input only. Initial user to setup during cluster creation. Required. - * If used in `RestoreCluster` this is ignored. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.UserPassword initial_user = 14 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\UserPassword $var - * @return $this - */ - public function setInitialUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\UserPassword::class); - $this->initial_user = $var; - - return $this; - } - - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; - * @return \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy|null - */ - public function getAutomatedBackupPolicy() - { - return $this->automated_backup_policy; - } - - public function hasAutomatedBackupPolicy() - { - return isset($this->automated_backup_policy); - } - - public function clearAutomatedBackupPolicy() - { - unset($this->automated_backup_policy); - } - - /** - * The automated backup policy for this cluster. - * If no policy is provided then the default policy will be used. If backups - * are supported for the cluster, the default policy takes one backup a day, - * has a backup window of 1 hour, and retains backups for 14 days. - * For more information on the defaults, consult the - * documentation for the message type. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; - * @param \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy $var - * @return $this - */ - public function setAutomatedBackupPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\AutomatedBackupPolicy::class); - $this->automated_backup_policy = $var; - - return $this; - } - - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; - * @return \Google\Cloud\AlloyDb\V1beta\SslConfig|null - * @deprecated - */ - public function getSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - return $this->ssl_config; - } - - public function hasSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - return isset($this->ssl_config); - } - - public function clearSslConfig() - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - unset($this->ssl_config); - } - - /** - * SSL configuration for this AlloyDB cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; - * @param \Google\Cloud\AlloyDb\V1beta\SslConfig $var - * @return $this - * @deprecated - */ - public function setSslConfig($var) - { - @trigger_error('ssl_config is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SslConfig::class); - $this->ssl_config = $var; - - return $this; - } - - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Optional. The encryption config can be specified to encrypt the data disks - * and other persistent data resources of a cluster with a - * customer-managed encryption key (CMEK). When this field is not - * specified, the cluster will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig|null - */ - public function getContinuousBackupConfig() - { - return $this->continuous_backup_config; - } - - public function hasContinuousBackupConfig() - { - return isset($this->continuous_backup_config); - } - - public function clearContinuousBackupConfig() - { - unset($this->continuous_backup_config); - } - - /** - * Optional. Continuous backup configuration for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig $var - * @return $this - */ - public function setContinuousBackupConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\ContinuousBackupConfig::class); - $this->continuous_backup_config = $var; - - return $this; - } - - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo|null - */ - public function getContinuousBackupInfo() - { - return $this->continuous_backup_info; - } - - public function hasContinuousBackupInfo() - { - return isset($this->continuous_backup_info); - } - - public function clearContinuousBackupInfo() - { - unset($this->continuous_backup_info); - } - - /** - * Output only. Continuous backup properties for this cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo $var - * @return $this - */ - public function setContinuousBackupInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\ContinuousBackupInfo::class); - $this->continuous_backup_info = $var; - - return $this; - } - - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; - * @return \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig|null - */ - public function getSecondaryConfig() - { - return $this->secondary_config; - } - - public function hasSecondaryConfig() - { - return isset($this->secondary_config); - } - - public function clearSecondaryConfig() - { - unset($this->secondary_config); - } - - /** - * Cross Region replication config specific to SECONDARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; - * @param \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig $var - * @return $this - */ - public function setSecondaryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster\SecondaryConfig::class); - $this->secondary_config = $var; - - return $this; - } - - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig|null - */ - public function getPrimaryConfig() - { - return $this->primary_config; - } - - public function hasPrimaryConfig() - { - return isset($this->primary_config); - } - - public function clearPrimaryConfig() - { - unset($this->primary_config); - } - - /** - * Output only. Cross Region replication config specific to PRIMARY cluster. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig $var - * @return $this - */ - public function setPrimaryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster\PrimaryConfig::class); - $this->primary_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php deleted file mode 100644 index f6b5b79f2a22..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/ClusterType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1beta.Cluster.ClusterType - */ -class ClusterType -{ - /** - * The type of the cluster is unknown. - * - * Generated from protobuf enum CLUSTER_TYPE_UNSPECIFIED = 0; - */ - const CLUSTER_TYPE_UNSPECIFIED = 0; - /** - * Primary cluster that support read and write operations. - * - * Generated from protobuf enum PRIMARY = 1; - */ - const PRIMARY = 1; - /** - * Secondary cluster that is replicating from another region. - * This only supports read. - * - * Generated from protobuf enum SECONDARY = 2; - */ - const SECONDARY = 2; - - private static $valueToName = [ - self::CLUSTER_TYPE_UNSPECIFIED => 'CLUSTER_TYPE_UNSPECIFIED', - self::PRIMARY => 'PRIMARY', - self::SECONDARY => 'SECONDARY', - ]; - - 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(ClusterType::class, \Google\Cloud\AlloyDb\V1beta\Cluster_ClusterType::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php deleted file mode 100644 index 00049b553979..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/NetworkConfig.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.alloydb.v1beta.Cluster.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $network = ''; - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allocated_ip_range = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * @type string $allocated_ip_range - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Required. The resource link for the VPC network in which cluster - * resources are created and from which they are accessible via Private IP. - * The network must belong to the same project as the cluster. It is - * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is - * required to create a cluster. - * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAllocatedIpRange() - { - return $this->allocated_ip_range; - } - - /** - * Optional. Name of the allocated IP range for the private IP AlloyDB - * cluster, for example: "google-managed-services-default". If set, the - * instance IPs for this cluster will be created in the allocated range. The - * range name must comply with RFC 1035. Specifically, the name must be 1-63 - * characters long and match the regular expression - * [a-z]([-a-z0-9]*[a-z0-9])?. - * Field name is intended to be consistent with CloudSQL. - * - * Generated from protobuf field string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAllocatedIpRange($var) - { - GPBUtil::checkString($var, True); - $this->allocated_ip_range = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NetworkConfig::class, \Google\Cloud\AlloyDb\V1beta\Cluster_NetworkConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php deleted file mode 100644 index 5e654105841f..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/PrimaryConfig.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - */ -class PrimaryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $secondary_cluster_names; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_cluster_names - * Output only. Names of the clusters that are replicating from this - * cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecondaryClusterNames() - { - return $this->secondary_cluster_names; - } - - /** - * Output only. Names of the clusters that are replicating from this - * cluster. - * - * Generated from protobuf field repeated string secondary_cluster_names = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecondaryClusterNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->secondary_cluster_names = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PrimaryConfig::class, \Google\Cloud\AlloyDb\V1beta\Cluster_PrimaryConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php deleted file mode 100644 index ad40743a50b5..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/SecondaryConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - */ -class SecondaryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - */ - protected $primary_cluster_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $primary_cluster_name - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - * @return string - */ - public function getPrimaryClusterName() - { - return $this->primary_cluster_name; - } - - /** - * The name of the primary cluster name with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string primary_cluster_name = 1; - * @param string $var - * @return $this - */ - public function setPrimaryClusterName($var) - { - GPBUtil::checkString($var, True); - $this->primary_cluster_name = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SecondaryConfig::class, \Google\Cloud\AlloyDb\V1beta\Cluster_SecondaryConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php deleted file mode 100644 index a5594b7961b4..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Cluster/State.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.alloydb.v1beta.Cluster.State - */ -class State -{ - /** - * The state of the cluster is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The cluster is active and running. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The cluster is stopped. All instances in the cluster are stopped. - * Customers can start a stopped cluster at any point and all their - * instances will come back to life with same names and IP resources. In - * this state, customer pays for storage. - * Associated backups could also be present in a stopped cluster. - * - * Generated from protobuf enum STOPPED = 2; - */ - const STOPPED = 2; - /** - * The cluster is empty and has no associated resources. - * All instances, associated storage and backups have been deleted. - * - * Generated from protobuf enum EMPTY = 3; - */ - const PBEMPTY = 3; - /** - * The cluster is being created. - * - * Generated from protobuf enum CREATING = 4; - */ - const CREATING = 4; - /** - * The cluster is being deleted. - * - * Generated from protobuf enum DELETING = 5; - */ - const DELETING = 5; - /** - * The creation of the cluster failed. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * The cluster is bootstrapping with data from some other source. - * Direct mutations to the cluster (e.g. adding read pool) are not allowed. - * - * Generated from protobuf enum BOOTSTRAPPING = 7; - */ - const BOOTSTRAPPING = 7; - /** - * The cluster is under maintenance. AlloyDB regularly performs maintenance - * and upgrades on customer clusters. Updates on the cluster are - * not allowed while the cluster is in this state. - * - * Generated from protobuf enum MAINTENANCE = 8; - */ - const MAINTENANCE = 8; - /** - * The cluster is being promoted. - * - * Generated from protobuf enum PROMOTING = 9; - */ - const PROMOTING = 9; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::STOPPED => 'STOPPED', - self::PBEMPTY => 'EMPTY', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::BOOTSTRAPPING => 'BOOTSTRAPPING', - self::MAINTENANCE => 'MAINTENANCE', - self::PROMOTING => 'PROMOTING', - ]; - - 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)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\AlloyDb\V1beta\Cluster_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php deleted file mode 100644 index 350d113876a5..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ClusterView.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.alloydb.v1beta.ClusterView - */ -class ClusterView -{ - /** - * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - * - * Generated from protobuf enum CLUSTER_VIEW_UNSPECIFIED = 0; - */ - const CLUSTER_VIEW_UNSPECIFIED = 0; - /** - * BASIC server responses include all the relevant cluster details, excluding - * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific - * fields. The default value. - * - * Generated from protobuf enum CLUSTER_VIEW_BASIC = 1; - */ - const CLUSTER_VIEW_BASIC = 1; - /** - * CONTINUOUS_BACKUP response returns all the fields from BASIC plus - * the earliest restorable time if continuous backups are enabled. - * May increase latency. - * - * Generated from protobuf enum CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; - */ - const CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; - - private static $valueToName = [ - self::CLUSTER_VIEW_UNSPECIFIED => 'CLUSTER_VIEW_UNSPECIFIED', - self::CLUSTER_VIEW_BASIC => 'CLUSTER_VIEW_BASIC', - self::CLUSTER_VIEW_CONTINUOUS_BACKUP => 'CLUSTER_VIEW_CONTINUOUS_BACKUP', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php deleted file mode 100644 index 4e10d548d22d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ConnectionInfo.php +++ /dev/null @@ -1,195 +0,0 @@ -google.cloud.alloydb.v1beta.ConnectionInfo - */ -class ConnectionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $ip_address = ''; - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated - */ - private $pem_certificate_chain; - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $instance_uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * @type string $ip_address - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * @type string $instance_uid - * Output only. The unique ID of the Instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the ConnectionInfo singleton resource, e.g.: - * projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * Output only. The private network IP address for the Instance. This is the - * default IP for the instance and is always created (even if enable_public_ip - * is set). This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getPemCertificateChain() - { - @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); - return $this->pem_certificate_chain; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setPemCertificateChain($var) - { - @trigger_error('pem_certificate_chain is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->pem_certificate_chain = $arr; - - return $this; - } - - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getInstanceUid() - { - return $this->instance_uid; - } - - /** - * Output only. The unique ID of the Instance. - * - * Generated from protobuf field string instance_uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setInstanceUid($var) - { - GPBUtil::checkString($var, True); - $this->instance_uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php deleted file mode 100644 index 4d2878a30c7e..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupConfig.php +++ /dev/null @@ -1,176 +0,0 @@ -google.cloud.alloydb.v1beta.ContinuousBackupConfig - */ -class ContinuousBackupConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - */ - protected $enabled = null; - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - */ - protected $recovery_window_days = 0; - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; - */ - protected $encryption_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enabled - * Whether ContinuousBackup is enabled. - * @type int $recovery_window_days - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * @type \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $encryption_config - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - * @return bool - */ - public function getEnabled() - { - return isset($this->enabled) ? $this->enabled : false; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Whether ContinuousBackup is enabled. - * - * Generated from protobuf field optional bool enabled = 1; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - * @return int - */ - public function getRecoveryWindowDays() - { - return $this->recovery_window_days; - } - - /** - * The number of days that are eligible to restore from using PITR. To support - * the entire recovery window, backups and logs are retained for one day more - * than the recovery window. If not set, defaults to 14 days. - * - * Generated from protobuf field int32 recovery_window_days = 4; - * @param int $var - * @return $this - */ - public function setRecoveryWindowDays($var) - { - GPBUtil::checkInt32($var); - $this->recovery_window_days = $var; - - return $this; - } - - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; - * @return \Google\Cloud\AlloyDb\V1beta\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * The encryption config can be specified to encrypt the - * backups with a customer-managed encryption key (CMEK). When this field is - * not specified, the backup will then use default encryption scheme to - * protect the user data. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionConfig encryption_config = 3; - * @param \Google\Cloud\AlloyDb\V1beta\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php deleted file mode 100644 index e83c1b3905b6..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupInfo.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.alloydb.v1beta.ContinuousBackupInfo - */ -class ContinuousBackupInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_info = null; - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $enabled_time = null; - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $schedule; - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $earliest_restorable_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $encryption_info - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * @type \Google\Protobuf\Timestamp $enabled_time - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * @type array|\Google\Protobuf\Internal\RepeatedField $schedule - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * @type \Google\Protobuf\Timestamp $earliest_restorable_time - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\EncryptionInfo|null - */ - public function getEncryptionInfo() - { - return $this->encryption_info; - } - - public function hasEncryptionInfo() - { - return isset($this->encryption_info); - } - - public function clearEncryptionInfo() - { - unset($this->encryption_info); - } - - /** - * Output only. The encryption information for the WALs and backups required - * for ContinuousBackup. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\EncryptionInfo $var - * @return $this - */ - public function setEncryptionInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo::class); - $this->encryption_info = $var; - - return $this; - } - - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEnabledTime() - { - return $this->enabled_time; - } - - public function hasEnabledTime() - { - return isset($this->enabled_time); - } - - public function clearEnabledTime() - { - unset($this->enabled_time); - } - - /** - * Output only. When ContinuousBackup was most recently enabled. Set to null - * if ContinuousBackup is not enabled. - * - * Generated from protobuf field .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEnabledTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->enabled_time = $var; - - return $this; - } - - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSchedule() - { - return $this->schedule; - } - - /** - * Output only. Days of the week on which a continuous backup is taken. Output - * only field. Ignored if passed into the request. - * - * Generated from protobuf field repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSchedule($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); - $this->schedule = $arr; - - return $this; - } - - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEarliestRestorableTime() - { - return $this->earliest_restorable_time; - } - - public function hasEarliestRestorableTime() - { - return isset($this->earliest_restorable_time); - } - - public function clearEarliestRestorableTime() - { - unset($this->earliest_restorable_time); - } - - /** - * Output only. The earliest restorable time that can be restored to. Output - * only field. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEarliestRestorableTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->earliest_restorable_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php deleted file mode 100644 index 66bc25214a76..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ContinuousBackupSource.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.alloydb.v1beta.ContinuousBackupSource - */ -class ContinuousBackupSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = ''; - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $point_in_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cluster - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * @type \Google\Protobuf\Timestamp $point_in_time - * Required. The point in time to restore to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCluster() - { - return $this->cluster; - } - - /** - * Required. The source cluster from which to restore. This cluster must have - * continuous backup enabled for this operation to succeed. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkString($var, True); - $this->cluster = $var; - - return $this; - } - - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPointInTime() - { - return $this->point_in_time; - } - - public function hasPointInTime() - { - return isset($this->point_in_time); - } - - public function clearPointInTime() - { - unset($this->point_in_time); - } - - /** - * Required. The point in time to restore to. - * - * Generated from protobuf field .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPointInTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->point_in_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php deleted file mode 100644 index b105775eac50..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateBackupRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -google.cloud.alloydb.v1beta.CreateBackupRequest - */ -class CreateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Value for parent. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup = 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Value for parent. - * @type string $backup_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1beta\Backup $backup - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Value for parent. - * - * 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. Value for parent. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBackupId() - { - return $this->backup_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBackupId($var) - { - GPBUtil::checkString($var, True); - $this->backup_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Backup::class); - $this->backup = $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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php deleted file mode 100644 index 0c9e36e9c90b..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateClusterRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.alloydb.v1beta.CreateClusterRequest - */ -class CreateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * 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 location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); - $this->cluster = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php deleted file mode 100644 index b330b8e68a2a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.alloydb.v1beta.CreateInstanceRequest - */ -class CreateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @type string $instance_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1beta\Instance $instance - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance::class); - $this->instance = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php deleted file mode 100644 index 26e9b5390090..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateInstanceRequests.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1beta.CreateInstanceRequests - */ -class CreateInstanceRequests extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $create_instance_requests; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1beta\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $create_instance_requests - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCreateInstanceRequests() - { - return $this->create_instance_requests; - } - - /** - * Required. Primary and read replica instances to be created. This list - * should not be empty. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.CreateInstanceRequest create_instance_requests = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\AlloyDb\V1beta\CreateInstanceRequest>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCreateInstanceRequests($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\CreateInstanceRequest::class); - $this->create_instance_requests = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php deleted file mode 100644 index 29febd8ae980..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryClusterRequest.php +++ /dev/null @@ -1,263 +0,0 @@ -google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - */ -class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object (the secondary cluster). - * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster - * Required. Configuration of the requesting object (the secondary cluster). - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * 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 location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * - * 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. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object (the secondary cluster). - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. Configuration of the requesting object (the secondary cluster). - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); - $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php deleted file mode 100644 index 47c2979f0739..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateSecondaryInstanceRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - */ -class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @type string $instance_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1beta\Instance $instance - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance::class); - $this->instance = $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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php deleted file mode 100644 index 1d2e3e5e8b4d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/CreateUserRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -google.cloud.alloydb.v1beta.CreateUserRequest - */ -class CreateUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Value for parent. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user = 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Value for parent. - * @type string $user_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1beta\User $user - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Value for parent. - * - * 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. Value for parent. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUserId() - { - return $this->user_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUserId($var) - { - GPBUtil::checkString($var, True); - $this->user_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\User|null - */ - public function getUser() - { - return $this->user; - } - - public function hasUser() - { - return isset($this->user); - } - - public function clearUser() - { - unset($this->user); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\User $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\User::class); - $this->user = $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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php deleted file mode 100644 index a564379cd37c..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DatabaseVersion.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.alloydb.v1beta.DatabaseVersion - */ -class DatabaseVersion -{ - /** - * This is an unknown database version. - * - * Generated from protobuf enum DATABASE_VERSION_UNSPECIFIED = 0; - */ - const DATABASE_VERSION_UNSPECIFIED = 0; - /** - * DEPRECATED - The database version is Postgres 13. - * - * Generated from protobuf enum POSTGRES_13 = 1 [deprecated = true]; - */ - const POSTGRES_13 = 1; - /** - * The database version is Postgres 14. - * - * Generated from protobuf enum POSTGRES_14 = 2; - */ - const POSTGRES_14 = 2; - /** - * The database version is Postgres 15. - * - * Generated from protobuf enum POSTGRES_15 = 3; - */ - const POSTGRES_15 = 3; - - private static $valueToName = [ - self::DATABASE_VERSION_UNSPECIFIED => 'DATABASE_VERSION_UNSPECIFIED', - self::POSTGRES_13 => 'POSTGRES_13', - self::POSTGRES_14 => 'POSTGRES_14', - self::POSTGRES_15 => 'POSTGRES_15', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php deleted file mode 100644 index 27d8cc420c20..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteBackupRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.alloydb.v1beta.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * - * 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type string $etag - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * - * 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. For the required format, see the comment on - * the Backup.name field. - * - * 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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php deleted file mode 100644 index d580897f1f88..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteClusterRequest.php +++ /dev/null @@ -1,259 +0,0 @@ -google.cloud.alloydb.v1beta.DeleteClusterRequest - */ -class DeleteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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 = ''; - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $force = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @type bool $force - * Optional. Whether to cascade delete child instances for given cluster. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * Optional. Whether to cascade delete child instances for given cluster. - * - * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php deleted file mode 100644 index 1666a6ec9898..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteInstanceRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.alloydb.v1beta.DeleteInstanceRequest - */ -class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type string $etag - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php deleted file mode 100644 index ad9652e2b333..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/DeleteUserRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.alloydb.v1beta.DeleteUserRequest - */ -class DeleteUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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 = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php deleted file mode 100644 index 889b996900d2..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionConfig.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1beta.EncryptionConfig - */ -class EncryptionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - */ - protected $kms_key_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key_name - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The fully-qualified resource name of the KMS key. - * Each Cloud KMS key is regionalized and has the following format: - * projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - * - * Generated from protobuf field string kms_key_name = 1; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php deleted file mode 100644 index ae4a15a5fea2..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1beta.EncryptionInfo - */ -class EncryptionInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $encryption_type = 0; - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $kms_key_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $encryption_type - * Output only. Type of encryption. - * @type array|\Google\Protobuf\Internal\RepeatedField $kms_key_versions - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getEncryptionType() - { - return $this->encryption_type; - } - - /** - * Output only. Type of encryption. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setEncryptionType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo\Type::class); - $this->encryption_type = $var; - - return $this; - } - - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKmsKeyVersions() - { - return $this->kms_key_versions; - } - - /** - * Output only. Cloud KMS key versions that are being used to protect the - * database or the backup. - * - * Generated from protobuf field repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKmsKeyVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->kms_key_versions = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php deleted file mode 100644 index 8f3c5ae0ae5d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/EncryptionInfo/Type.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.alloydb.v1beta.EncryptionInfo.Type - */ -class Type -{ - /** - * Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * The data is encrypted at rest with a key that is fully managed by Google. - * No key version will be populated. This is the default state. - * - * Generated from protobuf enum GOOGLE_DEFAULT_ENCRYPTION = 1; - */ - const GOOGLE_DEFAULT_ENCRYPTION = 1; - /** - * The data is encrypted at rest with a key that is managed by the customer. - * KMS key versions will be populated. - * - * Generated from protobuf enum CUSTOMER_MANAGED_ENCRYPTION = 2; - */ - const CUSTOMER_MANAGED_ENCRYPTION = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::GOOGLE_DEFAULT_ENCRYPTION => 'GOOGLE_DEFAULT_ENCRYPTION', - self::CUSTOMER_MANAGED_ENCRYPTION => 'CUSTOMER_MANAGED_ENCRYPTION', - ]; - - 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(Type::class, \Google\Cloud\AlloyDb\V1beta\EncryptionInfo_Type::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php deleted file mode 100644 index 4e86f1d59317..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/FailoverInstanceRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.alloydb.v1beta.FailoverInstanceRequest - */ -class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php deleted file mode 100644 index 44bfd85932e7..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateRequest.php +++ /dev/null @@ -1,321 +0,0 @@ -google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - */ -class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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 = ''; - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * - * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $pem_csr = ''; - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $cert_duration = null; - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $public_key = ''; - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $use_metadata_exchange = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @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). - * @type string $pem_csr - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * @type \Google\Protobuf\Duration $cert_duration - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * @type string $public_key - * Optional. The public key from the client. - * @type bool $use_metadata_exchange - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * 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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * - * 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. 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; - } - - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * - * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return string - * @deprecated - */ - public function getPemCsr() - { - @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); - return $this->pem_csr; - } - - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * - * Generated from protobuf field string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - * @deprecated - */ - public function setPemCsr($var) - { - @trigger_error('pem_csr is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->pem_csr = $var; - - return $this; - } - - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getCertDuration() - { - return $this->cert_duration; - } - - public function hasCertDuration() - { - return isset($this->cert_duration); - } - - public function clearCertDuration() - { - unset($this->cert_duration); - } - - /** - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * - * Generated from protobuf field .google.protobuf.Duration cert_duration = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setCertDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->cert_duration = $var; - - return $this; - } - - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPublicKey() - { - return $this->public_key; - } - - /** - * Optional. The public key from the client. - * - * Generated from protobuf field string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPublicKey($var) - { - GPBUtil::checkString($var, True); - $this->public_key = $var; - - return $this; - } - - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getUseMetadataExchange() - { - return $this->use_metadata_exchange; - } - - /** - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * - * Generated from protobuf field bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setUseMetadataExchange($var) - { - GPBUtil::checkBool($var); - $this->use_metadata_exchange = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php deleted file mode 100644 index d5063bdd9df9..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GenerateClientCertificateResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - */ -class GenerateClientCertificateResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The pem-encoded, signed X.509 certificate. - * - * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $pem_certificate = ''; - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $pem_certificate_chain; - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ca_cert = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $pem_certificate - * Output only. The pem-encoded, signed X.509 certificate. - * @type array|\Google\Protobuf\Internal\RepeatedField $pem_certificate_chain - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * @type string $ca_cert - * Optional. The pem-encoded cluster ca X.509 certificate. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The pem-encoded, signed X.509 certificate. - * - * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPemCertificate() - { - return $this->pem_certificate; - } - - /** - * Output only. The pem-encoded, signed X.509 certificate. - * - * Generated from protobuf field string pem_certificate = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPemCertificate($var) - { - GPBUtil::checkString($var, True); - $this->pem_certificate = $var; - - return $this; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPemCertificateChain() - { - return $this->pem_certificate_chain; - } - - /** - * Output only. The pem-encoded chain that may be used to verify the X.509 - * certificate. Expected to be in issuer-to-root order according to RFC 5246. - * - * Generated from protobuf field repeated string pem_certificate_chain = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPemCertificateChain($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->pem_certificate_chain = $arr; - - return $this; - } - - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCaCert() - { - return $this->ca_cert; - } - - /** - * Optional. The pem-encoded cluster ca X.509 certificate. - * - * Generated from protobuf field string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCaCert($var) - { - GPBUtil::checkString($var, True); - $this->ca_cert = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php deleted file mode 100644 index a5863ee3745a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetBackupRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.alloydb.v1beta.GetBackupRequest - */ -class GetBackupRequest 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 = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the resource - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::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; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php deleted file mode 100644 index 059f44808fb1..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetClusterRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.alloydb.v1beta.GetClusterRequest - */ -class GetClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @type int $view - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\ClusterView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php deleted file mode 100644 index 321d3f02e8e4..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetConnectionInfoRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.cloud.alloydb.v1beta.GetConnectionInfoRequest - */ -class GetConnectionInfoRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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 = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * 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 name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - * 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. 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php deleted file mode 100644 index a257b0e4165e..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetInstanceRequest.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1beta.GetInstanceRequest - */ -class GetInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.InstanceView view = 2; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @type int $view - * The view of the instance to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.InstanceView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The view of the instance to return. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.InstanceView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\InstanceView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php deleted file mode 100644 index 8c12f9de8093..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/GetUserRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.alloydb.v1beta.GetUserRequest - */ -class GetUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the User.name field. - * - * 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php deleted file mode 100644 index 2dec96d9b87d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.alloydb.v1beta.InjectFaultRequest - */ -class InjectFaultRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $fault_type = 0; - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $fault_type - * Required. The type of fault to be injected in an instance. - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getFaultType() - { - return $this->fault_type; - } - - /** - * Required. The type of fault to be injected in an instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setFaultType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\InjectFaultRequest\FaultType::class); - $this->fault_type = $var; - - return $this; - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * Generated from protobuf field string name = 2 [(.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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php deleted file mode 100644 index 1fcf2b72d0cd..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InjectFaultRequest/FaultType.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType - */ -class FaultType -{ - /** - * The fault type is unknown. - * - * Generated from protobuf enum FAULT_TYPE_UNSPECIFIED = 0; - */ - const FAULT_TYPE_UNSPECIFIED = 0; - /** - * Stop the VM - * - * Generated from protobuf enum STOP_VM = 1; - */ - const STOP_VM = 1; - - private static $valueToName = [ - self::FAULT_TYPE_UNSPECIFIED => 'FAULT_TYPE_UNSPECIFIED', - self::STOP_VM => 'STOP_VM', - ]; - - 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(FaultType::class, \Google\Cloud\AlloyDb\V1beta\InjectFaultRequest_FaultType::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php deleted file mode 100644 index 3446690251e6..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance.php +++ /dev/null @@ -1,1078 +0,0 @@ -google.cloud.alloydb.v1beta.Instance - */ -class Instance extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - */ - private $labels; - /** - * Output only. The current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance_type = 0; - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; - */ - protected $machine_config = null; - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; - */ - protected $availability_type = 0; - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - */ - protected $gce_zone = ''; - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - */ - private $database_flags; - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $writable_node = null; - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $nodes; - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - */ - protected $query_insights_config = null; - /** - * Read pool specific config. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; - */ - protected $read_pool_config = null; - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $ip_address = ''; - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reconciling = false; - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - */ - protected $etag = ''; - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - */ - private $annotations; - /** - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; - */ - protected $update_policy = null; - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $client_connection_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * @type string $display_name - * User-settable and human-readable display name for the Instance. - * @type string $uid - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Create time stamp - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time stamp - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Delete time stamp - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels as key value pairs - * @type int $state - * Output only. The current serving state of the instance. - * @type int $instance_type - * Required. The type of the instance. Specified at creation time. - * @type \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig $machine_config - * Configurations for the machines that host the underlying - * database engine. - * @type int $availability_type - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * @type string $gce_zone - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * @type array|\Google\Protobuf\Internal\MapField $database_flags - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * @type \Google\Cloud\AlloyDb\V1beta\Instance\Node $writable_node - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * @type array<\Google\Cloud\AlloyDb\V1beta\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $nodes - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * @type \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig $query_insights_config - * Configuration for query insights. - * @type \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig $read_pool_config - * Read pool specific config. - * @type string $ip_address - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * @type bool $reconciling - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * @type string $etag - * For Resource freshness validation (https://google.aip.dev/154) - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * @type \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy $update_policy - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * @type \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig $client_connection_config - * Optional. Client connection specific configurations - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the instance resource with the format: - * * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} - * where the cluster and instance ID segments should satisfy the regex - * expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - * lowercase letters, numbers, and dashes, starting with a letter, and ending - * with a letter or number. For more details see https://google.aip.dev/122. - * The prefix of the instance resource name is the name of the parent - * resource: - * * projects/{project}/locations/{region}/clusters/{cluster_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-settable and human-readable display name for the Instance. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UID of the resource. The UID is assigned - * when the resource is created, and it is retained until it is deleted. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Create time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Update time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Delete time stamp - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels as key value pairs - * - * Generated from protobuf field map labels = 7; - * @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 current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current serving state of the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\State::class); - $this->state = $var; - - return $this; - } - - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getInstanceType() - { - return $this->instance_type; - } - - /** - * Required. The type of the instance. Specified at creation time. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.InstanceType instance_type = 9 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setInstanceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\InstanceType::class); - $this->instance_type = $var; - - return $this; - } - - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; - * @return \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig|null - */ - public function getMachineConfig() - { - return $this->machine_config; - } - - public function hasMachineConfig() - { - return isset($this->machine_config); - } - - public function clearMachineConfig() - { - unset($this->machine_config); - } - - /** - * Configurations for the machines that host the underlying - * database engine. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.MachineConfig machine_config = 10; - * @param \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig $var - * @return $this - */ - public function setMachineConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig::class); - $this->machine_config = $var; - - return $this; - } - - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; - * @return int - */ - public function getAvailabilityType() - { - return $this->availability_type; - } - - /** - * Availability type of an Instance. - * If empty, defaults to REGIONAL for primary instances. - * For read pools, availability_type is always UNSPECIFIED. Instances in the - * read pools are evenly distributed across available zones within the region - * (i.e. read pools with more than one node will have a node in at - * least two zones). - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; - * @param int $var - * @return $this - */ - public function setAvailabilityType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\AvailabilityType::class); - $this->availability_type = $var; - - return $this; - } - - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - * @return string - */ - public function getGceZone() - { - return $this->gce_zone; - } - - /** - * The Compute Engine zone that the instance should serve from, per - * https://cloud.google.com/compute/docs/regions-zones - * This can ONLY be specified for ZONAL instances. - * If present for a REGIONAL instance, an error will be thrown. - * If this is absent for a ZONAL instance, instance is created in a random - * zone with available capacity. - * - * Generated from protobuf field string gce_zone = 12; - * @param string $var - * @return $this - */ - public function setGceZone($var) - { - GPBUtil::checkString($var, True); - $this->gce_zone = $var; - - return $this; - } - - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDatabaseFlags() - { - return $this->database_flags; - } - - /** - * Database flags. Set at instance level. - * * They are copied from primary instance on read instance creation. - * * Read instances can set new or override existing flags that are relevant - * for reads, e.g. for enabling columnar cache on a read instance. Flags - * set on read instance may or may not be present on primary. - * This is a list of "key": "value" pairs. - * "key": The name of the flag. These flags are passed at instance setup time, - * so include both server options and system variables for Postgres. Flags are - * specified with underscores, not hyphens. - * "value": The value of the flag. Booleans are set to **on** for true - * and **off** for false. This field must be omitted if the flag - * doesn't take a value. - * - * Generated from protobuf field map database_flags = 13; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDatabaseFlags($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->database_flags = $arr; - - return $this; - } - - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\Instance\Node|null - */ - public function getWritableNode() - { - return $this->writable_node; - } - - public function hasWritableNode() - { - return isset($this->writable_node); - } - - public function clearWritableNode() - { - unset($this->writable_node); - } - - /** - * Output only. This is set for the read-write VM of the PRIMARY instance - * only. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.Node writable_node = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\Instance\Node $var - * @return $this - */ - public function setWritableNode($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\Node::class); - $this->writable_node = $var; - - return $this; - } - - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNodes() - { - return $this->nodes; - } - - /** - * Output only. List of available read-only VMs in this instance, including - * the standby for a PRIMARY instance. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance.Node nodes = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\AlloyDb\V1beta\Instance\Node>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Instance\Node::class); - $this->nodes = $arr; - - return $this; - } - - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - * @return \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig|null - */ - public function getQueryInsightsConfig() - { - return $this->query_insights_config; - } - - public function hasQueryInsightsConfig() - { - return isset($this->query_insights_config); - } - - public function clearQueryInsightsConfig() - { - unset($this->query_insights_config); - } - - /** - * Configuration for query insights. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig query_insights_config = 21; - * @param \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig $var - * @return $this - */ - public function setQueryInsightsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig::class); - $this->query_insights_config = $var; - - return $this; - } - - /** - * Read pool specific config. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; - * @return \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig|null - */ - public function getReadPoolConfig() - { - return $this->read_pool_config; - } - - public function hasReadPoolConfig() - { - return isset($this->read_pool_config); - } - - public function clearReadPoolConfig() - { - unset($this->read_pool_config); - } - - /** - * Read pool specific config. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ReadPoolConfig read_pool_config = 14; - * @param \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig $var - * @return $this - */ - public function setReadPoolConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig::class); - $this->read_pool_config = $var; - - return $this; - } - - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * Output only. The IP address for the Instance. - * This is the connection endpoint for an end-user application. - * - * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReconciling() - { - return $this->reconciling; - } - - /** - * Output only. Reconciling (https://google.aip.dev/128#reconciliation). - * Set to true if the current state of Instance does not match the user's - * intended state, and the service is actively updating the resource to - * reconcile them. This can happen due to user-triggered updates or - * system actions like failover or maintenance. - * - * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReconciling($var) - { - GPBUtil::checkBool($var); - $this->reconciling = $var; - - return $this; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * For Resource freshness validation (https://google.aip.dev/154) - * - * Generated from protobuf field string etag = 17; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Annotations to allow client tools to store small amount of arbitrary data. - * This is distinct from labels. - * https://google.aip.dev/128 - * - * Generated from protobuf field map annotations = 18; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; - * @return \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy|null - */ - public function getUpdatePolicy() - { - return $this->update_policy; - } - - public function hasUpdatePolicy() - { - return isset($this->update_policy); - } - - public function clearUpdatePolicy() - { - unset($this->update_policy); - } - - /** - * Update policy that will be applied during instance update. - * This field is not persisted when you update the instance. - * To use a non-default update policy, you must - * specify explicitly specify the value in each update request. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; - * @param \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy $var - * @return $this - */ - public function setUpdatePolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy::class); - $this->update_policy = $var; - - return $this; - } - - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig|null - */ - public function getClientConnectionConfig() - { - return $this->client_connection_config; - } - - public function hasClientConnectionConfig() - { - return isset($this->client_connection_config); - } - - public function clearClientConnectionConfig() - { - unset($this->client_connection_config); - } - - /** - * Optional. Client connection specific configurations - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig $var - * @return $this - */ - public function setClientConnectionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig::class); - $this->client_connection_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php deleted file mode 100644 index 55bf4ab06611..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/AvailabilityType.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.AvailabilityType - */ -class AvailabilityType -{ - /** - * This is an unknown Availability type. - * - * Generated from protobuf enum AVAILABILITY_TYPE_UNSPECIFIED = 0; - */ - const AVAILABILITY_TYPE_UNSPECIFIED = 0; - /** - * Zonal available instance. - * - * Generated from protobuf enum ZONAL = 1; - */ - const ZONAL = 1; - /** - * Regional (or Highly) available instance. - * - * Generated from protobuf enum REGIONAL = 2; - */ - const REGIONAL = 2; - - private static $valueToName = [ - self::AVAILABILITY_TYPE_UNSPECIFIED => 'AVAILABILITY_TYPE_UNSPECIFIED', - self::ZONAL => 'ZONAL', - self::REGIONAL => 'REGIONAL', - ]; - - 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(AvailabilityType::class, \Google\Cloud\AlloyDb\V1beta\Instance_AvailabilityType::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php deleted file mode 100644 index 9bdea08746a5..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ClientConnectionConfig.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - */ -class ClientConnectionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $require_connectors = false; - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ssl_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $require_connectors - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * @type \Google\Cloud\AlloyDb\V1beta\SslConfig $ssl_config - * Optional. SSL config option for this instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getRequireConnectors() - { - return $this->require_connectors; - } - - /** - * Optional. Configuration to enforce connectors only (ex: AuthProxy) - * connections to the database. - * - * Generated from protobuf field bool require_connectors = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setRequireConnectors($var) - { - GPBUtil::checkBool($var); - $this->require_connectors = $var; - - return $this; - } - - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\AlloyDb\V1beta\SslConfig|null - */ - public function getSslConfig() - { - return $this->ssl_config; - } - - public function hasSslConfig() - { - return isset($this->ssl_config); - } - - public function clearSslConfig() - { - unset($this->ssl_config); - } - - /** - * Optional. SSL config option for this instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\AlloyDb\V1beta\SslConfig $var - * @return $this - */ - public function setSslConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SslConfig::class); - $this->ssl_config = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ClientConnectionConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_ClientConnectionConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php deleted file mode 100644 index 2c89a5a8f11d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/InstanceType.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.InstanceType - */ -class InstanceType -{ - /** - * The type of the instance is unknown. - * - * Generated from protobuf enum INSTANCE_TYPE_UNSPECIFIED = 0; - */ - const INSTANCE_TYPE_UNSPECIFIED = 0; - /** - * PRIMARY instances support read and write operations. - * - * Generated from protobuf enum PRIMARY = 1; - */ - const PRIMARY = 1; - /** - * READ POOL instances support read operations only. Each read pool instance - * consists of one or more homogeneous nodes. - * * Read pool of size 1 can only have zonal availability. - * * Read pools with node count of 2 or more can have regional - * availability (nodes are present in 2 or more zones in a region). - * - * Generated from protobuf enum READ_POOL = 2; - */ - const READ_POOL = 2; - /** - * SECONDARY instances support read operations only. SECONDARY instance - * is a cross-region read replica - * - * Generated from protobuf enum SECONDARY = 3; - */ - const SECONDARY = 3; - - private static $valueToName = [ - self::INSTANCE_TYPE_UNSPECIFIED => 'INSTANCE_TYPE_UNSPECIFIED', - self::PRIMARY => 'PRIMARY', - self::READ_POOL => 'READ_POOL', - self::SECONDARY => 'SECONDARY', - ]; - - 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\AlloyDb\V1beta\Instance_InstanceType::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php deleted file mode 100644 index 15d3ebd714c2..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/MachineConfig.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.MachineConfig - */ -class MachineConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - */ - protected $cpu_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $cpu_count - * The number of CPU's in the VM instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - * @return int - */ - public function getCpuCount() - { - return $this->cpu_count; - } - - /** - * The number of CPU's in the VM instance. - * - * Generated from protobuf field int32 cpu_count = 1; - * @param int $var - * @return $this - */ - public function setCpuCount($var) - { - GPBUtil::checkInt32($var); - $this->cpu_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MachineConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_MachineConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php deleted file mode 100644 index 65edd54cb74b..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/Node.php +++ /dev/null @@ -1,186 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.Node - */ -class Node extends \Google\Protobuf\Internal\Message -{ - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - */ - protected $zone_id = ''; - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - */ - protected $id = ''; - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - */ - protected $ip = ''; - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - */ - protected $state = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $zone_id - * The Compute Engine zone of the VM e.g. "us-central1-b". - * @type string $id - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * @type string $ip - * The private IP address of the VM e.g. "10.57.0.34". - * @type string $state - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - * @return string - */ - public function getZoneId() - { - return $this->zone_id; - } - - /** - * The Compute Engine zone of the VM e.g. "us-central1-b". - * - * Generated from protobuf field string zone_id = 1; - * @param string $var - * @return $this - */ - public function setZoneId($var) - { - GPBUtil::checkString($var, True); - $this->zone_id = $var; - - return $this; - } - - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - * - * Generated from protobuf field string id = 2; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - * @return string - */ - public function getIp() - { - return $this->ip; - } - - /** - * The private IP address of the VM e.g. "10.57.0.34". - * - * Generated from protobuf field string ip = 3; - * @param string $var - * @return $this - */ - public function setIp($var) - { - GPBUtil::checkString($var, True); - $this->ip = $var; - - return $this; - } - - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Determined by state of the compute VM and postgres-service health. - * Compute VM state can have values listed in - * https://cloud.google.com/compute/docs/instances/instance-life-cycle and - * postgres-service health can have values: HEALTHY and UNHEALTHY. - * - * Generated from protobuf field string state = 4; - * @param string $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkString($var, True); - $this->state = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Node::class, \Google\Cloud\AlloyDb\V1beta\Instance_Node::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php deleted file mode 100644 index 08641330ed26..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/QueryInsightsInstanceConfig.php +++ /dev/null @@ -1,222 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - */ -class QueryInsightsInstanceConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - */ - protected $record_application_tags = null; - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - */ - protected $record_client_address = null; - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - */ - protected $query_string_length = 0; - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - */ - protected $query_plans_per_minute = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $record_application_tags - * Record application tags for an instance. - * This flag is turned "on" by default. - * @type bool $record_client_address - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * @type int $query_string_length - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * @type int $query_plans_per_minute - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - * @return bool - */ - public function getRecordApplicationTags() - { - return isset($this->record_application_tags) ? $this->record_application_tags : false; - } - - public function hasRecordApplicationTags() - { - return isset($this->record_application_tags); - } - - public function clearRecordApplicationTags() - { - unset($this->record_application_tags); - } - - /** - * Record application tags for an instance. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_application_tags = 2; - * @param bool $var - * @return $this - */ - public function setRecordApplicationTags($var) - { - GPBUtil::checkBool($var); - $this->record_application_tags = $var; - - return $this; - } - - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - * @return bool - */ - public function getRecordClientAddress() - { - return isset($this->record_client_address) ? $this->record_client_address : false; - } - - public function hasRecordClientAddress() - { - return isset($this->record_client_address); - } - - public function clearRecordClientAddress() - { - unset($this->record_client_address); - } - - /** - * Record client address for an instance. Client address is PII information. - * This flag is turned "on" by default. - * - * Generated from protobuf field optional bool record_client_address = 3; - * @param bool $var - * @return $this - */ - public function setRecordClientAddress($var) - { - GPBUtil::checkBool($var); - $this->record_client_address = $var; - - return $this; - } - - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - * @return int - */ - public function getQueryStringLength() - { - return $this->query_string_length; - } - - /** - * Query string length. The default value is 1024. - * Any integer between 256 and 4500 is considered valid. - * - * Generated from protobuf field uint32 query_string_length = 4; - * @param int $var - * @return $this - */ - public function setQueryStringLength($var) - { - GPBUtil::checkUint32($var); - $this->query_string_length = $var; - - return $this; - } - - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - * @return int - */ - public function getQueryPlansPerMinute() - { - return isset($this->query_plans_per_minute) ? $this->query_plans_per_minute : 0; - } - - public function hasQueryPlansPerMinute() - { - return isset($this->query_plans_per_minute); - } - - public function clearQueryPlansPerMinute() - { - unset($this->query_plans_per_minute); - } - - /** - * Number of query execution plans captured by Insights per minute - * for all queries combined. The default value is 5. - * Any integer between 0 and 20 is considered valid. - * - * Generated from protobuf field optional uint32 query_plans_per_minute = 5; - * @param int $var - * @return $this - */ - public function setQueryPlansPerMinute($var) - { - GPBUtil::checkUint32($var); - $this->query_plans_per_minute = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryInsightsInstanceConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_QueryInsightsInstanceConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php deleted file mode 100644 index 214e155a2d4c..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/ReadPoolConfig.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - */ -class ReadPoolConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - */ - protected $node_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $node_count - * Read capacity, i.e. number of nodes in a read pool instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - * @return int - */ - public function getNodeCount() - { - return $this->node_count; - } - - /** - * Read capacity, i.e. number of nodes in a read pool instance. - * - * Generated from protobuf field int32 node_count = 1; - * @param int $var - * @return $this - */ - public function setNodeCount($var) - { - GPBUtil::checkInt32($var); - $this->node_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReadPoolConfig::class, \Google\Cloud\AlloyDb\V1beta\Instance_ReadPoolConfig::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php deleted file mode 100644 index e3bc6a4b7e94..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/State.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.State - */ -class State -{ - /** - * The state of the instance is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The instance is active and running. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The instance is stopped. Instance name and IP resources are preserved. - * - * Generated from protobuf enum STOPPED = 2; - */ - const STOPPED = 2; - /** - * The instance is being created. - * - * Generated from protobuf enum CREATING = 3; - */ - const CREATING = 3; - /** - * The instance is being deleted. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The instance is down for maintenance. - * - * Generated from protobuf enum MAINTENANCE = 5; - */ - const MAINTENANCE = 5; - /** - * The creation of the instance failed or a fatal error occurred during - * an operation on the instance. - * Note: Instances in this state would tried to be auto-repaired. And - * Customers should be able to restart, update or delete these instances. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that - * index unused in case that state also needs to exposed via consumer apis - * in future. - * The instance has been configured to sync data from some other source. - * - * Generated from protobuf enum BOOTSTRAPPING = 8; - */ - const BOOTSTRAPPING = 8; - /** - * The instance is being promoted. - * - * Generated from protobuf enum PROMOTING = 9; - */ - const PROMOTING = 9; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::READY => 'READY', - self::STOPPED => 'STOPPED', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::MAINTENANCE => 'MAINTENANCE', - self::FAILED => 'FAILED', - self::BOOTSTRAPPING => 'BOOTSTRAPPING', - self::PROMOTING => 'PROMOTING', - ]; - - 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(State::class, \Google\Cloud\AlloyDb\V1beta\Instance_State::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php deleted file mode 100644 index d400f401c594..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.UpdatePolicy - */ -class UpdatePolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Mode for updating the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; - */ - protected $mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $mode - * Mode for updating the instance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Mode for updating the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Mode for updating the instance. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy\Mode::class); - $this->mode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UpdatePolicy::class, \Google\Cloud\AlloyDb\V1beta\Instance_UpdatePolicy::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php deleted file mode 100644 index 87165195dffe..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/Instance/UpdatePolicy/Mode.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode - */ -class Mode -{ - /** - * Mode is unknown. - * - * Generated from protobuf enum MODE_UNSPECIFIED = 0; - */ - const MODE_UNSPECIFIED = 0; - /** - * Least disruptive way to apply the update. - * - * Generated from protobuf enum DEFAULT = 1; - */ - const PBDEFAULT = 1; - /** - * Performs a forced update when applicable. This will be fast but may - * incur a downtime. - * - * Generated from protobuf enum FORCE_APPLY = 2; - */ - const FORCE_APPLY = 2; - - private static $valueToName = [ - self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', - self::PBDEFAULT => 'DEFAULT', - self::FORCE_APPLY => 'FORCE_APPLY', - ]; - - 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)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Mode::class, \Google\Cloud\AlloyDb\V1beta\Instance_UpdatePolicy_Mode::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php deleted file mode 100644 index 6cf60b54e17a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/InstanceView.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1beta.InstanceView - */ -class InstanceView -{ - /** - * INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - * - * Generated from protobuf enum INSTANCE_VIEW_UNSPECIFIED = 0; - */ - const INSTANCE_VIEW_UNSPECIFIED = 0; - /** - * BASIC server responses for a primary or read instance include all the - * relevant instance details, excluding the details of each node in the - * instance. The default value. - * - * Generated from protobuf enum INSTANCE_VIEW_BASIC = 1; - */ - const INSTANCE_VIEW_BASIC = 1; - /** - * FULL response is equivalent to BASIC for primary instance (for now). - * For read pool instance, this includes details of each node in the pool. - * - * Generated from protobuf enum INSTANCE_VIEW_FULL = 2; - */ - const INSTANCE_VIEW_FULL = 2; - - private static $valueToName = [ - self::INSTANCE_VIEW_UNSPECIFIED => 'INSTANCE_VIEW_UNSPECIFIED', - self::INSTANCE_VIEW_BASIC => 'INSTANCE_VIEW_BASIC', - self::INSTANCE_VIEW_FULL => 'INSTANCE_VIEW_FULL', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php deleted file mode 100644 index 97c8e67e0c9c..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.alloydb.v1beta.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value for ListBackupsRequest - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent value for ListBackupsRequest - * @type int $page_size - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. - * @type string $filter - * Filtering results - * @type string $order_by - * Hint for how to order the results - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value for ListBackupsRequest - * - * 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. Parent value for ListBackupsRequest - * - * 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; - } - - /** - * 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; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * 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; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filtering results - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Hint for how to order the results - * - * Generated from protobuf field string order_by = 5; - * @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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php deleted file mode 100644 index 38fecf7acff7..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListBackupsResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1beta.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Backup backups = 1; - */ - private $backups; - /** - * 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\AlloyDb\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * The list of Backup - * @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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * The list of Backup - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Backup backups = 1; - * @param array<\Google\Cloud\AlloyDb\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Backup::class); - $this->backups = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php deleted file mode 100644 index 79fe6741e205..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersRequest.php +++ /dev/null @@ -1,219 +0,0 @@ -google.cloud.alloydb.v1beta.ListClustersRequest - */ -class ListClustersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. Filtering results - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * @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 - * 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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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 name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * - * 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; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php deleted file mode 100644 index 90673b1a4358..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListClustersResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1beta.ListClustersResponse - */ -class ListClustersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; - */ - private $clusters; - /** - * 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\AlloyDb\V1beta\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters - * The list of Cluster - * @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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getClusters() - { - return $this->clusters; - } - - /** - * The list of Cluster - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Cluster clusters = 1; - * @param array<\Google\Cloud\AlloyDb\V1beta\Cluster>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setClusters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Cluster::class); - $this->clusters = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php deleted file mode 100644 index 61a7c9a1f142..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesRequest.php +++ /dev/null @@ -1,227 +0,0 @@ -google.cloud.alloydb.v1beta.ListInstancesRequest - */ -class ListInstancesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. Filtering results - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * @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 - * 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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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 name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * - * 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; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php deleted file mode 100644 index fb10a034d42f..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListInstancesResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1beta.ListInstancesResponse - */ -class ListInstancesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; - */ - private $instances; - /** - * 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\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $instances - * The list of Instance - * @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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * The list of Instance - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.Instance instances = 1; - * @param array<\Google\Cloud\AlloyDb\V1beta\Instance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Instance::class); - $this->instances = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php deleted file mode 100644 index 5f0dd98c3470..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - */ -class ListSupportedDatabaseFlagsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * 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; - */ - protected $page_size = 0; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * @type int $page_size - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * 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 name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * - * 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; - } - - /** - * 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; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * 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; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php deleted file mode 100644 index 519a0fed0ade..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListSupportedDatabaseFlagsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - */ -class ListSupportedDatabaseFlagsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; - */ - private $supported_database_flags; - /** - * A token identifying a page of results the server should return. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $supported_database_flags - * The list of SupportedDatabaseFlags. - * @type string $next_page_token - * A token identifying a page of results the server should return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedDatabaseFlags() - { - return $this->supported_database_flags; - } - - /** - * The list of SupportedDatabaseFlags. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.SupportedDatabaseFlag supported_database_flags = 1; - * @param array<\Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedDatabaseFlags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag::class); - $this->supported_database_flags = $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; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php deleted file mode 100644 index c0e4f33ec832..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.alloydb.v1beta.ListUsersRequest - */ -class ListUsersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent value for ListUsersRequest - * - * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent value for ListUsersRequest - * @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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent value for ListUsersRequest - * - * 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. Parent value for ListUsersRequest - * - * 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 string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering results - * - * Generated from protobuf field 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 string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Hint for how to order the results - * - * Generated from protobuf field 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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php deleted file mode 100644 index 931a533b9be6..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/ListUsersResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.alloydb.v1beta.ListUsersResponse - */ -class ListUsersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.User users = 1; - */ - private $users; - /** - * 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\AlloyDb\V1beta\User>|\Google\Protobuf\Internal\RepeatedField $users - * The list of User - * @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\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.User users = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUsers() - { - return $this->users; - } - - /** - * The list of User - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.User users = 1; - * @param array<\Google\Cloud\AlloyDb\V1beta\User>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUsers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\User::class); - $this->users = $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/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php deleted file mode 100644 index c3bcc142fd39..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource.php +++ /dev/null @@ -1,144 +0,0 @@ -google.cloud.alloydb.v1beta.MigrationSource - */ -class MigrationSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $host_port = ''; - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reference_id = ''; - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $source_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $host_port - * Output only. The host and port of the on-premises instance in host:port - * format - * @type string $reference_id - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * @type int $source_type - * Output only. Type of migration source. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getHostPort() - { - return $this->host_port; - } - - /** - * Output only. The host and port of the on-premises instance in host:port - * format - * - * Generated from protobuf field string host_port = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setHostPort($var) - { - GPBUtil::checkString($var, True); - $this->host_port = $var; - - return $this; - } - - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getReferenceId() - { - return $this->reference_id; - } - - /** - * Output only. Place holder for the external source identifier(e.g DMS job - * name) that created the cluster. - * - * Generated from protobuf field string reference_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setReferenceId($var) - { - GPBUtil::checkString($var, True); - $this->reference_id = $var; - - return $this; - } - - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getSourceType() - { - return $this->source_type; - } - - /** - * Output only. Type of migration source. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType source_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setSourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\MigrationSource\MigrationSourceType::class); - $this->source_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php deleted file mode 100644 index 0042f58cb5db..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/MigrationSource/MigrationSourceType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType - */ -class MigrationSourceType -{ - /** - * Migration source is unknown. - * - * Generated from protobuf enum MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - */ - const MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - /** - * DMS source means the cluster was created via DMS migration job. - * - * Generated from protobuf enum DMS = 1; - */ - const DMS = 1; - - private static $valueToName = [ - self::MIGRATION_SOURCE_TYPE_UNSPECIFIED => 'MIGRATION_SOURCE_TYPE_UNSPECIFIED', - self::DMS => 'DMS', - ]; - - 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(MigrationSourceType::class, \Google\Cloud\AlloyDb\V1beta\MigrationSource_MigrationSourceType::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php deleted file mode 100644 index b7a852470274..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/OperationMetadata.php +++ /dev/null @@ -1,349 +0,0 @@ -google.cloud.alloydb.v1beta.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 = ''; - protected $request_specific; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata $batch_create_instances_metadata - * Output only. BatchCreateInstances related metadata. - * @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. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Output only. BatchCreateInstances related metadata. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata|null - */ - public function getBatchCreateInstancesMetadata() - { - return $this->readOneof(8); - } - - public function hasBatchCreateInstancesMetadata() - { - return $this->hasOneof(8); - } - - /** - * Output only. BatchCreateInstances related metadata. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata batch_create_instances_metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata $var - * @return $this - */ - public function setBatchCreateInstancesMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesMetadata::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * 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; - } - - /** - * @return string - */ - public function getRequestSpecific() - { - return $this->whichOneof("request_specific"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php deleted file mode 100644 index daf0cacf087f..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/PromoteClusterRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.cloud.alloydb.v1beta.PromoteClusterRequest - */ -class PromoteClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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 = ''; - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * - * 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; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php deleted file mode 100644 index a651f553da3e..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestartInstanceRequest.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.alloydb.v1beta.RestartInstanceRequest - */ -class RestartInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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 = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * - * 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; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php deleted file mode 100644 index 46651d5bb3ca..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/RestoreClusterRequest.php +++ /dev/null @@ -1,344 +0,0 @@ -google.cloud.alloydb.v1beta.RestoreClusterRequest - */ -class RestoreClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster_id = ''; - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1beta\BackupSource $backup_source - * Backup source. - * @type \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource $continuous_backup_source - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @type string $parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @type string $cluster_id - * Required. ID of the requesting object. - * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster - * Required. The resource being created - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Backup source. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; - * @return \Google\Cloud\AlloyDb\V1beta\BackupSource|null - */ - public function getBackupSource() - { - return $this->readOneof(4); - } - - public function hasBackupSource() - { - return $this->hasOneof(4); - } - - /** - * Backup source. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.BackupSource backup_source = 4; - * @param \Google\Cloud\AlloyDb\V1beta\BackupSource $var - * @return $this - */ - public function setBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\BackupSource::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; - * @return \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource|null - */ - public function getContinuousBackupSource() - { - return $this->readOneof(8); - } - - public function hasContinuousBackupSource() - { - return $this->hasOneof(8); - } - - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.ContinuousBackupSource continuous_backup_source = 8; - * @param \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource $var - * @return $this - */ - public function setContinuousBackupSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\ContinuousBackupSource::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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 name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * - * 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. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - - /** - * Required. ID of the requesting object. - * - * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being created - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); - $this->cluster = $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 = 5 [(.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 = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * - * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php deleted file mode 100644 index 5b713a89f411..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.alloydb.v1beta.SslConfig - */ -class SslConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ssl_mode = 0; - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ca_source = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $ssl_mode - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * @type int $ca_source - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSslMode() - { - return $this->ssl_mode; - } - - /** - * Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.SslMode ssl_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSslMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\SslConfig\SslMode::class); - $this->ssl_mode = $var; - - return $this; - } - - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getCaSource() - { - return $this->ca_source; - } - - /** - * Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - * supported currently, and is the default value. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SslConfig.CaSource ca_source = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setCaSource($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\SslConfig\CaSource::class); - $this->ca_source = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php deleted file mode 100644 index d0cd73cbada3..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/CaSource.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.alloydb.v1beta.SslConfig.CaSource - */ -class CaSource -{ - /** - * Certificate Authority (CA) source not specified. Defaults to - * CA_SOURCE_MANAGED. - * - * Generated from protobuf enum CA_SOURCE_UNSPECIFIED = 0; - */ - const CA_SOURCE_UNSPECIFIED = 0; - /** - * Certificate Authority (CA) managed by the AlloyDB Cluster. - * - * Generated from protobuf enum CA_SOURCE_MANAGED = 1; - */ - const CA_SOURCE_MANAGED = 1; - - private static $valueToName = [ - self::CA_SOURCE_UNSPECIFIED => 'CA_SOURCE_UNSPECIFIED', - self::CA_SOURCE_MANAGED => 'CA_SOURCE_MANAGED', - ]; - - 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(CaSource::class, \Google\Cloud\AlloyDb\V1beta\SslConfig_CaSource::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php deleted file mode 100644 index f85486b17cf8..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SslConfig/SslMode.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.alloydb.v1beta.SslConfig.SslMode - */ -class SslMode -{ - /** - * SSL mode not specified. Defaults to ENCRYPTED_ONLY. - * - * Generated from protobuf enum SSL_MODE_UNSPECIFIED = 0; - */ - const SSL_MODE_UNSPECIFIED = 0; - /** - * SSL connections are optional. CA verification not enforced. - * - * Generated from protobuf enum SSL_MODE_ALLOW = 1 [deprecated = true]; - */ - const SSL_MODE_ALLOW = 1; - /** - * SSL connections are required. CA verification not enforced. - * Clients may use locally self-signed certificates (default psql client - * behavior). - * - * Generated from protobuf enum SSL_MODE_REQUIRE = 2 [deprecated = true]; - */ - const SSL_MODE_REQUIRE = 2; - /** - * SSL connections are required. CA verification enforced. - * Clients must have certificates signed by a Cluster CA, e.g. via - * GenerateClientCertificate. - * - * Generated from protobuf enum SSL_MODE_VERIFY_CA = 3 [deprecated = true]; - */ - const SSL_MODE_VERIFY_CA = 3; - /** - * SSL connections are optional. CA verification not enforced. - * - * Generated from protobuf enum ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - */ - const ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - /** - * SSL connections are required. CA verification not enforced. - * - * Generated from protobuf enum ENCRYPTED_ONLY = 5; - */ - const ENCRYPTED_ONLY = 5; - - private static $valueToName = [ - self::SSL_MODE_UNSPECIFIED => 'SSL_MODE_UNSPECIFIED', - self::SSL_MODE_ALLOW => 'SSL_MODE_ALLOW', - self::SSL_MODE_REQUIRE => 'SSL_MODE_REQUIRE', - self::SSL_MODE_VERIFY_CA => 'SSL_MODE_VERIFY_CA', - self::ALLOW_UNENCRYPTED_AND_ENCRYPTED => 'ALLOW_UNENCRYPTED_AND_ENCRYPTED', - self::ENCRYPTED_ONLY => 'ENCRYPTED_ONLY', - ]; - - 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(SslMode::class, \Google\Cloud\AlloyDb\V1beta\SslConfig_SslMode::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php deleted file mode 100644 index 7aea82a4c7cb..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag.php +++ /dev/null @@ -1,337 +0,0 @@ -google.cloud.alloydb.v1beta.SupportedDatabaseFlag - */ -class SupportedDatabaseFlag extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - */ - protected $flag_name = ''; - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; - */ - protected $value_type = 0; - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - */ - protected $accepts_multiple_values = false; - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; - */ - private $supported_db_versions; - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - */ - protected $requires_db_restart = false; - protected $restrictions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions $string_restrictions - * Restriction on STRING type value. - * @type \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions $integer_restrictions - * Restriction on INTEGER type value. - * @type string $name - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * @type string $flag_name - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * @type int $value_type - * @type bool $accepts_multiple_values - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * @type array|\Google\Protobuf\Internal\RepeatedField $supported_db_versions - * Major database engine versions for which this flag is supported. - * @type bool $requires_db_restart - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Restriction on STRING type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; - * @return \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions|null - */ - public function getStringRestrictions() - { - return $this->readOneof(7); - } - - public function hasStringRestrictions() - { - return $this->hasOneof(7); - } - - /** - * Restriction on STRING type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions string_restrictions = 7; - * @param \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions $var - * @return $this - */ - public function setStringRestrictions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\StringRestrictions::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Restriction on INTEGER type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; - * @return \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions|null - */ - public function getIntegerRestrictions() - { - return $this->readOneof(8); - } - - public function hasIntegerRestrictions() - { - return $this->hasOneof(8); - } - - /** - * Restriction on INTEGER type value. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions integer_restrictions = 8; - * @param \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions $var - * @return $this - */ - public function setIntegerRestrictions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\IntegerRestrictions::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the flag resource, following Google Cloud conventions, e.g.: - * * projects/{project}/locations/{location}/flags/{flag} - * This field currently has no semantic meaning. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - * @return string - */ - public function getFlagName() - { - return $this->flag_name; - } - - /** - * The name of the database flag, e.g. "max_allowed_packets". - * The is a possibly key for the Instance.database_flags map field. - * - * Generated from protobuf field string flag_name = 2; - * @param string $var - * @return $this - */ - public function setFlagName($var) - { - GPBUtil::checkString($var, True); - $this->flag_name = $var; - - return $this; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; - * @return int - */ - public function getValueType() - { - return $this->value_type; - } - - /** - * Generated from protobuf field .google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType value_type = 3; - * @param int $var - * @return $this - */ - public function setValueType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag\ValueType::class); - $this->value_type = $var; - - return $this; - } - - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - * @return bool - */ - public function getAcceptsMultipleValues() - { - return $this->accepts_multiple_values; - } - - /** - * Whether the database flag accepts multiple values. If true, - * a comma-separated list of stringified values may be specified. - * - * Generated from protobuf field bool accepts_multiple_values = 4; - * @param bool $var - * @return $this - */ - public function setAcceptsMultipleValues($var) - { - GPBUtil::checkBool($var); - $this->accepts_multiple_values = $var; - - return $this; - } - - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedDbVersions() - { - return $this->supported_db_versions; - } - - /** - * Major database engine versions for which this flag is supported. - * - * Generated from protobuf field repeated .google.cloud.alloydb.v1beta.DatabaseVersion supported_db_versions = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedDbVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AlloyDb\V1beta\DatabaseVersion::class); - $this->supported_db_versions = $arr; - - return $this; - } - - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - * @return bool - */ - public function getRequiresDbRestart() - { - return $this->requires_db_restart; - } - - /** - * Whether setting or updating this flag on an Instance requires a database - * restart. If a flag that requires database restart is set, the backend - * will automatically restart the database (making sure to satisfy any - * availability SLO's). - * - * Generated from protobuf field bool requires_db_restart = 6; - * @param bool $var - * @return $this - */ - public function setRequiresDbRestart($var) - { - GPBUtil::checkBool($var); - $this->requires_db_restart = $var; - - return $this; - } - - /** - * @return string - */ - public function getRestrictions() - { - return $this->whichOneof("restrictions"); - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php deleted file mode 100644 index 696f2ff77b67..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/IntegerRestrictions.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - */ -class IntegerRestrictions extends \Google\Protobuf\Internal\Message -{ - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - */ - protected $min_value = null; - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - */ - protected $max_value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int64Value $min_value - * The minimum value that can be specified, if applicable. - * @type \Google\Protobuf\Int64Value $max_value - * The maximum value that can be specified, if applicable. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMinValue() - { - return $this->min_value; - } - - public function hasMinValue() - { - return isset($this->min_value); - } - - public function clearMinValue() - { - unset($this->min_value); - } - - /** - * Returns the unboxed value from getMinValue() - - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @return int|string|null - */ - public function getMinValueUnwrapped() - { - return $this->readWrapperValue("min_value"); - } - - /** - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMinValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->min_value = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * The minimum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value min_value = 1; - * @param int|string|null $var - * @return $this - */ - public function setMinValueUnwrapped($var) - { - $this->writeWrapperValue("min_value", $var); - return $this;} - - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMaxValue() - { - return $this->max_value; - } - - public function hasMaxValue() - { - return isset($this->max_value); - } - - public function clearMaxValue() - { - unset($this->max_value); - } - - /** - * Returns the unboxed value from getMaxValue() - - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @return int|string|null - */ - public function getMaxValueUnwrapped() - { - return $this->readWrapperValue("max_value"); - } - - /** - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMaxValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->max_value = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * The maximum value that can be specified, if applicable. - * - * Generated from protobuf field .google.protobuf.Int64Value max_value = 2; - * @param int|string|null $var - * @return $this - */ - public function setMaxValueUnwrapped($var) - { - $this->writeWrapperValue("max_value", $var); - return $this;} - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IntegerRestrictions::class, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag_IntegerRestrictions::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php deleted file mode 100644 index eed5b5cd7cfe..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/StringRestrictions.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - */ -class StringRestrictions extends \Google\Protobuf\Internal\Message -{ - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - */ - private $allowed_values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_values - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedValues() - { - return $this->allowed_values; - } - - /** - * The list of allowed values, if bounded. This field will be empty - * if there is a unbounded number of allowed values. - * - * Generated from protobuf field repeated string allowed_values = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_values = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StringRestrictions::class, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag_StringRestrictions::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php deleted file mode 100644 index 70ee918dffa2..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/SupportedDatabaseFlag/ValueType.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType - */ -class ValueType -{ - /** - * This is an unknown flag type. - * - * Generated from protobuf enum VALUE_TYPE_UNSPECIFIED = 0; - */ - const VALUE_TYPE_UNSPECIFIED = 0; - /** - * String type flag. - * - * Generated from protobuf enum STRING = 1; - */ - const STRING = 1; - /** - * Integer type flag. - * - * Generated from protobuf enum INTEGER = 2; - */ - const INTEGER = 2; - /** - * Float type flag. - * - * Generated from protobuf enum FLOAT = 3; - */ - const FLOAT = 3; - /** - * Denotes that the flag does not accept any values. - * - * Generated from protobuf enum NONE = 4; - */ - const NONE = 4; - - private static $valueToName = [ - self::VALUE_TYPE_UNSPECIFIED => 'VALUE_TYPE_UNSPECIFIED', - self::STRING => 'STRING', - self::INTEGER => 'INTEGER', - self::FLOAT => 'FLOAT', - self::NONE => 'NONE', - ]; - - 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(ValueType::class, \Google\Cloud\AlloyDb\V1beta\SupportedDatabaseFlag_ValueType::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php deleted file mode 100644 index acf677a37046..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateBackupRequest.php +++ /dev/null @@ -1,287 +0,0 @@ -google.cloud.alloydb.v1beta.UpdateBackupRequest - */ -class UpdateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1beta\Backup $backup - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Backup::class); - $this->backup = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php deleted file mode 100644 index a84bb6b0f1cd..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateClusterRequest.php +++ /dev/null @@ -1,291 +0,0 @@ -google.cloud.alloydb.v1beta.UpdateClusterRequest - */ -class UpdateClusterRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1beta\Cluster $cluster - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Cluster|null - */ - public function getCluster() - { - return $this->cluster; - } - - public function hasCluster() - { - return isset($this->cluster); - } - - public function clearCluster() - { - unset($this->cluster); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Cluster $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Cluster::class); - $this->cluster = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php deleted file mode 100644 index 9e384c42caf5..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateInstanceRequest.php +++ /dev/null @@ -1,291 +0,0 @@ -google.cloud.alloydb.v1beta.UpdateInstanceRequest - */ -class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $instance = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1beta\Instance $instance - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allow_missing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\Instance|null - */ - public function getInstance() - { - return $this->instance; - } - - public function hasInstance() - { - return isset($this->instance); - } - - public function clearInstance() - { - unset($this->instance); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\Instance $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\Instance::class); - $this->instance = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php deleted file mode 100644 index 8f9004b51523..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UpdateUserRequest.php +++ /dev/null @@ -1,283 +0,0 @@ -google.cloud.alloydb.v1beta.UpdateUserRequest - */ -class UpdateUserRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user = 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $allow_missing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type \Google\Cloud\AlloyDb\V1beta\User $user - * Required. The resource being updated - * @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). - * @type bool $validate_only - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allow_missing - * Optional. Allow missing fields in the update mask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Service::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AlloyDb\V1beta\User|null - */ - public function getUser() - { - return $this->user; - } - - public function hasUser() - { - return isset($this->user); - } - - public function clearUser() - { - unset($this->user); - } - - /** - * Required. The resource being updated - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AlloyDb\V1beta\User $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1beta\User::class); - $this->user = $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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * Optional. Allow missing fields in the update mask. - * - * Generated from protobuf field bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php deleted file mode 100644 index b8a8e5c1a62f..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.alloydb.v1beta.User - */ -class User extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $password = ''; - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_roles; - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * @type string $password - * Input only. Password for the user. - * @type array|\Google\Protobuf\Internal\RepeatedField $database_roles - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * @type int $user_type - * Optional. Type of this user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Name of the resource in the form of - * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Input only. Password for the user. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDatabaseRoles() - { - return $this->database_roles; - } - - /** - * Optional. List of database roles this user has. - * The database role strings are subject to the PostgreSQL naming conventions. - * - * Generated from protobuf field repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDatabaseRoles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->database_roles = $arr; - - return $this; - } - - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getUserType() - { - return $this->user_type; - } - - /** - * Optional. Type of this user. - * - * Generated from protobuf field .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setUserType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1beta\User\UserType::class); - $this->user_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php deleted file mode 100644 index de0c45e53dec..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/User/UserType.php +++ /dev/null @@ -1,65 +0,0 @@ -google.cloud.alloydb.v1beta.User.UserType - */ -class UserType -{ - /** - * Unspecified user type. - * - * Generated from protobuf enum USER_TYPE_UNSPECIFIED = 0; - */ - const USER_TYPE_UNSPECIFIED = 0; - /** - * The default user type that authenticates via password-based - * authentication. - * - * Generated from protobuf enum ALLOYDB_BUILT_IN = 1; - */ - const ALLOYDB_BUILT_IN = 1; - /** - * Database user that can authenticate via IAM-Based authentication. - * - * Generated from protobuf enum ALLOYDB_IAM_USER = 2; - */ - const ALLOYDB_IAM_USER = 2; - - private static $valueToName = [ - self::USER_TYPE_UNSPECIFIED => 'USER_TYPE_UNSPECIFIED', - self::ALLOYDB_BUILT_IN => 'ALLOYDB_BUILT_IN', - self::ALLOYDB_IAM_USER => 'ALLOYDB_IAM_USER', - ]; - - 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(UserType::class, \Google\Cloud\AlloyDb\V1beta\User_UserType::class); - diff --git a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php b/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php deleted file mode 100644 index e06daa34e50a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/proto/src/Google/Cloud/AlloyDb/V1beta/UserPassword.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.alloydb.v1beta.UserPassword - */ -class UserPassword extends \Google\Protobuf\Internal\Message -{ - /** - * The database username. - * - * Generated from protobuf field string user = 1; - */ - protected $user = ''; - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - */ - protected $password = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $user - * The database username. - * @type string $password - * The initial password for the user. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The database username. - * - * Generated from protobuf field string user = 1; - * @return string - */ - public function getUser() - { - return $this->user; - } - - /** - * The database username. - * - * Generated from protobuf field string user = 1; - * @param string $var - * @return $this - */ - public function setUser($var) - { - GPBUtil::checkString($var, True); - $this->user = $var; - - return $this; - } - - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * The initial password for the user. - * - * Generated from protobuf field string password = 2; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php deleted file mode 100644 index 52e84d7f74f0..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/batch_create_instances.php +++ /dev/null @@ -1,123 +0,0 @@ -setInstanceType($requestsCreateInstanceRequestsInstanceInstanceType); - $createInstanceRequest = (new CreateInstanceRequest()) - ->setParent($formattedRequestsCreateInstanceRequestsParent) - ->setInstanceId($requestsCreateInstanceRequestsInstanceId) - ->setInstance($requestsCreateInstanceRequestsInstance); - $requestsCreateInstanceRequests = [$createInstanceRequest,]; - $requests = (new CreateInstanceRequests()) - ->setCreateInstanceRequests($requestsCreateInstanceRequests); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchCreateInstancesResponse $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $formattedRequestsCreateInstanceRequestsParent = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - $requestsCreateInstanceRequestsInstanceId = '[INSTANCE_ID]'; - $requestsCreateInstanceRequestsInstanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - batch_create_instances_sample( - $formattedParent, - $formattedRequestsCreateInstanceRequestsParent, - $requestsCreateInstanceRequestsInstanceId, - $requestsCreateInstanceRequestsInstanceInstanceType - ); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php deleted file mode 100644 index 368a89937ba4..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_backup.php +++ /dev/null @@ -1,95 +0,0 @@ -setClusterName($formattedBackupClusterName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $backupId = '[BACKUP_ID]'; - $formattedBackupClusterName = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - - create_backup_sample($formattedParent, $backupId, $formattedBackupClusterName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php deleted file mode 100644 index 9ed8d7d7f10a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_cluster.php +++ /dev/null @@ -1,95 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - create_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php deleted file mode 100644 index 32186e925387..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_instance.php +++ /dev/null @@ -1,91 +0,0 @@ -setInstanceType($instanceInstanceType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = '[INSTANCE_ID]'; - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - create_instance_sample($formattedParent, $instanceId, $instanceInstanceType); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php deleted file mode 100644 index 170313b20f28..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_cluster.php +++ /dev/null @@ -1,96 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - create_secondary_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php deleted file mode 100644 index 2bf313b63d53..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_secondary_instance.php +++ /dev/null @@ -1,91 +0,0 @@ -setInstanceType($instanceInstanceType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = '[INSTANCE_ID]'; - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - create_secondary_instance_sample($formattedParent, $instanceId, $instanceInstanceType); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php deleted file mode 100644 index cae83d717ad4..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/create_user.php +++ /dev/null @@ -1,71 +0,0 @@ -createUser($formattedParent, $userId, $user); - 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 -{ - $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = '[USER_ID]'; - - create_user_sample($formattedParent, $userId); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php deleted file mode 100644 index 3f1febc8e724..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_backup.php +++ /dev/null @@ -1,76 +0,0 @@ -deleteBackup($formattedName); - $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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - delete_backup_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php deleted file mode 100644 index bb041576705e..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_cluster.php +++ /dev/null @@ -1,76 +0,0 @@ -deleteCluster($formattedName); - $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - delete_cluster_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php deleted file mode 100644 index 27305f897086..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_instance.php +++ /dev/null @@ -1,81 +0,0 @@ -deleteInstance($formattedName); - $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 = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - delete_instance_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php deleted file mode 100644 index 1b1b1b6bb1a3..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/delete_user.php +++ /dev/null @@ -1,65 +0,0 @@ -deleteUser($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - - delete_user_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php deleted file mode 100644 index 9ecde842d163..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/failover_instance.php +++ /dev/null @@ -1,86 +0,0 @@ -failoverInstance($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - failover_instance_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php deleted file mode 100644 index 533076d0b8fe..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/generate_client_certificate.php +++ /dev/null @@ -1,71 +0,0 @@ -generateClientCertificate($formattedParent); - 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 -{ - $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - generate_client_certificate_sample($formattedParent); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php deleted file mode 100644 index 0901823b09ca..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_backup.php +++ /dev/null @@ -1,66 +0,0 @@ -getBackup($formattedName); - 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 = AlloyDBAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - get_backup_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php deleted file mode 100644 index 460b58f41f1a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_cluster.php +++ /dev/null @@ -1,67 +0,0 @@ -getCluster($formattedName); - 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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - get_cluster_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php deleted file mode 100644 index c07d04eb773a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_connection_info.php +++ /dev/null @@ -1,72 +0,0 @@ -getConnectionInfo($formattedParent); - 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 -{ - $formattedParent = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - get_connection_info_sample($formattedParent); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php deleted file mode 100644 index 80f5f2b589dc..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_instance.php +++ /dev/null @@ -1,72 +0,0 @@ -getInstance($formattedName); - 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 = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - get_instance_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php deleted file mode 100644 index 0fa245f61006..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_GetLocation_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php deleted file mode 100644 index 4748e0484750..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/get_user.php +++ /dev/null @@ -1,67 +0,0 @@ -getUser($formattedName); - 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 = AlloyDBAdminClient::userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - - get_user_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php deleted file mode 100644 index 9f11b9f6469f..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/inject_fault.php +++ /dev/null @@ -1,88 +0,0 @@ -injectFault($faultType, $formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - inject_fault_sample($faultType, $formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php deleted file mode 100644 index da790b81697b..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_backups.php +++ /dev/null @@ -1,71 +0,0 @@ -listBackups($formattedParent); - - /** @var Backup $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_backups_sample($formattedParent); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php deleted file mode 100644 index 36a8dd849a7d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_clusters.php +++ /dev/null @@ -1,74 +0,0 @@ -listClusters($formattedParent); - - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_clusters_sample($formattedParent); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php deleted file mode 100644 index 5cb79b0b9bea..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_instances.php +++ /dev/null @@ -1,76 +0,0 @@ -listInstances($formattedParent); - - /** @var Instance $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - list_instances_sample($formattedParent); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php deleted file mode 100644 index 5b2c4bcc436a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 alloydb_v1beta_generated_AlloyDBAdmin_ListLocations_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php deleted file mode 100644 index ae7059a23efa..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_supported_database_flags.php +++ /dev/null @@ -1,77 +0,0 @@ -listSupportedDatabaseFlags($formattedParent); - - /** @var SupportedDatabaseFlag $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - - list_supported_database_flags_sample($formattedParent); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php deleted file mode 100644 index 327f9b2a0edb..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/list_users.php +++ /dev/null @@ -1,71 +0,0 @@ -listUsers($formattedParent); - - /** @var User $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 = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - list_users_sample($formattedParent); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php deleted file mode 100644 index 95e6eef0384e..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/promote_cluster.php +++ /dev/null @@ -1,82 +0,0 @@ -promoteCluster($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 -{ - $formattedName = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - - promote_cluster_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php deleted file mode 100644 index 768aacdd964f..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restart_instance.php +++ /dev/null @@ -1,85 +0,0 @@ -restartInstance($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $formattedName = AlloyDBAdminClient::instanceName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]', - '[INSTANCE]' - ); - - restart_instance_sample($formattedName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php deleted file mode 100644 index b585b6a06f32..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/restore_cluster.php +++ /dev/null @@ -1,97 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 = AlloyDBAdminClient::locationName('[PROJECT]', '[LOCATION]'); - $clusterId = '[CLUSTER_ID]'; - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - restore_cluster_sample($formattedParent, $clusterId, $formattedClusterNetwork); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php deleted file mode 100644 index 143b91fcd98d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_backup.php +++ /dev/null @@ -1,87 +0,0 @@ -setClusterName($formattedBackupClusterName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateBackup($backup); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Backup $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 -{ - $formattedBackupClusterName = AlloyDBAdminClient::clusterName( - '[PROJECT]', - '[LOCATION]', - '[CLUSTER]' - ); - - update_backup_sample($formattedBackupClusterName); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php deleted file mode 100644 index e0e80ee1986d..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_cluster.php +++ /dev/null @@ -1,86 +0,0 @@ -setNetwork($formattedClusterNetwork); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateCluster($cluster); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Cluster $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 -{ - $formattedClusterNetwork = AlloyDBAdminClient::networkName('[PROJECT]', '[NETWORK]'); - - update_cluster_sample($formattedClusterNetwork); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php deleted file mode 100644 index e78454363359..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_instance.php +++ /dev/null @@ -1,82 +0,0 @@ -setInstanceType($instanceInstanceType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $alloyDBAdminClient->updateInstance($instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $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 -{ - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - - update_instance_sample($instanceInstanceType); -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php b/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php deleted file mode 100644 index dc411c16fe35..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/samples/V1beta/AlloyDBAdminClient/update_user.php +++ /dev/null @@ -1,56 +0,0 @@ -updateUser($user); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php deleted file mode 100644 index 00f0245964d6..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/AlloyDBAdminClient.php +++ /dev/null @@ -1,36 +0,0 @@ -clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $requests = new CreateInstanceRequests(); - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class AlloyDBAdminGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.alloydb.v1beta.AlloyDBAdmin'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'alloydb.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $backupNameTemplate; - - private static $clusterNameTemplate; - - private static $cryptoKeyVersionNameTemplate; - - private static $instanceNameTemplate; - - private static $locationNameTemplate; - - private static $networkNameTemplate; - - private static $userNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/alloy_db_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/alloy_db_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/alloy_db_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/alloy_db_admin_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getClusterNameTemplate() - { - if (self::$clusterNameTemplate == null) { - self::$clusterNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}'); - } - - return self::$clusterNameTemplate; - } - - private static function getCryptoKeyVersionNameTemplate() - { - if (self::$cryptoKeyVersionNameTemplate == null) { - self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); - } - - return self::$cryptoKeyVersionNameTemplate; - } - - private static function getInstanceNameTemplate() - { - if (self::$instanceNameTemplate == null) { - self::$instanceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}'); - } - - return self::$instanceNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getUserNameTemplate() - { - if (self::$userNameTemplate == null) { - self::$userNameTemplate = new PathTemplate('projects/{project}/locations/{location}/clusters/{cluster}/users/{user}'); - } - - return self::$userNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'cluster' => self::getClusterNameTemplate(), - 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), - 'instance' => self::getInstanceNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'user' => self::getUserNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $backup - * - * @return string The formatted backup resource. - * - * @experimental - */ - public static function backupName($project, $location, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a cluster - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * - * @return string The formatted cluster resource. - * - * @experimental - */ - public static function clusterName($project, $location, $cluster) - { - return self::getClusterNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * crypto_key_version resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * @param string $cryptoKeyVersion - * - * @return string The formatted crypto_key_version resource. - * - * @experimental - */ - public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) - { - return self::getCryptoKeyVersionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - 'crypto_key_version' => $cryptoKeyVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a instance - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $instance - * - * @return string The formatted instance resource. - * - * @experimental - */ - public static function instanceName($project, $location, $cluster, $instance) - { - return self::getInstanceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'instance' => $instance, - ]); - } - - /** - * 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. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a user - * resource. - * - * @param string $project - * @param string $location - * @param string $cluster - * @param string $user - * - * @return string The formatted user resource. - * - * @experimental - */ - public static function userName($project, $location, $cluster, $user) - { - return self::getUserNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'cluster' => $cluster, - 'user' => $user, - ]); - } - - /** - * 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}/backups/{backup} - * - cluster: projects/{project}/locations/{location}/clusters/{cluster} - * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} - * - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user} - * - * 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. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - 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 - * - * @experimental - */ - 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; - } - - /** - * 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 'alloydb.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 - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates new instances under the given project, location and cluster. - * There can be only one primary instance in a cluster. If the primary - * instance exists in the cluster as well as this request, then API will - * throw an error. - * The primary instance should exist before any read pool instance is - * created. If the primary instance is a part of the request payload, then - * the API will take care of creating instances in the correct order. - * This method is here to support Google-internal use cases, and is not meant - * for external customers to consume. Please do not start relying on it; its - * behavior is subject to change without notice. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $requests = new CreateInstanceRequests(); - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->batchCreateInstances($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'batchCreateInstances'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. - * @param CreateInstanceRequests $requests Required. Resources being created. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function batchCreateInstances($parent, $requests, array $optionalArgs = []) - { - $request = new BatchCreateInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchCreateInstances', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Backup in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Value for parent. - * @param string $backupId Required. ID of the requesting object. - * @param Backup $backup Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Cluster in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object. - * @param Cluster $cluster Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new CreateClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Instance in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $instanceId = 'instance_id'; - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createInstance($formattedParent, $instanceId, $instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param string $instanceId Required. ID of the requesting object. - * @param Instance $instance Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createInstance($parent, $instanceId, $instance, array $optionalArgs = []) - { - $request = new CreateInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a cluster of type SECONDARY in the given location using - * the primary cluster as the source. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object (the secondary cluster). - * @param Cluster $cluster Required. Configuration of the requesting object (the secondary cluster). - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createSecondaryCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new CreateSecondaryClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateSecondaryCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new SECONDARY Instance in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $instanceId = 'instance_id'; - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'createSecondaryInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param string $instanceId Required. ID of the requesting object. - * @param Instance $instance Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createSecondaryInstance($parent, $instanceId, $instance, array $optionalArgs = []) - { - $request = new CreateSecondaryInstanceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInstanceId($instanceId); - $request->setInstance($instance); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateSecondaryInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new User in a given project, location, and cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $userId = 'user_id'; - * $user = new User(); - * $response = $alloyDBAdminClient->createUser($formattedParent, $userId, $user); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Value for parent. - * @param string $userId Required. ID of the requesting object. - * @param User $user Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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 \Google\Cloud\AlloyDb\V1beta\User - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createUser($parent, $userId, $user, array $optionalArgs = []) - { - $request = new CreateUserRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setUserId($userId); - $request->setUser($user); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type string $etag - * Optional. The current etag of the Backup. - * If an etag is provided and does not match the current etag of the Backup, - * deletion will be blocked and an ABORTED error will be returned. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteCluster($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @type bool $force - * Optional. Whether to cascade delete child instances for given cluster. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteCluster($name, array $optionalArgs = []) - { - $request = new DeleteClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->deleteInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'deleteInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteInstance($name, array $optionalArgs = []) - { - $request = new DeleteInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - * $alloyDBAdminClient->deleteUser($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @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. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteUser($name, array $optionalArgs = []) - { - $request = new DeleteUserRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteUser', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->failoverInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'failoverInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function failoverInstance($name, array $optionalArgs = []) - { - $request = new FailoverInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('FailoverInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Generate a client certificate signed by a Cluster CA. - * The sole purpose of this endpoint is to support AlloyDB connectors and the - * Auth Proxy client. The endpoint's behavior is subject to change without - * notice, so do not rely on its behavior remaining constant. Future changes - * will not break AlloyDB connectors or the Auth Proxy client. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $response = $alloyDBAdminClient->generateClientCertificate($formattedParent); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $pemCsr - * Optional. A pem-encoded X.509 certificate signing request (CSR). - * @type Duration $certDuration - * Optional. An optional hint to the endpoint to generate the client - * certificate with the requested duration. The duration can be from 1 hour to - * 24 hours. The endpoint may or may not honor the hint. If the hint is left - * unspecified or is not honored, then the endpoint will pick an appropriate - * default duration. - * @type string $publicKey - * Optional. The public key from the client. - * @type bool $useMetadataExchange - * Optional. An optional hint to the endpoint to generate a client - * ceritificate that can be used by AlloyDB connectors to exchange additional - * metadata with the server after TLS handshake. - * @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 \Google\Cloud\AlloyDb\V1beta\GenerateClientCertificateResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function generateClientCertificate($parent, array $optionalArgs = []) - { - $request = new GenerateClientCertificateRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['pemCsr'])) { - $request->setPemCsr($optionalArgs['pemCsr']); - } - - if (isset($optionalArgs['certDuration'])) { - $request->setCertDuration($optionalArgs['certDuration']); - } - - if (isset($optionalArgs['publicKey'])) { - $request->setPublicKey($optionalArgs['publicKey']); - } - - if (isset($optionalArgs['useMetadataExchange'])) { - $request->setUseMetadataExchange($optionalArgs['useMetadataExchange']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateClientCertificate', GenerateClientCertificateResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $response = $alloyDBAdminClient->getBackup($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the resource - * @param array $optionalArgs { - * 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 \Google\Cloud\AlloyDb\V1beta\Backup - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $response = $alloyDBAdminClient->getCluster($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1beta\ClusterView} - * @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 \Google\Cloud\AlloyDb\V1beta\Cluster - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getCluster($name, array $optionalArgs = []) - { - $request = new GetClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetCluster', Cluster::class, $optionalArgs, $request)->wait(); - } - - /** - * Get instance metadata used for a connection. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $response = $alloyDBAdminClient->getConnectionInfo($formattedParent); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @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 \Google\Cloud\AlloyDb\V1beta\ConnectionInfo - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getConnectionInfo($parent, array $optionalArgs = []) - { - $request = new GetConnectionInfoRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConnectionInfo', ConnectionInfo::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $response = $alloyDBAdminClient->getInstance($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * The view of the instance to return. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1beta\InstanceView} - * @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 \Google\Cloud\AlloyDb\V1beta\Instance - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getInstance($name, array $optionalArgs = []) - { - $request = new GetInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetInstance', Instance::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - * $response = $alloyDBAdminClient->getUser($formattedName); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param array $optionalArgs { - * 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 \Google\Cloud\AlloyDb\V1beta\User - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getUser($name, array $optionalArgs = []) - { - $request = new GetUserRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Injects fault in an instance. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->injectFault($faultType, $formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'injectFault'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param int $faultType Required. The type of fault to be injected in an instance. - * For allowed values, use constants defined on {@see \Google\Cloud\AlloyDb\V1beta\InjectFaultRequest\FaultType} - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function injectFault($faultType, $name, array $optionalArgs = []) - { - $request = new InjectFaultRequest(); - $requestParamHeaders = []; - $request->setFaultType($faultType); - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('InjectFault', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Lists Backups in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent value for ListBackupsRequest - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Filtering results - * @type string $orderBy - * Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists Clusters in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listClusters($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with the following format: - * * projects/{project}/locations/- - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listClusters($parent, array $optionalArgs = []) - { - $request = new ListClustersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListClusters', $optionalArgs, ListClustersResponse::class, $request); - } - - /** - * Lists Instances in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listInstances($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. Additionally, you can perform an - * aggregated list operation by specifying a value with one of the following - * formats: - * * projects/{project}/locations/-/clusters/- - * * projects/{project}/locations/{region}/clusters/- - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listInstances($parent, array $optionalArgs = []) - { - $request = new ListInstancesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListInstances', $optionalArgs, ListInstancesResponse::class, $request); - } - - /** - * Lists SupportedDatabaseFlags for a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listSupportedDatabaseFlags($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location} - * - * Regardless of the parent specified here, as long it is contains a valid - * project and location, the service will return a static list of supported - * flags resources. Note that we do not yet support region-specific - * flags. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listSupportedDatabaseFlags($parent, array $optionalArgs = []) - { - $request = new ListSupportedDatabaseFlagsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListSupportedDatabaseFlags', $optionalArgs, ListSupportedDatabaseFlagsResponse::class, $request); - } - - /** - * Lists Users in a given project and location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listUsers($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent value for ListUsersRequest - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering results - * @type string $orderBy - * Optional. Hint for how to order the results - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listUsers($parent, array $optionalArgs = []) - { - $request = new ListUsersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListUsers', $optionalArgs, ListUsersResponse::class, $request); - } - - /** - * Promotes a SECONDARY cluster. This turns down replication - * from the PRIMARY cluster and promotes a secondary cluster - * into its own standalone cluster. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->promoteCluster($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'promoteCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type string $etag - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function promoteCluster($name, array $optionalArgs = []) - { - $request = new PromoteClusterRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('PromoteCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Restart an Instance in a cluster. - * Imperative only. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedName = $alloyDBAdminClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->restartInstance($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restartInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restartInstance($name, array $optionalArgs = []) - { - $request = new RestartInstanceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestartInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new Cluster in a given project and location, with a volume - * restored from the provided source, either a backup ID or a point-in-time - * and a source cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $formattedParent = $alloyDBAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $clusterId = 'cluster_id'; - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->restoreCluster($formattedParent, $clusterId, $cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'restoreCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param string $clusterId Required. ID of the requesting object. - * @param Cluster $cluster Required. The resource being created - * @param array $optionalArgs { - * Optional. - * - * @type BackupSource $backupSource - * Backup source. - * @type ContinuousBackupSource $continuousBackupSource - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restoreCluster($parent, $clusterId, $cluster, array $optionalArgs = []) - { - $request = new RestoreClusterRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setClusterId($clusterId); - $request->setCluster($cluster); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['backupSource'])) { - $request->setBackupSource($optionalArgs['backupSource']); - } - - if (isset($optionalArgs['continuousBackupSource'])) { - $request->setContinuousBackupSource($optionalArgs['continuousBackupSource']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Backup. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $backup = new Backup(); - * $operationResponse = $alloyDBAdminClient->updateBackup($backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateBackup($backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Backup $backup Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new backup is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateBackup($backup, array $optionalArgs = []) - { - $request = new UpdateBackupRequest(); - $requestParamHeaders = []; - $request->setBackup($backup); - $requestParamHeaders['backup.name'] = $backup->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Cluster. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $cluster = new Cluster(); - * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateCluster($cluster); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateCluster'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Cluster $cluster Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateCluster($cluster, array $optionalArgs = []) - { - $request = new UpdateClusterRequest(); - $requestParamHeaders = []; - $request->setCluster($cluster); - $requestParamHeaders['cluster.name'] = $cluster->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateCluster', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single Instance. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $instance = new Instance(); - * $operationResponse = $alloyDBAdminClient->updateInstance($instance); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $alloyDBAdminClient->updateInstance($instance); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $alloyDBAdminClient->resumeOperation($operationName, 'updateInstance'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param Instance $instance Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * Instance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. - * @type bool $allowMissing - * Optional. If set to true, update succeeds even if instance is not found. In - * that case, a new instance is created and `update_mask` is ignored. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateInstance($instance, array $optionalArgs = []) - { - $request = new UpdateInstanceRequest(); - $requestParamHeaders = []; - $request->setInstance($instance); - $requestParamHeaders['instance.name'] = $instance->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateInstance', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single User. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $user = new User(); - * $response = $alloyDBAdminClient->updateUser($user); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param User $user Required. The resource being updated - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Field mask is used to specify the fields to be overwritten in the - * User resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @type string $requestId - * 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). - * @type bool $validateOnly - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @type bool $allowMissing - * Optional. Allow missing fields in the update mask. - * @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 \Google\Cloud\AlloyDb\V1beta\User - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateUser($user, array $optionalArgs = []) - { - $request = new UpdateUserRequest(); - $requestParamHeaders = []; - $request->setUser($user); - $requestParamHeaders['user.name'] = $user->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateUser', User::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * $response = $alloyDBAdminClient->getLocation(); - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $alloyDBAdminClient = new AlloyDBAdminClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $alloyDBAdminClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alloyDBAdminClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alloyDBAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json deleted file mode 100644 index 9adddc862f2a..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/gapic_metadata.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.alloydb.v1beta", - "libraryPackage": "Google\\Cloud\\AlloyDb\\V1beta", - "services": { - "AlloyDBAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBAdminGapicClient", - "rpcs": { - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags" - ] - }, - "ListUsers": { - "methods": [ - "listUsers" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json deleted file mode 100644 index 3e97d3cf7d1c..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_client_config.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1beta.AlloyDBAdmin": { - "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": 60000, - "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": { - "BatchCreateInstances": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateSecondaryCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateSecondaryInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateUser": { - "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_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteUser": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GenerateClientCertificate": { - "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" - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetConnectionInfo": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetUser": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "InjectFault": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListSupportedDatabaseFlags": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListUsers": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PromoteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RestoreCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateUser": { - "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_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php deleted file mode 100644 index fa9ffeb8a1f0..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_descriptor_config.php +++ /dev/null @@ -1,242 +0,0 @@ - [ - 'google.cloud.alloydb.v1beta.AlloyDBAdmin' => [ - 'BatchCreateInstances' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\BatchCreateInstancesResponse', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Backup', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateSecondaryCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateSecondaryInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'FailoverInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'InjectFault' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'PromoteCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestartInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestoreCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Backup', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateCluster' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Cluster', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateInstance' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AlloyDb\V1beta\Instance', - 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - ], - 'ListClusters' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getClusters', - ], - ], - 'ListInstances' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getInstances', - ], - ], - 'ListSupportedDatabaseFlags' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSupportedDatabaseFlags', - ], - ], - 'ListUsers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUsers', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - ], - ], -]; diff --git a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php b/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php deleted file mode 100644 index 5a1cc032048b..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/src/V1beta/resources/alloy_db_admin_rest_client_config.php +++ /dev/null @@ -1,453 +0,0 @@ - [ - 'google.cloud.alloydb.v1beta.AlloyDBAdmin' => [ - 'BatchCreateInstances' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate', - 'body' => 'requests', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/backups', - 'body' => 'backup', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_id', - ], - ], - 'CreateCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'cluster_id', - ], - ], - 'CreateInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'instance_id', - ], - ], - 'CreateSecondaryCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary', - 'body' => 'cluster', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateSecondaryInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary', - 'body' => 'instance', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateUser' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/users', - 'body' => 'user', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'user_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteCluster' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteInstance' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteUser' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/users/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'FailoverInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GenerateClientCertificate' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCluster' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetConnectionInfo' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetInstance' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetUser' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/users/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'InjectFault' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListClusters' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListInstances' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/instances', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListSupportedDatabaseFlags' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListUsers' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/clusters/*}/users', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PromoteCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*}:promote', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestartInstance' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestoreCluster' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/clusters:restore', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateBackup' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{backup.name=projects/*/locations/*/backups/*}', - 'body' => 'backup', - 'placeholders' => [ - 'backup.name' => [ - 'getters' => [ - 'getBackup', - 'getName', - ], - ], - ], - ], - 'UpdateCluster' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{cluster.name=projects/*/locations/*/clusters/*}', - 'body' => 'cluster', - 'placeholders' => [ - 'cluster.name' => [ - 'getters' => [ - 'getCluster', - 'getName', - ], - ], - ], - ], - 'UpdateInstance' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}', - 'body' => 'instance', - 'placeholders' => [ - 'instance.name' => [ - 'getters' => [ - 'getInstance', - 'getName', - ], - ], - ], - ], - 'UpdateUser' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}', - 'body' => 'user', - 'placeholders' => [ - 'user.name' => [ - 'getters' => [ - 'getUser', - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php b/owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php deleted file mode 100644 index 427b930b6e28..000000000000 --- a/owl-bot-staging/AlloyDb/v1beta/tests/Unit/V1beta/AlloyDBAdminClientTest.php +++ /dev/null @@ -1,3403 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return AlloyDBAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new AlloyDBAdminClient($options); - } - - /** @test */ - public function batchCreateInstancesTest() - { - $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/batchCreateInstancesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateInstancesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateInstancesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $response = $gapicClient->batchCreateInstances($formattedParent, $requests); - $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.alloydb.v1beta.AlloyDBAdmin/BatchCreateInstances', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - $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 batchCreateInstancesExceptionTest() - { - $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/batchCreateInstancesTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $requests = new CreateInstanceRequests(); - $requestsCreateInstanceRequests = []; - $requests->setCreateInstanceRequests($requestsCreateInstanceRequests); - $response = $gapicClient->batchCreateInstances($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateInstancesTest'); - 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 createBackupTest() - { - $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/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $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.alloydb.v1beta.AlloyDBAdmin/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $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 createBackupExceptionTest() - { - $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/createBackupTest'); - $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]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - 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 createClusterTest() - { - $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/createClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1beta.AlloyDBAdmin/CreateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - $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 createClusterExceptionTest() - { - $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/createClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createClusterTest'); - 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 createInstanceTest() - { - $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/createInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); - $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.alloydb.v1beta.AlloyDBAdmin/CreateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - $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 createInstanceExceptionTest() - { - $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/createInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createInstance($formattedParent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); - 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 createSecondaryClusterTest() - { - $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/createSecondaryClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - $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 createSecondaryClusterExceptionTest() - { - $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/createSecondaryClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->createSecondaryCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryClusterTest'); - 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 createSecondaryInstanceTest() - { - $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/createSecondaryInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createSecondaryInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $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.alloydb.v1beta.AlloyDBAdmin/CreateSecondaryInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - $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 createSecondaryInstanceExceptionTest() - { - $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/createSecondaryInstanceTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->createSecondaryInstance($formattedParent, $instanceId, $instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createSecondaryInstanceTest'); - 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 createUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - $response = $gapicClient->createUser($formattedParent, $userId, $user); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getUserId(); - $this->assertProtobufEquals($userId, $actualValue); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createUserExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $userId = 'userId-147132913'; - $user = new User(); - try { - $gapicClient->createUser($formattedParent, $userId, $user); - // 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 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); - $expectedResponse = new GPBEmpty(); - $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]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $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.alloydb.v1beta.AlloyDBAdmin/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]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $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 deleteClusterTest() - { - $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/deleteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->deleteCluster($formattedName); - $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.alloydb.v1beta.AlloyDBAdmin/DeleteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - $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 deleteClusterExceptionTest() - { - $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/deleteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->deleteCluster($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); - 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 deleteInstanceTest() - { - $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/deleteInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $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.alloydb.v1beta.AlloyDBAdmin/DeleteInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - $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 deleteInstanceExceptionTest() - { - $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/deleteInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->deleteInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); - 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 deleteUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $gapicClient->deleteUser($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - try { - $gapicClient->deleteUser($formattedName); - // 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 failoverInstanceTest() - { - $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/failoverInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/failoverInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->failoverInstance($formattedName); - $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.alloydb.v1beta.AlloyDBAdmin/FailoverInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - $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 failoverInstanceExceptionTest() - { - $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/failoverInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->failoverInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/failoverInstanceTest'); - 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 generateClientCertificateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $pemCertificate = 'pemCertificate1234463984'; - $caCert = 'caCert536363365'; - $expectedResponse = new GenerateClientCertificateResponse(); - $expectedResponse->setPemCertificate($pemCertificate); - $expectedResponse->setCaCert($caCert); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->generateClientCertificate($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GenerateClientCertificate', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateClientCertificateExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->generateClientCertificate($formattedParent); - // 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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $response = $gapicClient->getBackup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/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]', '[BACKUP]'); - try { - $gapicClient->getBackup($formattedName); - // 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 getClusterTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->getCluster($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetCluster', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getClusterExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->getCluster($formattedName); - // 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 getConnectionInfoTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $ipAddress = 'ipAddress1480014044'; - $instanceUid = 'instanceUid-737331802'; - $expectedResponse = new ConnectionInfo(); - $expectedResponse->setName($name); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setInstanceUid($instanceUid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->getConnectionInfo($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetConnectionInfo', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConnectionInfoExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - try { - $gapicClient->getConnectionInfo($formattedParent); - // 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 getInstanceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->getInstance($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetInstance', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getInstanceExceptionTest() - { - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - try { - $gapicClient->getInstance($formattedName); - // 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 getUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name2); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - $response = $gapicClient->getUser($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/GetUser', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getUserExceptionTest() - { - $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->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); - try { - $gapicClient->getUser($formattedName); - // 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 injectFaultTest() - { - $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/injectFaultTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/injectFaultTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->injectFault($faultType, $formattedName); - $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.alloydb.v1beta.AlloyDBAdmin/InjectFault', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFaultType(); - $this->assertProtobufEquals($faultType, $actualValue); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - $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 injectFaultExceptionTest() - { - $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/injectFaultTest'); - $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 - $faultType = FaultType::FAULT_TYPE_UNSPECIFIED; - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->injectFault($faultType, $formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/injectFaultTest'); - 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 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->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listBackups($formattedParent); - $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.alloydb.v1beta.AlloyDBAdmin/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->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listBackups($formattedParent); - // 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 listClustersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $clustersElement = new Cluster(); - $clusters = [ - $clustersElement, - ]; - $expectedResponse = new ListClustersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setClusters($clusters); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listClusters($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListClusters', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listClustersExceptionTest() - { - $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]'); - try { - $gapicClient->listClusters($formattedParent); - // 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 listInstancesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $instancesElement = new Instance(); - $instances = [ - $instancesElement, - ]; - $expectedResponse = new ListInstancesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setInstances($instances); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->listInstances($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListInstances', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listInstancesExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->listInstances($formattedParent); - // 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 listSupportedDatabaseFlagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $supportedDatabaseFlagsElement = new SupportedDatabaseFlag(); - $supportedDatabaseFlags = [ - $supportedDatabaseFlagsElement, - ]; - $expectedResponse = new ListSupportedDatabaseFlagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSupportedDatabaseFlags($supportedDatabaseFlags); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listSupportedDatabaseFlags($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSupportedDatabaseFlags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListSupportedDatabaseFlags', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSupportedDatabaseFlagsExceptionTest() - { - $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]'); - try { - $gapicClient->listSupportedDatabaseFlags($formattedParent); - // 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 listUsersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $usersElement = new User(); - $users = [ - $usersElement, - ]; - $expectedResponse = new ListUsersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUsers($users); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->listUsers($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUsers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/ListUsers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listUsersExceptionTest() - { - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - try { - $gapicClient->listUsers($formattedParent); - // 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 promoteClusterTest() - { - $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/promoteClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag2 = 'etag2-1293302904'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag2); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/promoteClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->promoteCluster($formattedName); - $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.alloydb.v1beta.AlloyDBAdmin/PromoteCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - $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 promoteClusterExceptionTest() - { - $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/promoteClusterTest'); - $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $response = $gapicClient->promoteCluster($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/promoteClusterTest'); - 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 restartInstanceTest() - { - $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/restartInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restartInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $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.alloydb.v1beta.AlloyDBAdmin/RestartInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - $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 restartInstanceExceptionTest() - { - $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/restartInstanceTest'); - $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->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); - $response = $gapicClient->restartInstance($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restartInstanceTest'); - 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 restoreClusterTest() - { - $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/restoreClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); - $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.alloydb.v1beta.AlloyDBAdmin/RestoreCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getClusterId(); - $this->assertProtobufEquals($clusterId, $actualValue); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - $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 restoreClusterExceptionTest() - { - $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/restoreClusterTest'); - $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]'); - $clusterId = 'clusterId240280960'; - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->restoreCluster($formattedParent, $clusterId, $cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreClusterTest'); - 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'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $description = 'description-1724546052'; - $clusterUid = 'clusterUid-1141213045'; - $clusterName = 'clusterName-1018081872'; - $reconciling = false; - $etag = 'etag3123477'; - $sizeBytes = 1796325715; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setDescription($description); - $expectedResponse->setClusterUid($clusterUid); - $expectedResponse->setClusterName($clusterName); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $expectedResponse->setSizeBytes($sizeBytes); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->updateBackup($backup); - $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.alloydb.v1beta.AlloyDBAdmin/UpdateBackup', $actualApiFuncCall); - $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 - $backup = new Backup(); - $backupClusterName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); - $backup->setClusterName($backupClusterName); - $response = $gapicClient->updateBackup($backup); - $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 updateClusterTest() - { - $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/updateClusterTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $network = 'network1843485230'; - $etag = 'etag3123477'; - $reconciling = false; - $expectedResponse = new Cluster(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setNetwork($network); - $expectedResponse->setEtag($etag); - $expectedResponse->setReconciling($reconciling); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateClusterTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->updateCluster($cluster); - $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.alloydb.v1beta.AlloyDBAdmin/UpdateCluster', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getCluster(); - $this->assertProtobufEquals($cluster, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - $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 updateClusterExceptionTest() - { - $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/updateClusterTest'); - $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 - $cluster = new Cluster(); - $clusterNetwork = $gapicClient->networkName('[PROJECT]', '[NETWORK]'); - $cluster->setNetwork($clusterNetwork); - $response = $gapicClient->updateCluster($cluster); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateClusterTest'); - 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 updateInstanceTest() - { - $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/updateInstanceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $gceZone = 'gceZone-227587294'; - $ipAddress = 'ipAddress1480014044'; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Instance(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setGceZone($gceZone); - $expectedResponse->setIpAddress($ipAddress); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateInstanceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->updateInstance($instance); - $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.alloydb.v1beta.AlloyDBAdmin/UpdateInstance', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - $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 updateInstanceExceptionTest() - { - $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/updateInstanceTest'); - $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 - $instance = new Instance(); - $instanceInstanceType = InstanceType::INSTANCE_TYPE_UNSPECIFIED; - $instance->setInstanceType($instanceInstanceType); - $response = $gapicClient->updateInstance($instance); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); - 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 updateUserTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $password = 'password1216985755'; - $expectedResponse = new User(); - $expectedResponse->setName($name); - $expectedResponse->setPassword($password); - $transport->addResponse($expectedResponse); - // Mock request - $user = new User(); - $response = $gapicClient->updateUser($user); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateUser', $actualFuncCall); - $actualValue = $actualRequestObject->getUser(); - $this->assertProtobufEquals($user, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateUserExceptionTest() - { - $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 - $user = new User(); - try { - $gapicClient->updateUser($user); - // 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 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -}